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
-
0
votes1
answer36
viewsWildkey is not displaying correctly on the screen, even with the __ str __ DJANGO 3.2 method
Even with the method placed in the POSITION class, isn’t it appearing as it should when it shows in the employees identity, how to solve this problem? obg…
-
0
votes2
answers54
viewsDjango: Optimize Database Searches
I am doubtful in the following exercise: The route /Albums/ is returning a listing of the albums with the artists of the album, but in some of our clients that use databases stored on own servers it…
-
0
votes1
answer74
viewsProblem with Django Cache Page/URL
I found a problem using the @cache_page(60 * 15) Django in my case. The first user to give the first F5, the page will be locked with the DELE user logged in. So even if I sign in with another user,…
djangoasked 7 years, 2 months ago Guilherme IA 1,414 -
0
votes0
answers28
viewspython3.9 + matplotlib Does not call import in . py
So ... python version 3.9.1 did a Pip install matplotlib and ran smoothly, despite questions with previous installation errors. It turns out that : import numpy as np import math import matplotlib…
-
0
votes1
answer34
viewsHow to get a full URL using Django?
Is there a Django function that concatenates a specific path with the base URL and returns a full URL? Example: url_completa = criar_url_completa("/meu_app/minha_view") print(url_completa) #…
-
0
votes0
answers26
viewsI’m studying about python /Jango and I came across a from and an import called "Rating" could someone explain to me what it’s for?
def show_scoring_average(self): from .Rating import Rating # Gostaria de entender esta linha try: ratings = Rating.objects.filter(user_rated = self.user).aggregate(Sum('value'), Count('user')) if…
-
0
votes1
answer20
viewsMigrations from my Django app are not applied
I created the models.py file in my app, created all the models, added appConfig to INSTALLED_APPS but when I use the manage.py migrate myapp it does not make any changes to the mysql database: Can…
-
0
votes0
answers10
viewsDjango with bootstrap
bootstrap does not load on Jango via Cdn
-
0
votes0
answers9
views{{user}} shows Anonymoususer even with the user logged in djangocms
I have a plugin that shows some information, among it the logged in user. But every time I try to show {{request.user}} or {{user}} Emplete always rederizes as Anonymoususer. I thank you from the…
-
0
votes2
answers1353
viewsNo module named 'urls' in Django
I’m studying about URL division in Django and I can’t direct my main url file to high school. Tracking: Traceback (most recent call last): File…
-
0
votes1
answer100
viewsDjango - Problems saving objects with UUID type ID in admin
Work on a project in Python with Framework Django and recently we decided to change the generation of Ids integer to UUID on grounds of merge data before synchronization (we have data that comes…
-
0
votes1
answer196
viewsProblem with Celery and Django/Python
I am trying to implement a tasks system with Celery in Django, but it is giving error and I do not know how to solve... Error that appears on console: tasks py. from __future__ import…
-
0
votes1
answer132
viewsHow to put html links/tags in models.Textfield
Everybody, all with you? I have a Description field and it is a Textfield, how do I format a link in it ? (make it cute) I tried to put html tags but it n accepts. py.models: description =…
-
0
votes1
answer1055
viewsRead XML via Python
I need to take data in an XML file from another domain, initially I did a js, I had to abort. I thought of reading the files through . py within my Django project I tried something a little less…
-
0
votes1
answer457
viewstake the logged-in user and save the id using inline formset
Hello I’m having a problem to get the logged in user id simplifying, I have a form where the user will enter the information and when he gives the Ubmit the user will also be saved together, because…
djangoasked 6 years, 12 months ago Gustavo Cruz 17 -
0
votes2
answers323
viewsproblem with uppercase in Django
I have an uppercase problem in Jango, in the following code, it works in the first form (name) and in the last form (organ), but in the intermediary forms it does not turn the letters sent in the…
-
0
votes0
answers93
viewsAttributeerror: 'Asgirequest' Object has no attribute 'user_agent'
Replaces my WSGI for ASGI to rotate the Django Channels, as is said in documentation of them. The problem is that the user_agent, where I detect whether it’s mobile or not. I had created a function…
-
0
votes1
answer320
viewsTotal values in Django template
I’m developing a forum that on the index page I need to show the subject, how many topics has this subject and how many posts, I can even get back number of topics, but only shows the topic with the…
-
0
votes1
answer752
viewsHow to use model variables in a view in Django
I need to calculate the average of a school report where the data are filled in in Django Admin, I would like to take each value make the media and play on a table in View. Code: MODEL class…
-
0
votes1
answer60
viewsSave data to a polygonfield
good night, I am implementing a project using Django and have the following model: class ModelExample(models.Model): city = models.CharField("Cidade", max_length=100, blank=True) state =…
-
0
votes0
answers164
viewsView csv file data in view
I want to display data from a file in the Django template. I don’t know how. Whether in the model or in the view. Application ucsal. Model: from django.db import models import pandas as pd class…
djangoasked 6 years, 11 months ago André Nascimento 1,258 -
0
votes1
answer1187
viewsProblems loading Static files to Django in deploy on Heroku
I’m trying to deploy an app I started in Jango on Heroku, but I’m having trouble loading the css/js/imgs files, follow below as my folders and settings related to it! py Settings. BASE_DIR =…
-
0
votes1
answer3010
viewsDjango error Art matching query does not exist.
Good evening, guys. This is my first post on the forum and I’m also a little layman on Jango. I’m developing a project that involves a model called Art and in one of the views I need to update data.…
djangoasked 6 years, 11 months ago Cleverton Bezerra 1 -
0
votes0
answers41
viewsQuestions about Django MTV
I’m having a hard time understanding the concept of Django. Please check that my conception is correct: MTV refers to Model Template View. Model would be my database. Template would be the interface…
-
0
votes1
answer94
viewsHow do I register several records
I want to do multiple contact records, I wanted it to be more dynamic, for example, the person has a number of phones or cell phones or emails and while on the site, she can click on a summation…
-
0
votes1
answer247
viewsCreate date condition in UNIX format Timestamp - Django
I have a table in the database that the date fields are of type Biginteger, in which receives a date in Timestamp format. How do I make one SELECT in the table with the following conditions: SELECT…
-
0
votes1
answer507
viewsDjango + AJAX - POST 404 (Not Found)
I am trying to implement a Likes system in a Django + AJAX application but when trying to do the operation in question I am getting the following error in the browser console: POST…
-
0
votes0
answers436
viewsConvert HTML to PDF and insert Image with Django
The image does not appear in PDF, I use xhtml2pdf. reports/sol_access.html <img src="{% static 'img/small_logo.png' %}" alt="Blue Tech" style="max-width:200px; margin-top:10px"> view py. ` def…
-
0
votes1
answer143
viewsAdd footer with xhtml2pdf on specific pages with Django
I have a standard footer that is displayed on some pages when generating the PDF with the xhtml2pdf using Django which should be positioned at the bottom of the page. But in some I don’t want to…
-
0
votes2
answers997
viewsfilter list in Django admin Foreign key field
I have two questions, both related to the form generated automatically by the Django admin. If I create an administrative screen I know how to solve these problems, but working directly with the…
-
0
votes1
answer793
viewsNoreversematch error in Django
Hello! Studying on Django and developing in this framework, I came across the following error: Noreversematch at / Reverse for 'displayURL' with Arguments '('',)' not found. 1 Pattern(s) tried:…
python python-3.x web-application django django-templatesasked 6 years, 9 months ago Thiago Benine 95 -
0
votes1
answer196
viewsHow to filter an Apiview to show messages related to a user?
I want to create a view using Apiview, which shows all messages sent by a user specified in the url. py.models: class Message(models.Model): body = models.CharField(max_length=500) normaluser =…
-
0
votes2
answers1943
viewsHow to link to download html file?
I’m using the tag: <a href:"{{ arquivo.caminho }}" download>link</a> with the download attribute to download a link of files from my local network (tiff images), however, the downloaded…
-
0
votes1
answer131
viewsHow to create tuple with key receiving value?
I would like to create a method that returns the Django ORM FILTER parameters. I will have to use these filters at various times, I would like to create this generic method. Follow the example: def…
-
0
votes1
answer635
viewsDjango 2.0 - Amigavel Urls
I’m studying Django 2.0.2, and I’m having difficulties in URL friendly together with Slugfield in the models.py class, but I don’t know how to define def get_absolute_url(self): correctly. I can…
-
0
votes1
answer178
viewsHow to ignore Django.contrib.auth Migrations?
I have a Django application where I intend to customise the authentication part. I’ve already made my own Backend of authentication, as well as configuring my own Model that will be used in…
-
0
votes2
answers206
viewsImage displayed on one machine, and another not on Django
I have an app in Django that runs in two places, one at work, which is where there is effective production, and in my house, which is where I make the adjustments because here I have time. The…
-
0
votes2
answers2615
viewsPassword Validation with Python
I have the following requirement to validate a password in the register: Size: 10 characters Capital letters: 2 Lower case: 2 Number: 1 Symbol: 2 How do I check with python? So far I’ve only been…
-
0
votes1
answer327
viewsDisplay manytomany on list_display on Django
I am trying to display some items in manytomany in the list display on Jango, but it is returning an error, follow the codes: Models py. class Apenso(models.Model): usuario = models.ForeignKey(User,…
-
0
votes1
answer153
viewsRedirect Http to Https - Nginx with Let’s Encrypt
At the moment, the domino https://meudominio.com is working, but I can’t redirect http for https using the Let’s Encrypt. I’m following this tutorial: Link Below is my configuration: server { listen…
-
0
votes0
answers59
viewsForms in Django, help?
Is there any way to work with Forms in a practical way in Django? The point is that I am creating a site on my own and as I already knew Python, so I decided to use Django. "Everything" was fine,…
-
0
votes1
answer81
viewsHow to edit something saved in the Python database
I need to search a student by name or Cpf that is saved in the database and recover this same student in a form to be able to edit it and later be saving again. I am using Django as a framework. I…
-
0
votes1
answer86
viewsStoring past data - Django
My question is the following, in my application I have a profile template that has the following fields: Models py.: class Perfil(models.Model): nome = models.CharField(max_length=255, null=False)…
-
0
votes0
answers175
viewshelp with listview Django
I need help picking up the values of an object in a list view class Compraslist(LoginRequiredMixin, ListView): model = Solicitacao template_name = 'compraslist.html' def get_context_data(self,…
-
0
votes0
answers287
viewsShow graph sum of objects - Django/Python/Sqlite
How to show a graph with the sum of objects with Django/Python/Sqlite? In this case we have 'internal boxes' (y-axis) for 'teams' (x-axis) that are rendering'internal boxes' values for each 'team'…
-
0
votes1
answer174
viewsChanging how Forms.Validationerror is displayed in Django
It is possible to change the way the ValidationError is displayed? I noticed that the Django creates a tag <ul> and within it a tag <li> error. Can I change the way this is done? And if…
-
0
votes1
answer64
viewsIs it possible to migrate a web2py system to Django by maintaining the same database?
It is possible to migrate a web system in production made in web2py to a redone in Django, maintaining the same database? I have a system made in web2py (in production) and need to redo it in…
-
0
votes2
answers997
viewsHow to open a screen with a pre-filled HTML form?
I would like to know, how to open a form whose fields are already pre-filled with the user’s data (resulting from a search in the database), being in charge of it only edit the information. I’m…
-
0
votes1
answer247
viewsFilter Models in the Django view
Fala Galera I have the following app running on Django 1.6. when clicking on dog or cat the idea would be to present a page performing object filtering The animal is shaped like this to filter:…
-
0
votes1
answer53
viewsPass several attributes on Django
My question is as follows. I am starting my studies in Jango and find a problem. I have a function in my view with the following excerpt def saldo_total(request): receitas =…