Most voted "django" questions
Django is an open source Web 2.0 application framework written in Python. Its main objective is to facilitate the creation of complex database websites.
Learn more…1,067 questions
Sort by count of
-
-1
votes1
answer900
viewsAttributeerror: 'list' Object has no attribute '_meta'
I’m trying to edit an object but I’m not being able to instantiate it by the desired id filter to show in my form and edit. Django 2.1.15 Python 3.8.1 my views.py def Alterar_Pessoa(request, id):…
-
-1
votes1
answer38
viewsDoes the INTERNAL_IPS variable control the Django DEBUG variable?
My Django application should run two environments: one for development and one for production. When running in the development environment, access to application by 127.0.0.1 and when production…
djangoasked 4 years, 7 months ago Thiago Krempser 1,878 -
-1
votes2
answers40
viewsI cannot update information in the bank
I receive from a form the following information, number (which must be reserved), reserved_by and phone. I have to take the number to reserve and update it with the information received, but of…
-
-1
votes1
answer74
viewsHow to page a search page in Django?
Hello, I am trying to paginate the results of a search page on Django, but without success. A class based view is responsible: class SearchResultsView(ListView): model = User paginate_by = 2…
-
-1
votes1
answer203
viewsHow to create 2 Forms simultaneously in Django and configure the views
What I want to do is create 2 Forms simultaneously, on just one page 'index.html'. One would just be a normal form that will send a message to contact, and the other is a record that I need to save…
-
-1
votes1
answer42
viewsInformation does not appear in the form when editing
With the primary key ID, work with the information in the views, but it does not appear in the edit(html), the fields sector and company appears. Views @login_required(login_url='/login/') def…
-
-1
votes1
answer26
viewsPost in two columns in Django
Good evening(or good morning/good afternoon). I have a question about position within the layout. In the first code that I had made the posts were all of a single side only that I wanted them 2 in 2…
-
-1
votes1
answer28
viewsHow to resolve Templatesyntaxerror in Django?
This is my code snippet, and as you can see, I close the block at the end, but I keep getting the bug {% extends "encyclopedia/layout.html" %} {% block title %} Edit page {% endblock %} {% block…
-
-1
votes1
answer41
viewsHow to relate two form Fields in Django?
Good afternoon! I am new to Jango and I am creating a system that will serve as a spreadsheet to help in the analysis of some demands. The demands will be a certificate called CAT requested by…
-
-1
votes1
answer50
viewsDjango: Template not found :(
Good afternoon, you guys! I’m creating a url that will update the information sent in the form. I never worked with a url that pulled an id, and now I’m getting an error that Templatedoesnotexist…
-
-1
votes1
answer55
viewsHow to Make the following function in pure javascript?
I would like to make the following calculation: take the amount of value to pay,take the value of the days of delay and that when clicking the confirm button do the following calculation:…
-
-1
votes1
answer108
viewsHeroku does not recognize my Django app
I’m starting my studies with Django and created an application called core within the name Django project django1. After finishing, I decided to deploy it to Heroku with the following step by step…
-
-1
votes1
answer76
viewsHow do I create a Slug automatically from the title of an item created with a Django form
Like the line prepopulated_fields = {'slug': ('name',)} you can generate the Slug of an object automatically just by typing its name in the admin panel. I wanted to do this also when the object is…
-
-1
votes3
answers384
viewsDownload spreadsheet with Openpyxl
I’m struggling to resolve this issue. I’ve done a lot of research and haven’t found a solution to the problem yet. In Python, I use the Openpyxl library to generate a simple spreadsheet in Excel.…
-
-1
votes1
answer28
viewsproblem with HTML
I’m having trouble rendering this HTML, I’m using Jango and this is the template that you get from Viewer, when trying to use this new format of cards I’m having problems, I want it to be a fixed…
-
-1
votes1
answer144
viewsHow to use objects in Django
I have to create models based on the following UML: I actually made the code of Experience that way: class Experiencia(Base): ACADEMICA = 'AC' PROFISSIONAL = 'PR' TIPO_CHOICES = [ (ACADEMICA,…
-
-1
votes2
answers100
viewsSearch between two dates in Django
I have a program where I need to search through GET on Django the data present between two dates (the user will define these dates) Models py. class Data(models.Model): dev =…
-
-1
votes2
answers50
viewsHow to send text via the template via url in Django?
I want to send text to a view through the template. I have two different types of clients that will be processed differently, to take advantage of code I put in one view and the specific part I…
-
-1
votes1
answer33
viewsHow do I call the email field from the default table auth_user?? needed to make users register with email, user and password
my Register.html is like this <!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="UTF-8"> <link…
-
-1
votes2
answers107
viewsHow to filter choices from a field based on choices from another form field in Django?
In Django Admin I have a model who has two fields: Unidade and Localizacao. Where Unidade has a ManyToManyField for Localizacao, as follows below class Unidade(models.): nome =…
javascript python django django-templates django-adminasked 3 years, 8 months ago Leonardo Furtado 144 -
-1
votes1
answer72
viewsRestart Django Python server
Hello! I’m starting in the world of programming, through a book called "Intensive Python Course". One of the book’s projects involves creating a virtual environment to use Django. I was able to…
-
-1
votes1
answer68
viewsInserting records into the database from a file
I’m trying to enter records into my database, specifically the model Participante from a file .csv, whose format is id, name, Cpf and email. So far what I have in mine views.py is: def…
-
-1
votes2
answers29
viewsError importing Model Django 3.1
Hello, I am trying to import a model to use inside my View and I am having problems, I made a test file to try to import before putting the model in the view. I already registered the app, I already…
-
-1
votes1
answer31
viewsHow to filter form options by foreign key? - Django Admin
I need to show only objects that have the same foreign key company in Django in the admin view. What I got was to show only the related objects using get_queryset, but in the form fields appear all…
-
-1
votes1
answer34
viewsInterrupt the POST Django
I am developing a customer registration project/ addresses/ products, and now I am doing the inventory part (list which products certain clients hired), and I put to send the customer ID and…
-
-1
votes1
answer26
viewsHow do I make a Boolean field model to accept only 1 true and multiple false values in Django?
An example of a client’s model address: class Address(models.Model): activate = models.BooleanField(null=False, default=False) AddressLine1 = models.CharField(max_length=60, blank=True, null=True)…
-
-1
votes1
answer30
viewsHow to resolve error in makemigrations (Django)
I’m trying to execute command python manage.py makemigrations, and is generating this return on my terminal, even when I try to start the Django server using the python manage.py runserver, the…
-
-1
votes1
answer29
viewsHow do I create a dynamic link to a Django admin screen?
How to use the tags of the Django templates to create a dynamic link to the admin boards? Let’s say the name of the admin panel is ProductsAdmin, and that this table was created and registered in…
-
-1
votes1
answer7
viewsShow text on page from Django database
Hello, I’m trying to display a text from the mysql database, using Django, I’ve searched for several tutorials but nothing works, if anyone can help thank you already. This is part of my file:…
-
-1
votes1
answer30
viewsUnexpected tokens - boostrap4
{% load bootstrap4 %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1,…
-
-1
votes1
answer19
viewsHow to load dynamically staticfiles CSS and Javascripts in Django
I’m writing in Python with Django. As a common practice, I created a "base.html" template that will then be extended by several other pages. Each one will have its own CSS file and its own…
-
-1
votes1
answer15
viewsError in get_absolute_url Django
I have the following error in Django: Reverse for 'list_produtos' with Arguments '(2,)' not found. 1 Pattern(s) tried: ['$'] Follows the codes: py.models from django.db import models from…
-
-1
votes1
answer34
viewsRender JSON Django field
I am doing a project using Django 3.1.2, this project needs a log. I created a template for logs: class Log(models.Model): Usuario = models.CharField('Usuário que fez a ação', max_length=100) Perfil…
-
-1
votes1
answer26
viewsCreate serialization with data from two tables
Good evening guys, I need help to be able to serialize the data according to "Desired result" but I’m only getting the result of the image "Result I’m getting", someone can help me? Thank you!…
-
-1
votes0
answers10
viewsDjango Createview - Method Not Allowed when trying to register by loading form with Bootstrap Modal
When trying to submit a form to enter in the database I am receiving, in the browser console, the error message Failed to load Resource: the server responded with a status of 405 () when I load my…
-
-1
votes0
answers9
viewspermissions in the Django template
I’m trying to create a permission in the Django template but I couldn’t. Wanted to set in the template only professional users to view a button. This is the professional model I’m creating. class…
-
-1
votes0
answers16
viewsRegistration - Model - Django
Greetings! Next, I would just like suggestions or some direction, because I feel in the middle of the Atlantic with a piece of styrofoam. I would like to have in Django some types of users and do…
-
-1
votes0
answers19
viewsReturn student name in query along with matricula - python and Django admin
Base Class: class Base(models.Model): IncPor = models.IntegerField('Incluido Por', null=True, blank=True) AltPor = models.IntegerField('Alterado Por', null=True, blank=True) IncEm =…
-
-1
votes0
answers18
viewsDRF to delete multiple records with field other than ID
I am using the Django Rest Framework and would like to make a mass exclusion using the "contract" field which is an interger. View py. class AlugueisViewSet(viewsets.ModelViewSet): filter_backends =…
-
-2
votes1
answer308
viewsWeb Frameworks: Frontend vs Backend
I would like to know what characterizes/differentiates a web frontend framework from a web backend framework. For example, Django is considered back and Angular is considered front, but what makes…
-
-2
votes1
answer53
viewsError creating routes dynamically in Django
of good? Next, taking my first steps with Framework Django and having some difficulties, some managed to overcome "alone", this bone. I have a basic blog project with some views, in which shows the…
-
-2
votes2
answers146
viewsHow do I apply a python/Django filter
from django_filters import FilterSet from django.db import models Pessoa(models.Model): nome= models.TextField() Marca(models.Model): nome = models.TextField() Carro(models.Model): pessoa =…
-
-2
votes1
answer27
viewsGuys I have a for that every turn will show a video. I want the videos to be aligned 3 X 3 on the page. How can I do this?
I want to align the videos that the loop will display as follows, but without using Bootstrap: [] [] [] [] [] [] [] [] [] If it were just Frontend I could do this alignment with CSS(FLEX-BOX) good,…
-
-2
votes1
answer16
viewsDeploy Django+React js
Hi, I’d like to ask you a few questions. Suppose I want to make an api for a store application using Django and the frontend using React js. How would the application deploy work, I would need to…
-
-2
votes1
answer119
viewsHow to make an auto sum function in javascript
How can I do a function in javascript that changes the total_productions field every time a field changes its value in the form? I have the following code Template <form class="form" role="form"…
-
-2
votes1
answer161
viewsConfiguration of NGINX + uWSGI + Django in a multi-tenancy application
I have a single application in Django hosted on AWS. But these days, I turned it into multi-tenancy, using Django-tenant-schemas. Locally, it runs normally. I can create my tenants and access them…
-
-2
votes1
answer181
viewsLoad a variable from a file with module. Django/Python
Hello, my name is Marvin, I’m a beginner in the area and I have a problem giving a 'POST' a 'file.py' variable to my local server Django. I use a module called 'openpyxl' that serves to load a table…
-
-2
votes1
answer179
viewsReset password via RG Django
Good evening...I’m trying to make the user password recovery through the ID...but when sending the form with the ID... this error occurs. someone could help me? py. app_name = 'usuarios' urlpatterns…
-
-2
votes1
answer62
viewsWhere should the mediafiles directory be in the Django configuration to be able to download the files on the Heroku server (free app)?
After uploading the file for hours I can download the files, but after a while I can not download the files, saying that the file does not exist, only when I consult the database and the table by…
-
-2
votes1
answer41
viewsMultiple instances of Django on one machine
I have a project in Django that works as a web application for use in companies. The company has 4 branches, and we have a server available. The goal is to replicate the 4x project on the same…