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
viewsDisplay a boolean field result if it is True
I’m having difficulty here to display the return of a Boolean field in the template. I need to display the field name if it is true in the template. models topo = models.BooleanField() views def…
-
0
votes1
answer29
viewsDisplay fields of a Foreignkey relation in the template
Save Devs... I need a help to display the fields of a table that is Foreignkey relationship in a Template. models class IEIS (models.Model): nome = models.CharField (max_length=25,null=False,…
-
0
votes2
answers45
viewsDjango - No module named 'polls'
Hello, I’m starting to study Django (current version: 3.2.5), and I followed this article in an attempt to configure it (version consulted on 07/29/2021):…
-
0
votes0
answers20
viewsSaves only the first for item in the database
I am using Postman to insert some data(structure below) in the database via POST, but it is only saving the first item of the list, someone can help me, please? Structure of the POST: { "products":…
-
0
votes0
answers17
viewsDjango Manytomany "needs to have a value for field "id" before this Many-to-Many Relationship can be used"
Hello, I’m trying to assign data in a model that contains a Manytomany field... Reading around I understood that first should instantiated the Model creating it and passing the data with exception…
-
0
votes0
answers7
viewsHow to filter a list of objects using another list of objects as reference in Django Rest Framework?
I have a User model, which are the users with access to the system, only that each user has to be registered in a work sector, I would like to filter and send via API the list of sectors that have…
-
0
votes0
answers17
viewsDjango does not display database images after filtering posts
I have a blog in Jango that separates your posts by category and each post has a thumbnail referring to it. On the blog homepage each image is displayed normally, but when changing the page to the…
-
0
votes1
answer16
viewsUse of _set in Django framework
I’m following the framework tutorial but I got lost in the use of the command _set of the shell initialized by python manager.py shell. The sequence of commands is as follows:: from polls.models…
-
-1
votes3
answers716
viewsDjango: How to group records using the YEAR from a Fielddate field?
I’m not able to perform a query that returns only the "YEARS" that have records! Considering also that the field of my model is a Fielddate.
-
-1
votes2
answers160
viewsUnittest Django Views: I can’t log into the system by unittest
I need to give a post in a "request creation" view of mine, but when I try to give the post, I am redirected to my login screen, I am trying to log into the system to then give the post in this…
-
-1
votes1
answer117
viewsExport data to a file . cfg
Could someone give me an example of how to export my models data by pk to a file . cfg? tried to use Mymodel.objects.get(pk=pk) but it didn’t work out so well.
-
-1
votes2
answers236
viewsRelationship with Admin Django
I am a beginner with Python and Django and I am doing a menu Enerico, I would like to know how to list in Django Admin the items related to a menu in Modeladmin Menu class Menu(models.Model): menu =…
-
-1
votes2
answers186
viewsDisplay items from a list in the Django html
My code is this:: {% for item in saldo %} {{item}} {% endfor %} And I would like to present the numbers (in the image), each in each row. Does anyone know how? I tried to do a "for" inside the…
-
-1
votes1
answer186
viewsDjango Filefield Image and Video Restriction
I would like to know how I can limit the file type on FileField django? I know I can add this validation in the Form. I just wish you could send videos and images in this field, nothing else.…
-
-1
votes1
answer213
viewsProblem with CIELO certificate using Django
I am trying to implement a transparent checkout for my online store using CIELO for such. data: Django 1.9.5 Python 2.7.6 Ubuntu 14.04 Nginx uwgsi digital Ocean link api python Cielo:…
-
-1
votes1
answer1754
viewsHow to install pipenv in Ubuntu 16.04 for python3
I tried to install using apt-get install pipenv, apt install pipenv but I was unsuccessful.
-
-1
votes2
answers249
viewsDashboards of users logged in using Django admin user
Good Morning I am using Django’s standard user model, and I would like to have a Dashboard of logged in users, to check who is using the system, know me inform if Django has this information? I…
-
-1
votes1
answer121
viewsOnline software hosting using python and Django
I am developing a small ERP management software in Python and using the Django framework, so I had to install some requirements. How do I host this system? Is it like a website? What are the…
-
-1
votes1
answer58
viewsif and Is between loan
Thus, I created a user table and a business, both inherit from the Django user table. Perfect, both your users and tables. But I have a menu and a profile page.html and wanted that in this menu…
-
-1
votes1
answer340
viewsHow to publish a python application
Good afternoon: I am wanting to develop an application with python (Django) my concern is how I will publish my application (will be web), why python is interpreted, but I can’t send my fonts to…
-
-1
votes1
answer65
viewsUrl checks - Django
When learning to develop applications using Django it is common to get the following URL: locahost:8000/minhaentidade/deletar/id However, a malicious user may change this id and end up deleting…
-
-1
votes1
answer32
viewsSelect random mysql with Django
I have this code that selects randomly, users on my DB: def select_random(request): try: last = User.objects.count() - 1 index_one = random.randint(0, last) index_two = random.randint(0, last - 1)…
-
-1
votes1
answer303
viewsProblem when migrating with Python and Django: no such column: forum_thread.Slug
I have this problem in my code: OperationalError at /admin/forum/thread/ no such column: forum_thread.slug I’ve tried to make a million changes and I couldn’t. When I turn the command python…
-
-1
votes1
answer26
viewsDjango Form - Status
I am working on a library administration system and at this moment I am creating the logical part to realize a loan. Here is my great doubt; How to set a state for available or unavailable book…
-
-1
votes1
answer99
viewsSetar tab bootstrap when clicking the link (Django)
Good afternoon! I need help with bootstrap Nav tab. I have three tabs (pending; tempo; finalizado), where each of them has a grid with a button that opens a form on the same page using the same…
-
-1
votes1
answer25
viewsError in the user’s Manytomanyfield link
I’ve created a routine where you register a cost center. This cost center is linked through a Manytomanyfield when I register the User. Below the models.py of these registration: user models: class…
-
-1
votes1
answer155
viewsHow to upload css file to Django?
I started studying Django and I have a problem, Django can not load CSS (NOTE: It was already CTRL+F5 and still does not load CSS) Information that may be useful: STATIC_URL = '/Static/' folder…
-
-1
votes1
answer32
viewsI specify the icon I want to apply on my button with bootstrap, but it only appears empty on the page... What’s going on?
<div> <span>TROCO</span> <button type="button" class="btn btn-outline-dark" data-toggle="collapse" data-target="#collapse" aria-expanded="true"…
-
-1
votes2
answers33
viewsProblems making the POST in Django
I am in a part of the project, which is the page of records I created the View method but it’s not rolling yet From what I looked the button is ok. The last image is from my admin, where the new…
-
-1
votes1
answer21
viewsHow to pass "invisible" variables from one page to another using a link in Django?
Suppose I have the following code in the.py urls; url(r'^relatorio', views.relatorioView, name='relatorio'), url(r'^relatorio/grafico', views.graph, name='grafico'), On the report page I have a…
-
-1
votes1
answer39
viewsError with Django-blog-Zinnia users model
I created a project from scratch with the cookiecutter-Django, using version 1.9.9, since in documentation of the Django-blog-Zinnia package it is recommended to use Django < 2.0. To use version…
-
-1
votes1
answer43
viewsarticles_article.author_id Error
I’ve been following the blog creation tutorial using the previous version of Django 2.0 (this one here: https://youtu.be/zJWhizYFKP0), however I use version 2.0, in the process I have been making…
-
-1
votes1
answer84
viewsFormulário Django
Good morning Guys, I’m doing a Jango project and I already have a template that I worked on, I want to use the forms of this template to make your operations with Django. What I’ve been able to do…
djangoasked 5 years, 2 months ago Jhonata Rocha 1 -
-1
votes1
answer81
viewsSystem in Django for student attendance
I’m trying to learn Django, but I stopped to copy data from the student table to a table that records whether he checked in or checked out at school. Students will wear a badge with CPF in Barcode,…
djangoasked 5 years, 2 months ago Diogo Igarassu 1 -
-1
votes1
answer157
viewsDjango: "Import: cannot import name on_commit"
I’m trying to run an application in Django, however, when using the command python2 manage.py runserver I have the following return: Traceback (most recent call last): File "manage.py", line 10, in…
-
-1
votes1
answer136
viewsWhen running two Django projects at the same time, one of the two users is dropped
I am working on two projects that share the same database, and so the same users, but they are two different projects on different servers. The point is that when accessing both at the same time…
-
-1
votes1
answer94
viewsDjango authentication
good afternoon! I’m starting in WEB programming and I ended up bumping into a problem with Django in the authentication issue. I’ve read all the documentation that talks about Django’s Custom Auth…
-
-1
votes1
answer44
viewsTypeerror at /export_to_xls/ unorderable types: str() < int()
views def export_to_xls(request): obitos = Obito.objects.all() response = HttpResponse(content_type='application/vnd.openxmlformats- officedocument.spreadsheetml.sheet',)…
-
-1
votes1
answer326
viewsDjango: Show report earnings and expenses of a Django management system
I have a management system in Jango and would like to save in one place the report of all winnings (Paid=True), defaults (Paid=False) and expenses of the month or period in Jango admin itself, in a…
-
-1
votes1
answer322
viewsDjango: Form not saved in Django database
When I click to register the page simply refreshes and nothing is saved in the database. In the Django console I get the message: "GET /people/ HTTP/1.1" 200 898 "POST /person-add/ HTTP/1.1" 200 898…
-
-1
votes2
answers47
viewshow to save user’s choice in a Nav-tab modal
I have a modal with some tabs referring to account closure, I need to save the user’s choices, I load types of payments, type of flags etc, each button can have an id, that id I want to save, I just…
-
-1
votes1
answer67
viewsDifference between saving the form directly and creating model instance
I have been having some problems when I will insert or modify some value that was not passed to the user in the form and then save it. For example I have a Local model : models.py class…
-
-1
votes1
answer111
viewsDoubt About the logged in user
I’ve been put on hold for lack of work opportunity in my region. Now I’ve been invited to participate in a project and I’ve come across a problem that for me is complicated. I need to start a field…
-
-1
votes1
answer458
viewsHow to send an array with ngmodel
I am redoing a project now in angular, and to get an array of the form I used getlist and Prod[] and Qtd[] inside the tag form, now in angular use ngmodel and not the form itself, how can I take…
-
-1
votes1
answer231
viewsGunicorn is not working as it is giving the following error gunicorn.service: Failed with result 'Exit-code'. error
Good night, I made an attempt to deploy my site in Django language, but without success. The errors that came to me after are presented below. I appreciate all the help, because I’ve done a lot of…
-
-1
votes1
answer52
viewsMultiple models - three apps
Good evening dear... my TCC project, has three apps: classrooms, classrooms and allocate. I need to make class allocations in the rooms, after allocated I need to schedule a class boleano as…
-
-1
votes1
answer111
viewsSave report to Django Excel with filter
Good afternoon...I made a function to export report in excel that worked, however comes everything that is in the database, I wanted it to be filtered...kindly someone could help me.... function…
-
-1
votes1
answer35
viewsDjango query with dynamic timedelta
Hello, I am facing an unexpected difficulty to resolve this query. I appreciate your help. I have two models: class Rating(models.Model): revision_period = models.PositiveSmallIntegerField(…
-
-1
votes1
answer179
viewsConfirmation Modal with Django
I’m on my first project in Django and I’m having a hard time making a confirmed modal before deleting the record. When I press the YES button it does not direct to my URL {% url 'apiDelete' api.id…
-
-1
votes1
answer603
viewsNameerror: name X' is not defined - Django Rest framework
Following the tutorial for creating API with DRF, I encountered difficulties while mapping the urls. By running 'python manage.py runserver', I get the following error path('', include(loja.urls)),…