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
-
3
votes1
answer188
viewsReading of csv with Django
Well, I’m working with an open database, and it’s in CSV, I’m using DJANGO to read the CSV and so entering into the database... However is giving a flaw in the insertion of the first year,I’m trying…
-
3
votes2
answers1897
viewsDjango - Null and Blank Difference
I’m having a hard time understanding the real difference between null and blank on Django, For example: In this code, to my understanding the name field will be NOTNULL in the database, but what…
-
3
votes2
answers1083
viewsPasses template content to view Django
Well I know it is possible to take content from a view and move to a template. But the doubt would be like taking the "value" of an input and passing to a view, an example of the use would be.…
-
3
votes1
answer325
viewsHow to use Createview
I’m trying to create a simple to-do list, but I’m having some problems. I want to create a task, within it I want to create some activities. That’s the problem I can’t do. How can I create an…
-
3
votes1
answer91
viewsHow to call the id of the previous select
I have two selects, one for division and the other for groups. When the division is selected it has to bring in the second only the groups that are part of that division. In the url variable that…
-
3
votes1
answer834
viewsHow to select all elements of the same id in Javascript in Django
I have a table in Django where all the answers of a test are stored, but when I select them to compare with the answer provided by the user, all the answers are the same as the first question. I…
-
3
votes1
answer262
viewsProject Structure in Django
I installed Django in a project and would like to make the folder structure somewhat similar to Laravel. I can organize myself better this way. But I don’t know if it’s possible using such a…
-
3
votes1
answer1208
viewsMultiple users and authentication - Django
I am developing a project in Django that has two types of users: Client and Accountant. Each one is authentic and has keys that identify them differently. The Customer has as its primary key its…
-
3
votes1
answer31
viewsUse tuple with parentheses in Django query
I made a cursor to get the menus Parent of my application, then I want to iterate each menu Parent and get the menus associated with it. However, when passing the Parent parameter, the second course…
-
3
votes1
answer856
viewsDjango + Python how to update a table item
Hey, guys, I have a registration flow where in a first step save the student and then the data of the responsible, however, after that I need the student to make a description and this description…
-
3
votes1
answer5459
viewsDjango: Reverse for '' not found. '' is not a Valid view Function or Pattern name
I am trying to put a url based on my views.py but it returns me the error: Reverse for 'create_student' not found. 'create_student' is not a Valid view Function or Pattern name. py urls of the…
-
3
votes2
answers997
viewsDjango + Python, show modal using {% if %} in template
I’m making a check if there are active classes, if there is should present a modal and not the registration form, but it is not working: py views.: from django.shortcuts import render, redirect from…
-
3
votes2
answers724
viewsConcatenate variables in the Django template
Talk guys, good morning, I have a problem. I’m walking through a lista but I want to concatenar my list I’m calling on template as {{ list }} and {{ forloop.counter0 }} so that in mine is only…
python django list django-templates string-concatenationasked 6 years, 1 month ago Raphael Melo De Lima 461 -
3
votes1
answer359
viewsHow to use back-end information on the front end with Python and Django?
In my code Python I create an object called status as follows: In Forms/status.py class StatusForm(forms.ModelForm): class Meta: model = Status fields = ('status', 'posicao') widget = { 'status':…
-
3
votes2
answers1851
viewsHow to assign a function to a button in Django Python
I am doing a Jango course and I would like to know if it is possible to assign a function to a button. For example: <form> <label for="word">Digite uma palavra:</label> <input…
-
3
votes2
answers332
viewsTreatment of Python Images
I have a question here of architecture: The application we are building has a load of images pro system. They are photos of ads, and each one can upload 12 photos. These ads are dynamic, meaning…
-
3
votes2
answers79
viewsCreating routers for multiple databases in Django
I am developing a Django application where I need several Databases, one for each user of the system. For this I set the Databases like this: DATABASES = { 'default': {}, 'primary': { 'NAME':…
-
3
votes0
answers100
viewsHow to export . csv with Django-Tables2?
I am trying to export a table with Django-Tables2, I have done the following so far. Tables py. class ClienteTable(ColumnShiftTable): class Meta: model = Cliente sequence = ('id',…
-
3
votes1
answer3140
viewsMost likely due to a circular import (How to Resolve)
Good night. I’m new in Django/Python, I’m developing a system where I have a circular relationship, I have the class person and the company, where a person belongs to a company and a company is a…
-
3
votes1
answer40
viewsToggler doesn’t work
I am studying Django and found the following problem when using the staticsfiles, the Toggler that appears when the screen is reduced does not extend my bootstrap navbar, I did not find the error.…
-
3
votes1
answer85
viewsReplace string_concat() with equivalent
I am a beginner in Python and accepted to participate in a more or less old project, which was using Python 2.7 so far. At the beginning of the year, this version was deprecated and now I can’t…
-
3
votes1
answer32
viewsProblem extending the Django.db.models.Manege class
I extended the class django.db.models.Manager to pick up the records that are públicos and by doing so I can no longer list all the calling records Product.objects.all() Even in my administration…
djangoasked 3 years, 8 months ago danilomarto 59 -
2
votes1
answer255
viewsProblem in importing User models
I am doing some tests in a Django project. I created a very simple module just for testing. Below: from django.contrib.auth.models import User def teste(): for i in User.objects.all(): print…
-
2
votes1
answer1489
viewsDjango - Error saving to Database
The data is not being saved in the database and Django is not generating Error, but when I create an object of Livro and try to save by shell it returns me the following error: Valueerror: invalid…
-
2
votes1
answer119
viewsPage display error - Django
At Django I’m developing a Library project! (I’m Beginner at Django, I’ve never worked with web development) Summarizing I have in the file models.py a model Library and a model Book, in the model…
-
2
votes1
answer430
viewsWhat is the best way to organize views in Django?
I have views.py in my study project where I group it from methods to represent views (methods that return Httpresponse), to generic views based on class (such as Detailview, Listview). I was…
-
2
votes2
answers3857
viewsDjango - How to redirect the user to the other pages of the application?
In the menu of the template I have a menu Dropdown with the links to the other pages of the app! In the menu of the home page of the application I have the links to the other pages of the…
-
2
votes0
answers149
viewsCatch a JSON using Javascript
Django creates a file called py views., in which I have the following function: def carro_view(request,carro_slug=None): evento = Evento.objects.filter(time = '11:28:30').distinct() data = [] for x…
-
2
votes1
answer121
viewsFile per folder limit - Django 1.7
Does Django 1.7 provide any upload control mechanism per folder? I say this because when the number of files in a folder gets too large it tends to get slower. An example would be: Every 800 files…
-
2
votes1
answer122
viewsAWS S3 Disabling Sslv3 Support
I received an email from AWS that basically says S3 will no longer support Sslv3. Then they listed the list of Buckets that are receiving requests on Sslv3 and one of my Buckets is production. The…
-
2
votes1
answer64
viewsImproving the return of a specific result
I think I’m letting go of the basics! I have a result that returns me only one element in the dictionary: [{'quant': 236, 'district': 'Centro'}] My context is: context['Districts'] = d How do I make…
-
2
votes1
answer165
viewsHow to build a queryset that returns only the cars with the last approved revision?
I’m looking to create a queryset that returns only the cars that have had the last approved review. It is known that there may be n cars, and each car has a history of revisions, so there may be n…
-
2
votes1
answer669
viewsWhat can happen to my project if I remove the virtual environment set up for it?
Let’s say I created a virtual environment through virtualenvwrapper $ mkvirtualenv venv. I create my project, make the necessary settings, start working on the project and one fine day I do the…
-
2
votes1
answer445
viewsAngularjs and Django integrationForms to record data
How you’re handling Javascript frameworks integration with forms django? Sample scenario Address forms where there is a telephone field (Many-to-ONE), which in the template is represented by an…
-
2
votes2
answers738
viewsProblems trying to save to "POST" = "no-such-table" Django / Python database
I’m following a course by Python and Django, and the problem begins when the version in the course is 1.1.2 and mine is 1.8.2 I managed to generate a form to save "Events" however, when clicking on…
-
2
votes1
answer163
viewsHow to register a data matrix in Django
I have an array of data in my Storage Session related to products from a store, and would like to register a sale as soon as the user registers all their products and click Finish Sale. This matrix…
-
2
votes1
answer508
viewsPOO using Django
I’m starting to work with Django, but I’m having some doubts about how to organize my project, I would like to know the best way to structure my projects. I’m used to the languages in which I model…
-
2
votes1
answer225
viewsQueryset: Getting the description of the accessories on request (Django)
Consider the example below: class Vehicle(models.Model): vehicle = models.CharField(_('veículo'), max_length=50, unique=True) price = models.DecimalField(_(u'preço'), max_digits=8, decimal_places=2)…
-
2
votes1
answer183
viewsDjango - extend admin template
could anyone indicate the best way to extend the Django template? and what is the best way to share a template with the Adminstrative area and the site. I am using Django version 1.8.6 and…
-
2
votes1
answer848
viewsHow to return Objects in a Many to Many Django
Consider the model class Dealership(models.Model): dealership = models.CharField(max_length=50) class Ordered(models.Model): customer = models.ForeignKey("Customer") dealership =…
-
2
votes2
answers2143
viewsWhat is the difference between . save() and . update() in Django?
I’m having trouble understanding the difference between them, because I realized I was using the method. save() to change my values, but I noticed that there is . update().
djangoasked 8 years, 11 months ago Rodrigo Boniatti 214 -
2
votes1
answer1267
viewsproblem when installing Django
I lowered the Django and unpacked on the desktop went to the Cmd typed desktop cd right away cd Django-1.6.2 which is the name of the Django so far so good, more when I run the code python setup.py…
djangoasked 8 years, 10 months ago marcos macedo 21 -
2
votes2
answers557
viewsCan I upload to a subfolder using Filefield?
When I define one FileField (or ImageField), I need to specify a upload_to: campo1 = models.FileField(upload_to="uploads") campo2 = models.ImageField(upload_to="img/%Y/%m/%d") In the first case, all…
-
2
votes1
answer166
viewsHide CRUD buttons in Django templates for users who are not logged in to the system
I would like to hide my system buttons that allow: add, edit and delete data from my templates for users who are not logged in to the system. He can be seen here:…
-
2
votes1
answer1093
viewsHow to import database for Django models?
I have an application that is almost ready. It was developed in PHP, through the Laravel Framework. I already have the database and all some data already entered to perform tests. However, as I am…
-
2
votes1
answer525
viewsFilter with Choicefield (Django)
Consider my form: Forms.py status_list = ( ('', ''), ('c', 'cancelado'), ('elab', 'em elaboração'), ('p', 'pendente'), ('co', 'concluido'), ('a', 'aprovado') ) class StatusSearchForm(forms.Form):…
-
2
votes2
answers1166
viewsHow to return a query in JSON format with extra values and custom Keys?
I want to return the result in JSON following this format: {"cadastros": [ {"id": 1, "STATUS": true, "pessoas": [], "podeEscrever": true}, {"id": 2, "STATUS": false, "pessoas": ['Maria', 'Ana'],…
-
2
votes1
answer524
viewsUsing json to copy data (Django)
I thought better, and I think I’ll use json. def entry_detail_json(request, pk): data = Entry.objects.filter(pk=pk) s = serializers.serialize("json", data) return HttpResponse(s) But being on the…
-
2
votes0
answers208
viewsHow to edit files and compile them in Python + Django
I edited a file. py, I compiled it but it says I don’t have permission. [Errorno 13] Permission denied: 'models.pyc'
-
2
votes1
answer228
viewsHow to allocate a Python (Django) project to a ready and configured server? (Apache, Mysql, Python, Django OK)
I have a server ready and fully configured. Python, Django, Apache, Mysql, all OK. I’d like to replicate an existing project on this server for testing. The files and database are already…