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
votes0
answers345
viewsCould not parse the remainder: '[1]' from 'i[1]' in Django
I am trying to make a check to modify the bootstrap component according to the status id, but it returns me this error: Could not parse the remainder: '[1]' from 'i[1]' in Django The code snippet…
-
1
votes1
answer312
viewsTypeerror with calculated field (Django)
Typeerror with calculated field unsupported operand type(s) for *: 'int' and 'NoneType' error in Return line below py.models def get_subtotal(self): return self.price_sale * self.quantity subtotal =…
djangoasked 9 years, 7 months ago Regis Santos 1,574 -
1
votes1
answer3644
views"Noreversematch at/" on Django, when I try to put a link on the button
When I try to put a link on a button appears a page with error of NoReverseMatch at/, I don’t know what else I do, I want to put this link to go to a app registration of users that is called login.…
-
1
votes0
answers63
viewsError loading uwsgi - cannot be Loaded as Python module
I made the settings to work Django with Apache, but always gives the following error: cannot be Loaded as Python module My file: import os import sys…
-
1
votes1
answer539
viewsPage Redirect Error -URL
I’m super beginner with Python and Django and unfortunately I’m suffering a lot with urls. The problem is that "Página não encontrada (404)". Below are excerpts of the code: py. from…
djangoasked 9 years, 8 months ago Sara Fernandes 317 -
1
votes0
answers375
viewsTemplates base.html in Django
good morning!! I’m working with Django Templates. It turns out that I created a base.html template that will fit all the other html forms.I have an index.html that extends this beauty tamplate, but…
-
1
votes1
answer154
viewsError searching in Django
Hello I am creating a project on Jango and performing a search for a Taginfo based on a tag that has foreignkey for Taginfo. I’m getting the following error on line 99 from view. TypeError at…
-
1
votes2
answers295
viewsUnknown command: 'syncdb' Visual Studio 2013
I’m having trouble developing a system in Django. When I try to synchronize the bank this error appears: Python interactive window. Type $help for a list of commands. Executing manage.py syncdb…
-
1
votes1
answer1932
viewsError 502: Bad Gateway - How to resolve
What’s going on Starting yesterday morning, in a certain part of the site, in the user register to be more exact, many times when trying to perform it, Nginx returns the message of 502 - Bad…
-
1
votes2
answers602
viewsGroup by Day in Django
Does anyone there have an example of a "bat-ready" grouping by date? I tried all this here... Subscription.objects.extra(select={'day':…
-
1
votes0
answers739
viewsDjango, change the value of a form field when I select items in another field
I have a form that registers a sale, I select the customer, the employee (seller), and the items (products) sold and I am placing the total value of the sale manually. What I would like is that when…
-
1
votes1
answer1346
viewsDifference between get_context_data and get_queryset and code improvement (Django)
i wanted to know the difference between get_context_data and get_queryset. And I would like to know your opinion about my codes. What’s right and what’s wrong in them?…
-
1
votes1
answer92
viewsChanging the template_name in Templateview (Django)
How do I change template_name in Templateview if user is authenticated? Look what I tried class Home(TemplateView): # template_name = 'index.html' is_auth = False def get(self, request): if not…
-
1
votes1
answer538
viewsDjango Api: How to create a view that reset Password?
I am developing a mobile application using the Ionic framework. There is also a Django API that communicates with a Postgresql database. I have already created an authentication system for the…
djangoasked 8 years, 9 months ago Pedro Tavares 11 -
1
votes2
answers915
viewshow to override save method of models
I am trying to overwrite the save method of models so that when a new book is created it is saved and exported immediately to a file. json, this would be a form of automatic backup, but when…
-
1
votes1
answer284
viewsHow to copy record with Detailview and picking up on pk (Django)
Consider my template: entry_detail.html <form class="navbar-form navbar-right" action="." method="get"> <!-- add --> <!-- <p name="filter_link" class="pull-right"><a…
-
1
votes1
answer2304
viewsHow to access a local server from an Android device
I have a server in Django running on my computer "localhost:8000/posts", and I am creating an Android client to access it. Debugging my application on a real device, I tried to access by my Ipv4…
-
1
votes1
answer155
viewsinstalling Django in a venv
I am trying to install the latest version of Django (1.9.6) in my virtualenv, but when I use the Pip install Django command, within the virtual environment, I get the following return: Requirement…
-
1
votes1
answer116
viewsTreating error in search field with text and integer (Django)
The following code does a value search in the template. But it locates by text, and when I type, for example, 2015 to locate by year, it returns an error because the field must be an integer and not…
-
1
votes1
answer354
viewsAutocomplete with jQuery and Django
Hello, I did a search on the site, but did not find, if anyone knows a link that already deal with this subject, please post. Next, I made an autocomplete in a form of Django with jQuery and…
-
1
votes0
answers34
viewsCreating your own Mixer and Django Provider
I saw that in the mixer there are several providers ready http://fake-factory.readthedocs.org/en/latest/providers.html http://fake-factory.readthedocs.org/en/master/locales/pt_BR.html but there is…
-
1
votes2
answers120
viewsProblem with pk that doesn’t exist yet
I have the following urls: # urls.py url(r'^proposal/(?P<pk>\d+)/$', ProposalDetail.as_view(), name='proposal_detail'), url(r'^contract/(?P<pk>\d+)/$', ContractDetail.as_view(),…
djangoasked 9 years, 3 months ago Regis Santos 1,574 -
1
votes1
answer26
viewserror using Django.setup()
I’m trying to call the job django.setup() in version Django. 1.4, I saw that it was implemented only in 1.7. Is there any function like this that I can update, the solution would only update Django?…
-
1
votes0
answers114
viewsAdd CLASS attribute in Select widget Option Django
I’m wearing a widget=forms.Select() in a forms.Form Django, however, when trying to add a CLASS attribute in Options, which is part of Select, I can’t, only in Select itself, I searched and only…
-
1
votes2
answers110
viewsSend process to server and release user
I’m having a problem in an application that uses 3G and is very slow to keep the user waiting. Does anyone know any library that I can send the information to the server and release the user? The…
-
1
votes1
answer677
viewsHow to receive a PDF file in Django and save to a directory?
I get an html file using type="file". <form action="/docs/enviado/" method="post">{% csrf_token %} <input type="file" accept="pdf" name = "projeto"/><br /><br /> <input…
-
1
votes1
answer179
viewsMany-to-Many: Model and Django Template
I have the following situation: - Budget - Product - Items in the Budget I sought the relationship Many-to-Many in Django (1.10), until then quiet, creates in the Template a Multi-select. But if by…
-
1
votes1
answer80
viewsSpecific url in Django
I’m rewriting a website using Django. This is a blog and I need the urls to be the same as the old site so that the site does not lose ranking in the search engines. What would be the best way to…
-
1
votes2
answers6375
viewspython Manage.py syncdb does not work!
When trying to follow a tutorial I can’t go on because the bank wasn’t set up, you can help me? Error: Unknown command: 'syncdb' Type 'manage.py help' for usage.…
-
1
votes3
answers1776
viewsGet user logged in to Django globally
All my models has relationship with the User, and for default all of mine query_set will be made based on the user logged in to the system. How would you get the user logged in to any area of the…
-
1
votes1
answer3770
viewsDjango, data’d/m/Y format configuration
I am unable to change the Django configuration so that the date format looks like’d/m/Y'. In the form validation, if you enter 22/12/1980, the form is invalid. Informing 12/22/1980 the field date is…
-
1
votes2
answers103
viewsDjango collectstatic does not update modified files on S3
I’m using Django 1.10.6, follow this tutorial to configure media and staticfiles in S3 and when I spin collectstatic, files are not updated.…
-
1
votes1
answer491
viewsHow to add fields dynamically in Django?
I would like to add fields dynamically in Djangoadmin. File models.py: class Book(models.Model): title = models.CharField(max_length=100) def __str__(self): return self.title class…
-
1
votes1
answer104
viewsDjango and Cloudinary error - can’t use the string Pattern on a bytes-like Object
I’m trying to make a simple app: I made the tutorial of Django Girls and now I’m trying to use the same including also an image using the Cloudinary But I’m having the following mistake: Error…
-
1
votes1
answer715
viewsCustom select on DJANGO
model py. class Produto(models.Model): nome=models.CharField('nome', max_length=100) marca=models.CharField('nome', max_length=100) categ=models.ForeignKey(Produto, verbose_name='Produto') class…
-
1
votes0
answers105
viewsBackground execution with Django Python
I have a web system based on Django (Python). In this app I need to show some dynamic values coming from a remote device, in which I need to place some orders every 2 minutes to log the values in…
-
1
votes2
answers526
viewsPython 3.5 + Django + Postgresql on Windows
I am currently starting a web system project using Python 3.5 and the Django 1.9.1 framework, aiming to integrate them with a database Postgresql 9.5, all installed on a Windows 10 x64 OS machine.…
-
1
votes1
answer1016
viewsDjango runserver does not work
The command: python Manage.py runserver 80 Returns the following: (I put screenshot, because the text is defaced here) The localhost address is inaccessible regardless of the port (8080, 8000, 80)…
-
1
votes0
answers249
viewsHow to block user login with certain "status" in Django
I’m using Django 1.11 and class-based views. My user model is customized and in it I have a "status" field where it has "enabled, blocked and disabled". I would like to know how I can allow the…
-
1
votes0
answers98
viewsHow to get nested Rest?
I happen to have the classes Pessoas, Profissoes, ProfissoesPessoa and QualificacoesProfissoesPesssoa In thesis my Models is so below: # -*- coding: utf-8 -*- from django.db import models from…
-
1
votes1
answer160
viewsSettings for Django-allauth
Guys, I’m trying to implement Django-allauth in a personal project however I am not succeeding, in version 0.20.0 it is easy but I wanted to try in the latest one that is the 0.25.2, it does not…
-
1
votes1
answer806
viewsHow to implement "Foreign key" using Micro Services architecture? Django
I’m trying to build a system using micro services architecture, I came across the problem about dependency, in case how to implement chave estrangeira using this architecture? I’m using Django…
-
1
votes2
answers361
viewsHow to differentiate variable (inputs) in the same Django form
good morning! I have the following question: I have a class Person, of which I can have 3 types of person (Victim, Aggressor and Witness) in the same form... as I would set the variables so that…
djangoasked 8 years, 8 months ago Sara Fernandes 317 -
1
votes1
answer34
viewsSet CLASSPATH to be accessible in Apache
How do I for the environment variable CLASSPATH be accessible by apache? I have a Django project that uses the library python-weka-wrapper that bridges the Weka Java implementation. Everything works…
-
1
votes0
answers88
viewsUsing extra field in Annotate Django
I’m trying to add a column called today in a Model with the .extra(), to work on a annotate. I’m not finding it. He’s not finding the field. duration = ExpressionWrapper(F('today') - F('pub_date'),…
-
1
votes0
answers153
viewsPandas Dataframe to_html or iterate over the data in the template?
Actually I wanted to iterate on the data in the template? But how do I play my pivot’s dice in context and treat them in the template? df = pd.DataFrame(data) pv = df.pivot(index='cands',…
-
1
votes2
answers247
viewsPython module usage in Django
I’m starting with Django and Python now and I have a question that may sound silly: I can use python modules and functions - and others installed - usually in a Django application?
-
1
votes0
answers281
views -
1
votes1
answer122
viewsFill matrix with ZERO in null spaces, (python/Django)
The problem is in the parts marked on red, I’m having trouble assigning zeroes to her. According to model: The excerpt of the code I am generating this table: *Obs: The selection of this period may…
-
1
votes0
answers490
viewsHow to create streaming service with python and Django
I have the purpose of creating a video streaming service, the project is in python and Django. How do I make such a service available? Python 2.7 and Django 1.10 usage. I only found old material!…