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
answer697
viewsDjango Legacy Database Authentication
I am developing a project with a legacy database (Firebird), and I was able to configure Settings.py and it is working with the database. When creating a login using Forms, I am not able to create…
-
0
votes2
answers119
viewsAttribute name referring to secondary key in a model in Django
I have a problem with an imported database for Django 1.6.5. In this database the columns follow the pattern: id_city, name, id_state and etc. However, Django did not handle it well leaving the…
-
0
votes3
answers430
viewsProblem when importing model
Hello, I’m not getting the import of this model have the model: class Contrato(models.Model): within models.py and inside my serializers.py need to do import from models import Contrato nor from…
-
0
votes1
answer229
viewsuwsgi configuration for high traffic
I have a Django application and I’m having trouble configuring my server for high traffic. It’s very slow with few accesses. see my setup: [uwsgi] chdir =…
-
0
votes1
answer82
viewsResults in iframe
I want to show the results of the variable "date in an iframe called "final.html". when I execute the code in iframe enters an error loop. there’s the code I developed py views. def…
-
0
votes2
answers1357
views(Django) How to implement a button in the template that triggers any method?
My question is about implementing buttons in any template. I want to click this button and do the same thing, such as display a message on the screen. How can I do that? Here is an image of my…
-
0
votes1
answer51
viewsHow to improve Testcase speed in Django?
I’m running a test on Django with only two querys and the timer is taking 1 min and 10 seconds to complete the test. Is there any settings you can adjust to speed up the tests? I’m currently using…
-
0
votes1
answer108
viewsUsing python and Django, querys problem
I’m using Python with the Django framework. This method must return a resulting query, to send e-mail to the corresponding emails from the database. However, the method works for some cases and for…
-
0
votes1
answer77
viewsPerformance in Queryset CBV
# models.py class Book(TimeStampedModel): name = models.CharField(_('nome'), max_length=50) authors = models.ManyToManyField('Author', verbose_name='autores') price =…
-
0
votes1
answer514
viewsHow to work with Updateview and Forms in the template
I’m trying to render a client’s data in the template, but I’d like to do it without using it {{ form.as_p }} or {{ form.as_table }} I would like to know if you have any way of using the id of the…
-
0
votes1
answer210
viewsSearch with OR in Django
Hello I’m developing my 1° application in Django and I’m having difficulty with more complex research in DB. Here is my MODEL: class Tag(models.Model): objects = GChartsManager() idtag =…
-
0
votes1
answer713
viewsCustom Admin Django
I’m trying to change the login screen to a new custom screen, but it’s not working. https://github.com/rg3915/custom-admin I set up the Settings: 'DIRS': [os.path.join(BASE_DIR, 'templates_admin')],…
-
0
votes1
answer709
viewsDjango-admin.py execution error on Django 1.9
I am trying to learn Jango and would like to understand this notification I get every time I run the Django-admin command! Note that only Django core Commands are Listed as Settings are not properly…
-
0
votes0
answers256
viewsError migrate : Typeerror: Required argument 'year' (pos 1) not found
I’m having trouble executing python manage.py migrate, until I create the tables more at the end returns me the following error : Typeerror: Required argument 'year' (pos 1) not found someone could…
-
0
votes0
answers100
viewsGchart with Django
Hi I am developing a Django application that creates graphics. And I have implemented a line chart using Gcharts insert link description here but it only has one line, and in the example I’ve seen…
-
0
votes0
answers51
viewsError server 500 Reverse openshif with Django
I deployed an application in openshift and basically the same is a crud, what happens, whenever I try to register a new client the server returns me "server error 500", does anyone know tell me why…
-
0
votes1
answer168
viewsReturning get_FIELD_display from a dictionary-transformed list (Django)
I wanted to turn the following list into a dictionary: lists py. status_list = ( ('c', 'cancelado'), ('elab', 'em elaboração'), ('p', 'pendente'), ('co', 'concluido'), ('a', 'aprovado') ) So I did…
-
0
votes1
answer149
viewsRest API Django does not work
I have a problem in Python/Django. The tables school and school_application_info are related. However, there is no record of any school_id in school_application_info. So I added null=True,…
-
0
votes1
answer165
viewsSort Datetimefield by date only
I wanted to order DateTimeField by date only, ignoring the time. Because in my ordination I need to Person.objects.order_by('-date_joined', 'full_name') But sorting by name has no effect because the…
-
0
votes1
answer63
viewsHow to remove elements placed by Django (1.7.5) in the template
Well I’m creating my project template in Django 1.7.5 (I have reasons to use this version and I can’t change it ) but Jango insists on putting these balls, and how it was generated by Jango I don’t…
-
0
votes2
answers442
viewsHow to go to a Django url regardless of the path we are on?
I created a menu in a base file that is visible regardless of the page we are, <p> Tela de perfil <a href="perfil/">Perfil</a></p> The problem is that when we are on the same…
-
0
votes2
answers1451
viewsHow to show Radio Button type fields in the form using Django?
I created a file called const.py (where I have the options of Choices that I will call in the models) as follows:: const. FORENSIC_TRAFFIC_LIGHTING = ( (u'1', u'Boa'), (u'2', u'Ruim'), (u'3',…
-
0
votes1
answer816
viewsSecurity Authentication Token Django Rest Framework
Good guys I’m using DRF(I’m novice rs), to mount a small API. The problem comes in authentication... thinking about expanding my API to use in a mobile app in the future, I’ve been wanting to use…
-
0
votes1
answer155
viewsHow to extract data from a Django Queryset
I have a table with some information, the employee’s name, Pis, date and time, the time field records the time of registration on the time clock, these records are all in the same column, for…
-
0
votes1
answer2713
viewsUnicode-Objects must be encoded before hashing
The error points to that line of code: salt=hashlib.sha1(str(random.random())).hexdigest()[:5] It used to work normally, but after I passed to Django 1.10.3 and python 3.5 points out this error…
djangoasked 7 years, 11 months ago user53006 -
0
votes1
answer56
viewsError "Can not update Identity column 'order'"
Due to an old need of a project, the developer of the time created a field in the table that is not a primary key but is auto incrementable, however, Django returns an error for not being able to…
-
0
votes1
answer54
viewsWhat if I don’t want any queryset in a Django view?
There are urls that I only need to set a Session or query a restful....enfim. API What if I don’t want a queryset? Because Django seems to force me to define a? Would have some kind of different…
-
0
votes1
answer105
viewsDjango does not create admin.py file in new app
I’m following some video lessons about Django to make some changes to a project started some time by someone else. However, when starting a new app in this project with the command django-admin…
-
0
votes0
answers146
viewsDjango error: Invalid block tag: expected 'endblock'
In the development environment works normally, already in the production server I have the following error: Invalid block tag: 'ultimos_produtos', expected 'endblock' Follow the code excerpt: {%…
-
0
votes0
answers122
viewsPython web application with Django - Bootstrap and Crispy only work if you have internet connection
My application uses these two frameworks Boostratp and Crispy, when I am connected on the internet, everything works perfectly, but when disconnecting the internet the site loses all style. Making a…
-
0
votes0
answers68
viewsMultipleobjectsreturned
When I create two topics with the same name, error:Multipleobjectsreturned class ForumView(ListView): paginate_by = 5 template_name = 'forum/forum.html' def get_queryset(self): queryset =…
-
0
votes0
answers282
viewsCreate super user inside a Docker container that this used with Compose
I have a Jango project that is running with Docker-Compose, what I need to do and very simple, run python Manage.py createsuperuser, however, even setting the command via dockerfile or in . Compose…
-
0
votes1
answer321
viewsGet the user logged in to the form
Hello! I need to get the user who is logged in to my application, because in the form I have modelChoice fields, and the query need to bring per logged in user, as shown below: Note: Working with…
djangoasked 7 years, 7 months ago Thiago Porto 292 -
0
votes1
answer169
views2 types of products in the same view
How could I list 2 types of products on index (Pizzas and Drinks) Defining a order by and dividing into divs different (div of drinks, div of the pizzas), follows what I have: class…
-
0
votes1
answer430
viewsHow do I integrate my Django project with Scrapy?
I’m looking to develop a simple project using Django where I will create a web page and this page will capture data from other pages. The problem is that I cannot integrate the Scrapy with Django.…
-
0
votes1
answer31
viewsMakefile does not work on MINGW64. Can anyone help me?
I’m programming in python in Django with Sublime Text 3, using Git Bash MINGW64. I created the Makefile but when I run I get "bash: make: command not found"
-
0
votes1
answer193
viewsPython and Django online course creation platform
I’m building a platform for creating online courses, and I’m using Python and Django. I would like to know whether there are already libraries in Django for this purpose. An example I’m using is the…
-
0
votes1
answer309
viewsIs there a tag in Django to show part of the text?
I wonder if there is a tag to show part of a description {{ post.description | tag-aqui }}
-
0
votes1
answer240
viewsDjango Template Email
DJANGO: Could someone help me place an email template (pull some html or css to the email content) through the views.py? I tried everything that way but it didn’t work, thanks from now on. Views.py:…
-
0
votes1
answer201
viewsDjango-admin startproject command does not create the Manage.py file
After running the Django-admin startproject command the Manage.py file is not created. I’m using python 2.7.12 I tested with versions of Django-1.4.3 and Django 1.5.1.…
-
0
votes0
answers57
viewsError starting Django
When trying to start the project on Django 1.9.5, it gives this error : Unhandled exception in thread started by <function wrapper at 0x7fb7346bfc08> Traceback (most recent call last): File…
djangoasked 7 years, 4 months ago Guilherme Lima 3,129 -
0
votes1
answer93
viewsCSS error - Django Formfield
This is giving the following error in my Django 1.9 form See that on the label gets the :> in the end. I DON’T WANT TO SEE THE LARGER SIGN (>) AT THE END OF THE LABEL Ex: Nome: > Follow my…
-
0
votes1
answer56
viewsReturning get_status_display in json (Django)
I created an issue. https://github.com/rg3915/orcamentos/issues/53 I made a chart using Morris JS https://github.com/rg3915/orcamentos/blob/master/img/graphic.png Question: how do I return…
djangoasked 8 years, 7 months ago Regis Santos 1,574 -
0
votes1
answer281
viewsrequest.post() does not work properly generating a 301 redirect on Nginx
I have a problem when I use request.post('url', data), for some reason when the server receives this request, it redirects (301) the request to the same url losing the POST data, ending as a GET…
-
0
votes1
answer533
viewsHow to print page
I want to create a template for printing data but I’m a little lost on how to do this, I have a print name button, the same is found in a table that contains the customer name, telephone address etc…
-
0
votes1
answer24
viewsDjango Tinymced
Good Morning guys I am with my program almost ready, at this time I’m trying to integrate DJANGO-TINYMCE to my page plus the tutorials I saw just shows how to use it in Django Adim, my doubt is…
-
0
votes0
answers554
viewsUsing Foreignkey to save to BD Django
I cannot do Data’s relationship with Teacher, I have to save Teacher and pass his id to Data foreign key and save, when I execute the code id is not passed Forms.py class…
-
0
votes2
answers45
viewsReturning manager in template (Django)
How do I return the amount of books published in the template? I have it # models.py class PublishedManager(models.Manager): def published(self): return self.filter(published=True) class…
-
0
votes1
answer145
viewsIs there any risk in using Django’s Token generator in different services?
Assuming I’m already using the library django.contrib.auth.tokens.default_token_generator generating tokens to reset a user’s password, and want to use the same method to activate the user, or for…
-
0
votes1
answer32
viewsVerificaciones periodicas Django
How could I create a loop, thread or anything that my webapp periodically checks every 5 minutes the database and deletes entries that are "expired". I did some research, but I couldn’t find…