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
votes0
answers92
viewsCreating a Quiz in Django and Javascript
I’m doing a quiz in Django and using Javascript as well. However, I want each question to create a dictionary containing the question, options and the correct option. I was doing it that way: const…
-
0
votes1
answer194
viewsDjango returning wrong time in the template, why?
I saved in my bank a date, in a field of the kind datetime(6), the date saved in the database is: 2020-05-13 14:13:50.000000, however, when I try to print this date in the template using {{…
-
0
votes1
answer97
viewsDjango Class-Based Views - Noreversematch Error
I’m developing a CRUD system with class-based views. I have an app that List, Create and Delete views are working perfectly, but Update is having a problem. From Listview, I try to Updateview one of…
-
0
votes2
answers914
viewsServer Error (500) on Heroku using Django
When I try to access my website hosted on Heroku, it returns the message: "Server Error (500)". Heroku[router]: at=info method=GET path="/favicon.ico" host=quiz-py.herokuapp.com…
-
0
votes1
answer207
viewsNoreversematch at /view_clients/
I want to print out a simple customer sheet inside a list of customers I’ve registered in the app. When I click on the link to generate me returns this error: Noreversematch at /view_clients/…
-
0
votes0
answers122
viewsHow to sum up a field of different classes and different apps?
Hello, I have a class in a Django app called product: class produto(models.Model): descricao = models.CharField(max_length=150) quantidade = models.PositiveIntegerField() valor =…
-
0
votes1
answer162
viewsNoreversematch at /
I’m taking some Python lessons with Django and is making this mistake: py. from django.urls import path from . import views app_name = 'courses' urlpatterns = [ path('', views.index, name='index'),…
-
0
votes1
answer110
viewsForm label is not shown on the #Django page
I created a customer registration form and in the meta class I declared the Fields and their respective Abels. However the label 'CPF' referring to the field 'n_cpf' does not show on the page, only…
-
0
votes1
answer446
viewsImages disappear in Heroku after a while
I made a website for a newspaper in Django. I have deployed to Heroku and there I have a news register, where I have the title, summary, content and date fields. According to the model: class…
python django web-application heroku django-templatesasked 4 years, 5 months ago Gustavo Augusto Pires 13 -
0
votes0
answers144
viewsSet time limit for the download response of request.get() [Django and Python]
I am having problems with the server data return time when I make a get request. The server starts the data transmission, but sometimes it takes too long to complete the upload (more than 30…
-
0
votes2
answers112
viewsRest framework Django
Good evening, I was studying a bit of Rest framework on Jango and I developed a simple Api to consume with Angular went all right however my api I did is limited to { [ { "id":1, "name":"lima",…
-
0
votes1
answer203
viewsError - "Required field" in image upload using Django
Guys, I’m developing an application with Django and after organizing the form I went to test the registration and the image upload field always has the same message: "Required field" no matter what…
-
0
votes1
answer66
views(Django) Send form to another table
I’m a beginner in Django and I’m picking up a lot on one thing. I want to submit a form that has already been filled out for another table. I need somehow to select which table the form will be…
djangoasked 4 years, 5 months ago Igor Araujo Cruz 11 -
0
votes1
answer120
viewsDjango associative table query
Well... I’m trying to do an application on Django for residential energy consumption... I have three tables: Environment, Device and an associative, Appareil_environment where I have foreign keys to…
-
0
votes1
answer26
viewsPrevent change of subject matter in the relationship
Good afternoon, I’m trying to avoid altering an object when be part of a relationship, in my custom view.py worked out, but in the admin.py file an error occurs.. ha how to help me? view.py def…
-
0
votes2
answers564
viewsShow login error messages in Python with Django
I’m building a Python login page with Django, Javascript and HTML. What I’m not knowing how to do is show, on the login screen an Alert with the messages "Unauthorized user" and "Incorrect user or…
-
0
votes1
answer207
viewsHow to use the Django admin template non my form
I’m learning about Django’s admin site and my question is: I have a modelForm and one of the fields is a foreignKey and would like the change, Edit and delete options as in the Django template (that…
-
0
votes0
answers297
viewsHow to create a popup view in Django/Python
Hello, I would like to create a popup to see the detailed information when I click on a link, these data should come from a view and recover data from some attributes of my models.py…
-
0
votes1
answer38
viewsSelectively filling an HTML select from a parameter
I have a Django view that queries the database and returns the result to a "query courses.html" file where a select is populated. view py. def consulta_cursos(request): if campus_id == '605': with…
-
0
votes1
answer31
viewsHow to show the path of Filefields linked to a specific object in the template?
Good afternoon! I have a web application being made in Django, and I don’t know how to show in the template the path of all Filefields that are linked to an object. I own two models. One for a…
-
0
votes1
answer172
viewsHow to use os.system with Python and Django
I’m a beginner in Django and I got caught up in the following problem: I’d like to execute the command: os.system("blastp -query " + proteina.name + " -subject " + multi_fasta.name + " -outfmt=6…
-
0
votes1
answer72
viewsChange boolean Django
would like to do an update field that changes the boolean value to true or false inside a modal so you don’t have to create a page just to edit boolean. I have the following code: in the model class…
-
0
votes1
answer64
viewsDjango, add data from a form
I am wanting to insert data into the database from a form, this form is working, but it contains many fields of type foreing key, so if I do not add the data previously they do not appear as an…
-
0
votes1
answer72
viewsDjango HTML does not update in browser
I believe that the structure of my project is somewhat complex. As it is a framework, I did not start it from scratch. My problem occurs when I try to make changes to the text content of HTML files…
-
0
votes2
answers62
viewsHow to generate auto increment field, in Django models, that is not PK, and that depends on information from another field that is FK?
I’m developing an application in Django that has two models, Modality and Bidding. The Bidding has a FK field (models.Foreingkey), which pulls the Modality. I would like this field to generate an…
-
0
votes1
answer23
viewsDjango: imported class is not being called
Hey, guys, I created a view to return a HttpResponse simple importing a class from the models folder as follows: from .models import Album and then creating the view function: def index(request):…
-
0
votes2
answers280
viewsReplace use of dataframe with pandas . apply
I have a function that iterates a spreadsheet, which makes some controls. I looked over and saw about . apply, but I couldn’t implode. I would like to know if you could in that case, replace the use…
-
0
votes0
answers12
viewsHow to deploy code that uses Dryscrape in Heroku? (No such file or directory: 'src/webkit_server')
I’m not being able to push my app on Heroku. My application uses the library Dryscrape, and when I deploy to the Heroku app I get the following error: sh: 1: qmake: not found error: [Errno 2] No…
-
0
votes1
answer228
viewsPage not found(404) - polls views Django tutorial
I’m doing the Django documentation tutorial in part 3 (https://docs.djangoproject.com/en/3.1/intro/tutorial03/) where it is said after adding some codes the following: "Take a look in your browser,…
-
0
votes1
answer249
viewsDjango - Filter queryset into a form using a value present in the view
I am creating this site where the first step of the user is to create the company he works for: ''''models.py''' class Empresa(models.Model): cnpj = models.CharField(unique=True, max_length=20,…
-
0
votes1
answer97
viewsHow to resolve error in URL configuration in Django?
I’m starting to learn Jango(or trying) but I can’t solve the following problem: "Using the Urlconf defined in Sitejg.urls, Django tried These URL Patterns, in this order: Templates/main.html The…
-
0
votes0
answers61
viewsDjango and fullcalendar: the last day of the period is not marked on the calendar
Good afternoon, I’m working on a project to book rooms using Django and fullcalendar. It turns out that the end date of the selected period is not recorded in the calendar. The record stops the day…
-
0
votes1
answer280
viewsOverride Viewset POST action to save and update data in Django Rest Framework
I am creating an application for stock control and am having the following difficulty. When I enter a [product input] the input quantity must be added to the stock quantity of [product]. There is…
-
0
votes0
answers74
viewsFilter combobox according to the list of projects created by each user logged in to Django
I’m new to Jango and I have a lot to learn. I’m developing a system in which the logged-in user registers their requirement, but each requirement is tied to a project that the same user created. As…
-
0
votes0
answers25
viewsQueryset to select maximum values per group - using mysql
I am trying to select the highest values per group and I would like to receive all attributes from my table, tried this solution: dropWorst1 =…
-
0
votes0
answers59
viewsHow to make a unit test using Flask and Django
I’m new to python testing using Django and flask. Using the pytest library, how would test implementation of the following methods and what could be tested? If someone could give me a light it would…
-
0
votes1
answer200
viewsDjango Error 3.1.3 Reverse for 'post_detail' not found. 'post_detail' is not a Valid view Function or Pattern name
Python 3.8.3 Django 3.1.3 I don’t understand why this mistake is happening. Reverse for 'post_detail' not found. 'post_detail' is not a Valid view Function or Pattern name. The line the error…
-
0
votes1
answer179
viewsCreate spreadsheets with Django
Hello, I am implementing a button to turn a Query into a spreadsheet and make this download available. For this I created a View to generate Excel, follows: def export_view_csv(request): if request…
-
0
votes1
answer51
viewsDjango. I can’t pass the model I’d like through classes
I’m having a problem creating a page to create new products and know I’m having some problem with Oop for lack of experience. I would like to pass the value of self in this case being self==Product,…
-
0
votes0
answers18
viewsDjango page with Class Based Views
Hello, I have a problem with paging in Django, using Class Based View. Below are the code snippets: py views. class ExtratoListView(LoginRequiredMixin, SingleTableMixin, FilterView): model = Extrato…
-
0
votes0
answers25
viewsFind the chosen option in HTML with Django form
Hello, I created a form with some options to be chosen, follows Forms.py file class BuscaForm(forms.Form): FIELDCHOICE = [ ('1', 'CNPJ'), ('2', 'Razão Social'), ('3', 'Nome Fantasia'), ('4',…
-
0
votes1
answer54
viewsDjango - How to present last value registered in the database in a registration screen
I’m young, and I’m still facing difficulties that might seem pretty simple to you. I decided for personal reasons to make an application in Django. It is a simple registration of people in a Mysql…
-
0
votes2
answers157
viewsDjango: Css not imported
I am developing my first site with Django and I came across a problem: While running the browser application, as changes contained in the css file do not apply to the website when I try to import…
-
0
votes0
answers30
viewsDjango - Choice Field None:
I’m having trouble making one Choice Yeah, when he goes by form, the field returns only "" or None. Already if I put widget=RadioSelect, it returns the correct numbering. Model: ORDER_CHOICES = (…
-
0
votes1
answer43
viewsHow to call a function by loading a string in Django?
I’m new to Django and I’m testing, In case I have my.html posts and wanted to load all posts summarized on the page, but one side would load the posts with id pair and the other side with id odd. I…
-
0
votes0
answers21
viewsNoreversematch at /blog/ | in a Django app
good afternoon. First of all, this is my first question on stack overflow. So I apologize if it’s too vague. I started to study djnago in the last days and I came across the following mistake:…
-
0
votes0
answers22
viewsHow do I know in Django’s html if the view is filled with instance?
I am starting my studies in Django, in a CRUD, I created a single form that I would like to use for both creation and change. I would like to change the text of the button depending on the function…
-
0
votes1
answer61
viewsHow to pass parameters to a Makefile
I’m developing a Django app on Docker and not have to keep typing docker-compose exec djangoapp python manage.py <alguma coisa> i wrote a Makefile to run the commands I most use. I just don’t…
-
0
votes0
answers37
viewsI cannot see the database data in the Django-Rest-framework api
I’m trying to set up a chess board with Django Rest Framework, so I want only the positions to be loaded, but I always get returned only "None". This is because the last database records are…
-
0
votes0
answers59
viewsPagseguro - Problem when consulting Brand
Hello, I am trying to use the transparent checkout of pagseguro. I have already integrated the session generation, but when consulting the flag of the card, the function success is never called,…