Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Add blitz_work to installed apps in settings.py.
INSTALLED_APPS = [
...,
...,
'blitz_work',
]
Create the models.
from django.db import models
class Author(models.Model):
name = models.CharField(verbose_name="Name", max_length=255)
birth_date = models.DateField(verbose_name="Birth date")
class Meta:
verbose_name = "Author"
verbose_name_plural = "Authors"
def __str__(self):
return self.name
class Book(models.Model):
title = models.CharField(verbose_name="Title", max_length=255)
publication_date = models.DateField(verbose_name="Publication date")
authors = models.ManyToManyField(Author,verbose_name="Authors")
class Meta:
verbose_name = "Book"
verbose_name_plural = "Books"
def __str__(self):
return self.title
Create the template.
{% extends 'blitz_base_offline.html' %}
{% block main %}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Test</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="{% url 'book/view' %}">Libros</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'author/view' %}">Autores</a>
</li>
</ul>
</div>
</nav>
{% block content %}{% endblock %}
{% endblock %}
Create the views.
from Book.models import Author, Book
from blitz_work.blitzcrud import BlitzCRUD
class BookCRUD(BlitzCRUD):
show_title = True
show_caption = False
caption_is_title = True
extend_template = "base.html"
data = Book
class AuthorCRUD(BlitzCRUD):
show_title = True
show_caption = False
caption_is_title = True
extend_template = "base.html"
data = Author
Include the URLs.
from app.views import AuthorCRUD, BookCRUD
from django.urls import path,include
from blitz_work.blitzcrud import get_urls
urlpatterns = [
path('book/', include(get_urls(BookCRUD,"book"))),
path('author/', include(get_urls(AuthorCRUD,"author"))),
]
More help
Include Blitz Work help urls in urls.py
from blitz_work.urls import urlpatterns
urlpatterns = [
path('',include(urlpatterns)),
]
Run the server.
python manage.py runserver localhost:8000
Go to the url blitz-doc-en/ or blitz-doc-es/
FAQs
Django-based framework for rapid application development.
We found that blitz-work demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.