Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
django cannot find static files
I am building login page application. Intended login page application shown in below link. This login page has two images and alignment done using css and other files in django. When I run django server I am able to see login textboxes and static text labels, but not images and alignments is not proper, path for which is fetched from STATIC_URL or STATIC_ROOT in settings.py. When I run the serer I am seeing error like this [10/Mar/2020 20:18:41] "GET / HTTP/1.1" 302 0 [10/Mar/2020 20:18:41] "GET /login/?next=/ HTTP/1.1" 200 2607 [10/Mar/2020 20:18:41] "GET /login/static/dau_gui_app/fontawesome-free-5.3.1-web/css/all.min.css HTTP/1.1" 404 141 [10/Mar/2020 20:18:41] "GET /static/dau_gui_app/style.css HTTP/1.1" 404 102 [10/Mar/2020 20:18:41] "GET /static/dau_gui_app/w3.css HTTP/1.1" 404 99 [10/Mar/2020 20:18:41] "GET /static/dau_gui_app/bootstrap.min.css HTTP/1.1" 404 110 [10/Mar/2020 20:18:41] "GET /static/dau_gui_app/dataTables/datatables.css HTTP/1.1" 404 118 [10/Mar/2020 20:18:41] "GET /static/dau_gui_app/dataTables/jQuery-3.3.1/jquery-3.3.1.js HTTP/1.1" 404 132 [10/Mar/2020 20:18:41] "GET /static/dau_gui_app/dataTables/datatables.js HTTP/1.1" 404 117 [10/Mar/2020 20:18:41] "GET /static/dau_gui_app/images/logo.png HTTP/1.1" 404 108 [10/Mar/2020 20:18:41] "GET /static/dau_gui_app/images/alstom_logo.png HTTP/1.1" 404 115 My login.html looks like this: {% load i18n %} {% load admin_static %}{% load firstof from future %}<!DOCTYPE html> <html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="static/dau_gui_app/fontawesome-free-5.3.1-web/css/all.min.css"> <link rel='shortcut icon' type='image/x-icon' … -
How to rename a python-react project in vs code teminal
I'm new to django framework. I'm trying to rename a python project from the vs code terminal but it is giving me error. Any help will be appreciated. Below is the deatails: python manage.py rename max_ecommerce usage: manage.py rename [-h] [--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color] [--force-color] current [current ...] new [new ...] manage.py rename: error: the following arguments are required: new -
Django Mongodb connection error ServerSelectionTimeoutError
I'm trying to connect my django application to a mongodb. When connecting I got following error. Anyone knows why? app_1 | File "/opt/project/backend/util/mongodb/client.py", line 23, in __init__ app_1 | self.collection.create_indexes(indexes) app_1 | File "/usr/local/lib/python3.6/site-packages/pymongo/collection.py", line 1820, in create_indexes app_1 | with self._socket_for_writes() as sock_info: app_1 | File "/usr/local/lib/python3.6/site-packages/pymongo/collection.py", line 197, in _socket_for_writes app_1 | return self.__database.client._socket_for_writes() app_1 | File "/usr/local/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1121, in _socket_for_writes app_1 | server = self._get_topology().select_server(writable_server_selector) app_1 | File "/usr/local/lib/python3.6/site-packages/pymongo/topology.py", line 226, in select_server app_1 | address)) app_1 | File "/usr/local/lib/python3.6/site-packages/pymongo/topology.py", line 184, in select_servers app_1 | selector, server_timeout, address) app_1 | File "/usr/local/lib/python3.6/site-packages/pymongo/topology.py", line 200, in _select_servers_loop app_1 | self._error_message(selector)) app_1 | pymongo.errors.ServerSelectionTimeoutError: sg-backendstagingmongodb-25690.servers.mongodirector.com:27017: [Errno 104] Connection reset by peer -
Depending on field value change nested serializer
I am currently trying to implement the following serializer to the Profile serializer. But I would like to add a condition to it. Profile serializer class UserProfileSerializer(serializers.ModelSerializer): role = serializers.ChoiceField(choices=(('Reader', u'Reader'), ('Author', u'Author'), ('Admin', u'Admin'))) role_display = serializers.SerializerMethodField() class Meta: model = Profile fields = ('gender', 'birthday', 'icon', 'role', 'role_display') depth = 1 Author serializer class AuthorSerializer(serializers.ModelSerializer): class Meta: model = Author fields = '__all__' Reader serializer class ReaderSerializer(serializers.ModelSerializer): class Meta: model = Reader fields = '__all__' Both author and reader table has a one-to-one relationship towards profile table. Depending on the role option I would like to show a specific nested serializer. Example: { "id": 19, "username": "maoji1", "password": "pbkdf2_sha256$180000$YhzDiqzJ4OyC$syzkwR5X3/H2p5NTB0JEK2zS5nvYu5ddHrTgy3cYU/E=", "email": "pbkdf2_sha256$180000$YhzDiqzJ4OyC$syzkwR5X3/H2p5NTB0JEK2zS5nvYu5ddHrTgy3cYU/E=", "profile": { "gender": "male", "birthday": "2020-03-10", "icon": null, "role": { is_vip:True, validate_date:... } } } -
Filter select options by another models field
I'm building a project manager app, and I want to make that the options for the 'assigned_to' field in Task only show the participants in the grandparent Project. Is it possible? models.py class Project(models.Model): name = models.CharField(max_length=250) description = models.TextField(blank=True) project_lead = models.ForeignKey(User, on_delete=models.CASCADE, related_name='jefe_user', default='EGINBOOK') participants = models.ManyToManyField(User, related_name='participantes_user', blank=True) class Milestone(models.Model): project = models.ForeignKey(Project, on_delete=models.CASCADE, null=True) name = models.CharField(max_length=250) deadline = models.DateField(default=timezone.now) class Task(models.Model): milestone = models.ForeignKey(Milestone, on_delete=models.CASCADE) name = models.CharField(max_length=250) description = models.TextField(blank=True) assigned_to = models.ManyToManyField(User) status = models.CharField(max_length=5, choices=[(tag, tag.value) for tag in Taskstatus], default='Pendiente') deadline = models.DateField(default=timezone.now) -
How to filter a queryset for the highest value in one field grouped by each value in another field?
If I have a model like this from django.db import models class Thing(models.Model): name = models.CharField(max_length=255, unique = True, null=False) version = models.IntegerField(null = False) type = models.CharField(max_length=255, null=False) and I have a bunch of entries like Thing.objects.create(name = "foo1", version = 1, type = "A") Thing.objects.create(name = "foo2", version = 2, type = "A") Thing.objects.create(name = "bar1", version = 1, type = "B") Thing.objects.create(name = "bar2", version = 2, type = "B") Thing.objects.create(name = "bar3", version = 3, type = "B") How do I write a single Django query that will give me one entry for each of type type with the highest version? So, this result: Queryset< Thing(name = "foo2", version = 2, type = "A"), Thing(name = "bar3", version = 3, type = "B") > I was looking at the docs here; https://docs.djangoproject.com/en/3.0/topics/db/aggregation/ And its easy to do something like this; Thing.objects.aggregate(Max('version')) But this would only give me Thing(name = "bar3", version = 3, type = "B") -
I am trying to run the django wagtail demo app on google app engine. The app has been deployed and there are no errors on the GCP error reporting
I have allowed traffic on firewall port 8080, but I believe the issue lies in the app.yaml file and have added: entrypoint: uwsgi --http-socket :8080 --wsgi-file main.py, still the same error. My app.yaml is as below: runtime: python37 entrypoint: uwsgi --http-socket :8080 --wsgi-file main.py handlers: - url: /static static_dir: static/ - url: /.* script: auto env_variables: DJANGO_SETTINGS_MODULE: mysite.settings.production -
Twilio on Django, send SMS to numbers from database [closed]
I need to send SMS to all numbers from my database on Django, This is the code on twilio on python, how am I going to integrate this code to my django app and execute it in a button. And also from the body="As of {timestamp}, how to do that getting time.now? Thanks! from twilio.rest import Client account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' auth_token = 'your_auth_token' client = Client(account_sid, auth_token) message = client.messages \ .create( body="As of {timestamp}, the level is critical", from_='+15017122661', to='+15558675310' ) print(message.sid) -
Displaying Progressbar on same page using Ajax
I am using [https://github.com/czue/celery-progress][1] to display progressbar in django celery, I am able to display progressbar on redirecting the result to new-page but when I am trying to display on same page using ajax using following code I am unable to display the progress: $('#yuvform').on('submit', function(e) { //Alert.render('You will receive error email if generation fails'); e.preventDefault(); //e.stopImmediatePropagation(); //alert("Hello"); //var extern = document.querySelector('link[rel="import"]').import; //alert("Hello"); //alert($(extern).val()); $.ajax({ data: $(this).serialize(), // get the form data type: $(this).attr('method'), // GET or POST url: $(this).attr('action'), success: function(data) { if(data.frame_width_absent){ Alert.render('Please enter frame-width'); } else if(data.frame_height_absent){ Alert.render('Please enter frame-height'); } else if(data.frame_fps_absent){ Alert.render('Please Enter frame-fps'); } else if(data.bit_rate_absent){ Alert.render('Please Enter Bit-Rate'); } else if(data.bit_depth_absent){ Alert.render('Please Enter bit-depth'); } else if(data.container_absent){ Alert.render('Please Enter container'); } else if(data.duration_absent){ Alert.render('Please Enter container'); } /* else{ Alert.render('Success If generation fails you will receive an email'); }*/ //$('#frame').html(response); } }); //Alert.render('Success If generation fails you will receive an email'); //return false; }); }); If I remove the e.preventDefault(); line the progressbar is displayed on different page. -
Double calling of methods
I’m trying to get the value of method in django I’m getting get_object when I try to print It calls twice, one with value and second is None def get_object(self): section = ... return get_object_or_404(Section, pk=section) I’m using that object on my get_context_data and tried to print but I get two values of none and with values. Can someone explain what when wrong here. Thanks -
Django adding new models, Exception Type: OperationalError Exception Value: no such table:
I am trying to learn how to use Django and I made a new model, and when syncing the db and making migrations i am keep getting this error. How can I fix this or what am I doing wrong? I have tried running python manage.py makemigrations, manage.py migration, manage.py makemigrations --syncdb nothing seems to work. Environment: Request Method: GET Request URL: http://127.0.0.1:8080/admin/terra/terraformrepolist/ Django Version: 3.0.3 Python Version: 3.7.3 Installed Applications: ['terra.apps.TerraConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] Traceback (most recent call last): File "C:\Users\User\PycharmProjects\WonderUS\venv\lib\site-packages\django\db\backends\utils.py", line 86, in _execute return self.cursor.execute(sql, params) File "C:\Users\User\PycharmProjects\WonderUS\venv\lib\site-packages\django\db\backends\sqlite3\base.py", line 396, in execute return Database.Cursor.execute(self, query, params) The above exception (no such table: terra_terraformrepolist) was the direct cause of the following exception: File "C:\Users\User\PycharmProjects\WonderUS\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "C:\Users\User\PycharmProjects\WonderUS\venv\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "C:\Users\User\PycharmProjects\WonderUS\venv\lib\site-packages\django\core\handlers\base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\Users\User\PycharmProjects\WonderUS\venv\lib\site-packages\django\contrib\admin\options.py", line 607, in wrapper return self.admin_site.admin_view(view)(*args, **kwargs) File "C:\Users\User\PycharmProjects\WonderUS\venv\lib\site-packages\django\utils\decorators.py", line 130, in _wrapped_view response = view_func(request, *args, **kwargs) File "C:\Users\User\PycharmProjects\WonderUS\venv\lib\site-packages\django\views\decorators\cache.py", line 44, in _wrapped_view_func response = view_func(request, *args, **kwargs) File "C:\Users\User\PycharmProjects\WonderUS\venv\lib\site-packages\django\contrib\admin\sites.py", line 231, in inner return view(request, *args, **kwargs) File "C:\Users\User\PycharmProjects\WonderUS\venv\lib\site-packages\django\utils\decorators.py", line … -
Debug in settings is causing issues with images in media folder
In Django, I have set DEBUG = False and ALLOWED_HOSTS = ['localhost', '127.0.0.1']. But due to it, images tend to get hide even if they are shown in the TERMINAL. I always do clear the cache of both Google Chrome and Mozilla Firefox. Below is the screenshot from chrome Also their seems to an issue with Firefox At a moment, Chrome was showing all the images while firefox didn't show any of them in the below screenshot -
When crawling the text from the website by using the scrapy ,it will crawl all the content but not crawl the link content ,how to solve the issue
when crawl the data full content is not crawled ,here tag content is not crawled and also how to crawl tag href at a time. Html.code <p class="gnt_ar_b_p"> 24/7 Tempo has compiled a list of drugs in short supply from information provided by the <p class="gnt_ar_b_p"> However, drugs are frequently announced to be in short supply. In fact, the FDA has a running list of drug shortages due to anything from increasing demand to regulatory factors as well as supply disruptions. </p> <a href="https://www.accessdata.fda.gov/scripts/drugshortages/default.cfm" data-t- l="|inline|intext|n/a" class="gnt_ar_b_a"> Food and Drug Administration</a>. </p> shell response.css('p.gnt_ar_b_p').xpath("text()").extract() output 24/7 Tempo has compiled a list of drugs in short supply from information provided by the However, drugs are frequently announced to be in short supply. In fact, the FDA has a running list of drug shortages due to anything from increasing demand to regulatory factors as well as supply disruptions. -
Dynamically creating a list of F combined expressions Django
I am trying to create a formula field in the database for a project I am working on, at the moment I am having trouble with the numerical side of the operators, I am trying to create a list of Combined Expressions so that I can add use it in an annotation. Example of working: return F('field1') + F('field2') I am trying to dynamically create the fields it should return and the operator. Any help would be appreciated. Thanks. -
Django Foreignkey reverse access when parent model has multiple Foreignkeys
I am using the standard Django User-model and wrote this cutom Model: class Messages(models.Model): sender = models.ForeignKey(User, related_name="sender", on_delete=models.CASCADE) receiver = models.ForeignKey(User, related_name="receiver", on_delete=models.CASCADE) content = models.TextField() date = models.DateTimeField(default=timezone.now) Now, given a User-object user i want to access all the Messages he either sent or received. I tried: user.messages_set.all() but i am getting the following Error: 'User' object has no attribute 'messages_set'. How do i fix this? Thanks for your Answers! -
Display rating in html
I am working on a project in django, where I have created a toplist based on the rating given in the reviews. Is there a way I can get the rating of the films showed in the html? from models.py class Film(models.Model): title = models.CharField(max_length=100) title_short = models.CharField(max_length=17, default=None, null=True) plot = models.TextField() poster = models.ImageField(default="default.png", upload_to="posters") release_date = models.DateField(blank=True, null=True) date_posted = models.DateTimeField(default=timezone.now) class Review(models.Model): writer = models.ForeignKey(User, on_delete=models.CASCADE) reviewed_film = models.ForeignKey(Film, related_name='reviews', on_delete=models.CASCADE) title = models.CharField(max_length=100) content = models.TextField() rating = models.IntegerField( default=1, validators=[MinValueValidator(1), MaxValueValidator(5)] ) def __str__(self): # pragma: no cover return f"{self.reviewed_film.title} reviewed by {self.writer.username}" from toplist.html {% extends "board/base.html" %} {% block content %} <h1>Toplist</h1> {% for film in films %} <div class="col s12 m7"> <h2 class="header"></h2> <div class="card horizontal"> <div class="card-image"> <img src="/media/{{film.poster}}"> </div> <div class="card-stacked"> <div class="card-content"> <h5>{{forloop.counter}}. {{film.title}}</h5> <p>{{}}/5.0</p> </div> <div class="card-action"> <a href="#">Read more</a> </div> </div> </div> </div> {% endfor %} {% endblock content %} -
how can i print all array data to template page in browser not in console in django
How can I print all data of array or list of Django Framework in browser HTML Page instead of console of django just like PHP echo '<pre>'; print_r($data); in PHP, is there any way as it is really hectic to check the output in console. -
Django virtual model pretending a real one
I need to move one of my Django apps into microservice, it's Files app, that have File and Folder models inside of it. Other apps using this app, and it's models to attach files to some other models, for example, User has "avatar" field, which is linked to a File model, Blog has "folders" field, which linked to a list of Folder models, and so on. Microservice would be accessible by REST API, and whould have methods for quering files and folders rich enought to satisfact all the needs of existing code. Now, to make my transition easier, I don't wont to change models, that are using my old File and Folder models. I want to create "virtual" models, named as File and Folder, that doens't have any tables in the database, and not the DjangoORM models at all. But they should mimic behavior of usual models, being just a "proxy" of "facade" to the REST API. So, it should be possible to use models as usual: # Quering files (this actually does request like GET files-service/api/files/all/filter?object_id=157&object_type=user): user_files = File.objects.filter(object_id=157, object_type='user').all() # Getting single file (this actually does request like GET files-service/api/files/7611): single_file = File.objects.get_for_id(7611) # Using linked object (avatar … -
Does django have some inbuilt model getter functionality? I've "lost" a function
I'm just.. I dunno. The model is calling self.get_next_by_context_start(). And it works. I can call it in a shell. But I've grepped the entire codebase and... it's just... not there. grep -r "get_next_by_context_start" - this lists just two instances of the string, both times where the function is being called. There's no def get_next_by_context_start anywhere. How am I being this stupid? How can I lose an entire function? -
What is the `_container` property of Django's http.response?
I can't find one good source that actually tries to explain it. The top 5 search results are just different links to source code. Right now, I'm trying to read a PDF that is being returned from a GET request, and I want to know why it's in response._container, when response is type HttpResponse. Is this PDF even what I'm looking for? Why is it the second element in the _container list? -
How send a Django User object using json to link a user to another model
I am pretty new to Django and am having trouble linking the current user to an auction item I am creating. I have read a load of articles but just can't get this working. The app has 3 models; the built in User model from django.contrib.auth.models, an Item model and an Auction model. The idea is that when an Item is created, it is linked to a User and a new Auction. I am using serializer classes from the django-rest-framework for the Item and the Auction that create the objects and save them in the database: serializers.py from rest_framework import serializers from .models import Item, Auction class ItemSerializer(serializers.ModelSerializer): def create(self, validated_data): item = Item.objects.create(**validated_data) return item class Meta: model = Item fields = '__all__' depth = 2 class AuctionSerializer(serializers.ModelSerializer): def create(self, validated_data): auction = Auction.objects.create(**validated_data) return auction class Meta: model = Auction fields = '__all__' depth = 1 models.py from django.db import models from django.contrib.auth.models import User from django.utils.timezone import now from datetime import date, timedelta class Item(models.Model): title = models.CharField(max_length=100) timestamp = models.DateTimeField(default=now, editable=False) condition = models.CharField(max_length=50) description = models.TextField() owner = models.ForeignKey( # is this the correct way to refer to the user if not using a custom … -
prefetch for a model with two m2m field to through model
i am using mysql and these are my tables: class Movie(models.Model): title = models.CharField(max_length=255) voice_languages = models.ManyToManyField('Language', through='LanguageMiddle', related_name='voice_language') subtitle_languages = models.ManyToManyField('Language', through='LanguageMiddle', related_name='sub_language') ... @classmethod def _check_m2m_through_same_relationship(cls): return [] class Language(models.Model): title = models.CharField(max_length=50, unique=True) title_en = models.CharField(max_length=50, blank=True) class Meta: db_table = 'language' class LanguageMiddle(models.Model): LANGUAGE_TYPE = ( (0, 'voice'), (1, 'sub') ) movie= models.ForeignKey('Movie', on_delete=models.DO_NOTHING) language = models.ForeignKey('Language', on_delete=models.DO_NOTHING) language_type = models.CharField(max_length=5, choices=LANGUAGE_TYPE) class Meta: db_table = 'language_middle' after reading this ticket and seeing that none of the solutions work for me i have added that class method. now when i try to use prefetch in my query like this: prefetch = Prefetch('subtitle_languages', queryset=LanguageMiddle.objects.prefetch_related('languagemiddle_set')) queryset = queryset.prefetch_related(prefetch) to get for each movie the related subtitle_languages and voice_languages but i will get the following error Cannot resolve keyword 'sub_language' into field. Choices are: movie, movie_id, id, language, language_id, language_type so i have changed languagemiddle_set with language__languagemiddle_set but it throws the same error . and for voice_languages it is also the same is this because of the hackish overriding that i am doing or i am doing something wrong here? -
can't understand django csrf exempt for cbv's code
i cant understand the meaning of the dispatch method and what is the method_decorator class CSRFExemptMixin(object): @method_decorator(csrf_exempt) def dispatch(self, *args, **kwargs): return super(CSRFExemptMixin, self).dispatch(*args, **kwargs) can you please answer this question? -
Django Rest Framework - "Unable to create account" with Djoser
I have some issue with User registration. I'm using library Djoser by Sunscrapers. During creating new User from Postman i get "Unable to create account" response. In my terminal (docker) I get following informations: ERROR: null value in column "country_id" violates not-null constraint DETAIL: Failing row contains (53, null, , t, jaroslawpsikuta1@gmail.com, pbkdf2_sha256$180000$p2Q8c4Du3uLF$o56YHGCS0ZutasVhevPXl8rrMG/VYL..., , null, , , , 2020-03-10 10:06:48.053201+00, null, f). STATEMENT: INSERT INTO "accounts_user" ("last_login", "email", "is_superuser", "is_active", "password", "first_name", "last_name", "date_of_birth", "description", "address", "phone", "created_at", "country_id") VALUES (NULL, 'jaroslawpsikuta1@gmail.com', false, true, 'pbkdf2_sha256$180000$p2Q8c4Du3uLF$o56YHGCS0ZutasVhevPXl8rrMG/VYLiyzTB6LrSY4ws=', '', '', NULL, '', '', '', '2020-03-10T10:06:48.053201+00:00'::timestamptz, NULL) RETURNING "accounts_user"."id" It seems like Djoser don't see my request body, and it's trying to put empty or null values into database. Till now, I tried following solution: Customize the djoser create user endpoint ...but it didn't work. Do You have any ideas how to resolve it? Maybe I forgot something? Thank You for help :) Best regards, -
how to add delete button in each row of my table?
How is going? I'm learning to programming in django. For the moment I'm building a simple app that utilizing a form update the referenced table. Now I'm try to add a delete button in each row of my table but, beside I have tried a lot of solutions, I didn't find one that works correctly. Below my code: urls from django.urls import path from app import views urlpatterns = [ path('', views.homepage, name='homepage'), #path('algo', views.PersonListView.as_view(), name='algo'), ] forms from django import forms from .models import Income class IncomeModelForm(forms.ModelForm): class Meta: model = Income fields = "__all__" tables import django_tables2 as tables from .models import Income class PersonTable(tables.Table): class Meta: model = Income template_name = "django_tables2/bootstrap.html" views from django.shortcuts import render from django.http import HttpResponse from django.views.generic import ListView from .models import Income from .tables import PersonTable from .forms import IncomeModelForm def homepage(request): table = PersonTable(Income.objects.all()) if request.method == 'POST': form = IncomeModelForm(request.POST) if form.is_valid(): print("Il form è valido") new_input = form.save() else : form = IncomeModelForm() context= {"form": form, "table":table } return render(request, "app/base.html", context) html {% load static %} {% load render_table from django_tables2 %} <!doctype html> <html lang="it"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" …