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
votes1
answer69
viewsProblem with urls and views inside the server
I was studying python and Django, and I decided to make my wedding website in January. The project runs perfectly on my local pc, the problem is when I deploy on digital Ocean and it gives that…
-
1
votes1
answer99
viewsDjango 1.11. Serving robots.txt, sitemap, etc.
I need to know how to serve these files that usually go to the root of the project. I’m making a route for each of them in the.py urls file but it doesn’t seem the right way. What’s the right way?…
-
1
votes2
answers289
viewsDjango create paging using Ajax
I want to upload the pagination without refresh using ajax I have a table where shows 5 items per page the goal is to change page not refresh the page to switch to the following In the views: In the…
-
1
votes1
answer46
viewsDjango csv error
Well, I have a problem reading csv and entering the data. I believe it is in Foreign key. The code is: View: def csvAih(request): coluna = 1 mes = 1 ano = 2008 while (ano < 2017): with…
-
1
votes1
answer91
viewsPython / Django: sending emails resulting in 535 (gmail working)
I have a contact form where I send the message to the system administrator informing him about it. Email configuration information is fully verified and correct. EMAIL_HOST='mail.xxx.net'…
-
1
votes1
answer244
viewsOrdering relationship results "Manytomanyfield" with the same table in Django
I have the Many to Many relationship with the same table, and I need to order the result with the same creation sequence. ex: add basic Django, intermediate Django, advanced Django; It has q appears…
-
1
votes0
answers277
viewsDynamic python Python Dashboard
I am developing a project that requires a form to be created by the size of the amount of item that is created in another form. The initial form is the Formrota: class FormRota(forms.ModelForm):…
-
1
votes0
answers103
viewsPython I can’t import Recaptchafield
There’s a project that was sent to me that I’m going to work on. I created an Environment to move up the project and in the project had the requeriments where I surrounded it. But when executing the…
-
1
votes1
answer71
viewsWhat is the right way to do the template in Django/python?
This has been my first contact with the framework and with mvc/mvt, and I’m in doubt, as a matter of good practices and tals, should I make a template for each of the views or should I just make a…
-
1
votes1
answer2166
viewsRedirect and Render in Django
I have a file views.py which has the following method: def alterar(request, pk): cliente = get_object_or_404(Cliente, pk=pk) if request.method == 'POST': form = ClienteForm(request.POST, instance =…
-
1
votes0
answers46
viewsScript to deploy Pipenv (Python)
Hello, in the company where I work firewall rules do not allow servers intended for the intranet to have access to the web. Thus, work with venvs, where dependencies are installed with pipenv…
-
1
votes1
answer96
viewsCreating a form that has the Choice pre defined
I want to launch an item on as expense or revenue for this I did; from django.db import models # Create your models here. class SubCategoria(models.Model): ESCOLHA = ( (u'1', u'Receita'), (u'2',…
djangoasked 8 years ago GuilhermeVieira 11 -
1
votes1
answer62
viewsQuery with parameter
I’m watching a video python but I didn’t understand one thing. I have the file utils.py def code_generator(size=6, chars=string.ascii_lowercase + string.digits): return ''.join(random.choice(chars)…
-
1
votes1
answer114
viewsWeb Crawler with Django’s view.py
I am making a simple web Crawler, using Django 2.0, I want to capture only the "title" class of the news and then render "Return render" to a simple html, below my view.py. I am currently using…
-
1
votes1
answer932
viewsHow I create 2 Foms simultaneously Django
What I want is in a single templante bring these 2 Forms simultaneously, in separate pages works, but the two together still could not do. Do I need to make an intermediate form? Am I making a point…
-
1
votes1
answer584
viewsCreating Table/BD with Django?
I use python 3.4 and the latest version of Django, I am using the command "python Manage.py sqall" but does not recognize the sqall command. (I’m trying to create a table in Bd, and already insert…
-
1
votes1
answer32
viewsHow to simulate production in dev while maintaining data secrecy?
When a production error occurs, the programmer needs to simulate the error to correct it. But I don’t want the developer to have access to all production data. The solution I thought was to have a…
djangoasked 6 years, 3 months ago Karl Zillner 873 -
1
votes1
answer125
viewsDjango. Only change in the database via html
I’ve been developing in Django for a little while, I have an image like on my site, when I click on it I would like to only change a field in the bank without reloading or resending the page and…
-
1
votes1
answer122
viewsLoaning another Jango user
Good Morning I checked user sessions through login and logout: In the login before logging it makes an Insert in my table: cursor.execute("INSERT INTO usuarios_sessoes (usuario, datahorainicio)…
-
1
votes1
answer577
viewsTimefield presentation format in Django
class Passagem(models.Model): inscricao = models.ForeignKey(Inscricao, verbose_name='inscricao', related_name='passagem', on_delete=models.CASCADE) hora_passagem = models.TimeField('Tempo',…
-
1
votes1
answer47
viewsModels in Django is everything in one file?
I’m starting my studies in Django, I come from frameworks like Rails, Laravel, Asp.Net, and I came across a difference that I was surprised that in Django the models are all together, is that…
-
1
votes2
answers712
viewsRename application in Django Admin
Good evening guys, I’m trying to rename the application in Django admin according to the documentation, but it ended up not happening, I think I’m doing something wrong, the code is as follows:…
-
1
votes1
answer4680
viewsHow to create a form and authenticate Django user
Good night to you all. I am developing a Django project for educational purposes only and I could not find a solution to my problem. I could not generate a form for the user to log in and much less…
python-3.x django login authentication django-templatesasked 7 years, 9 months ago Victor Alessander 387 -
1
votes1
answer2796
viewsEdit word file . doc in Python
I am developing an application in Pythonand Django and need the user to attach a document file .doc. Done this, in this file, the user will have typed some variables, and I need to replace them with…
-
1
votes1
answer429
viewsCreate a table with initial data in Django
I want to create a table with the names/ types of a template, in this case, are documents, I have this template code class Document(models.Model): hash = models.CharField(max_length=256) name =…
-
1
votes1
answer638
viewsDifference between task and shared_task in Celery?
I am implementing a time-consuming process in my Django application that needs to be run asynchronously to avoid timeout in the browser. For this, I chose to use the Celery to perform the…
-
1
votes1
answer414
viewsRun Python code by calling for a Django form
good afternoon. I’m starting to study Python and Django. By way of study I wrote a code in Python that receives a value and a date and makes the update by TJLP. This worked perfectly. As the next…
-
1
votes1
answer485
viewsDjango without models view in common user admin even if you have permissions and are in the same group
Good afternoon, So I’m trying to give permissions that already come in Jango to an ordinary user who even belonging to the group cannot access the models that are granted to him. Someone had this…
-
1
votes1
answer2522
viewsProblem with Django form:Integrityerror: NOT NULL Constraint failed
Guys, I’m trying to make a form using model in Django that save the data when I click the button and redirect to a page, well I managed to make the form page, only after putting the necessary data…
-
1
votes0
answers80
viewsAdd an action button to the Django admin change_list
I’m new to Django, I’d like to know how to add a button next to the files that have been added and take me to another page, such as deleting from the combobox Action. How can I do it? If you can,…
-
1
votes0
answers43
viewsHow to know how much storage was occupied by a Python/Django application?
I developed a web application with Python and Django. I would like to limit the amount of space used for each user, because in the application it is possible to insert images and documents. I use…
-
1
votes2
answers1075
viewsConnect SQL Server database to Django
I have an SQL Server database that already exists, and I need to connect it to my project in Django. So I come here to see if anyone has already found a solution to the problem, as they still can…
-
1
votes1
answer1390
viewsDjango, recover selected value on page
Good night! I created a view where I recover the sellers and created a variable (id_seller) to receive the selected seller on the screen. html is being created correctly, but the variable in the…
-
1
votes1
answer61
viewsIs it necessary to create an app for each entity in a Django project?
I wonder if it is a good practice or if it is a very "extreme attitude". Example: My project has user, client, subscription and product entities. I can create an app with all these entities or…
-
1
votes1
answer29
viewsQuestions about Relational Models in Django
Hello, I’m creating a Blog system with Django, in it I have several Models: Profile(which receives an auth.User), Post(which has an Author field that receives a Profile). I am developing a page to…
djangoasked 5 years, 7 months ago Gustavo Halmer 11 -
1
votes1
answer80
viewsChained Many To Many Field does not return values
Below is a screenshot of the registration screen where options for choices should appear The low image containing the options that should appear in the image above follows the model.py code from…
-
1
votes1
answer50
viewsCorrect way to execute query in Django?
I need to execute the query SELECT pg_database_size('mydatabase'), how do I do this in Django with the SGBD Postgres? This is what I’ve tried from django.db import connection cursor =…
-
1
votes2
answers56
viewsCategory Names not shown. Object (1)
Can someone help me fix why the category names are not being displayed in my admin console? from django.db import models from django.conf import settings class Cad_pref(models.Model): nomepref =…
-
1
votes1
answer198
viewsHow to set email as a Django username
I have the following code to create a custom User: from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin,UserManager class User(AbstractBaseUser,PermissionsMixin): username =…
-
1
votes2
answers736
viewsDjango/Ckeditor Error build_attrs() got an Unexpected keyword argument 'name' Request
build_attrs() got an Unexpected keyword argument 'name' Request Method: GET Request URL: http://localhost:8888/admin/videos/videos/1/change/ Django Version: 1.11 Exception Type: Typeerror Exception…
-
1
votes1
answer2013
viewsPython, how to validate if the variable is None?
I’m not able to verify if the variable has no value (None) View: endereco_id = request.POST.get('endereco_id', None) if formCliente.is_valid() and formEndereco.is_valid(): print('**********…
-
1
votes2
answers73
viewsHow do I get Django to see the folders on my computer?
I need to make my system see folders that are outside your folder, to render the . pdfs that are inside those folders. I’m using a function in javascript (Vue.js) very simple, similar to this one:…
-
1
votes0
answers186
viewsPython with Django is giving problem when migrating a model
C: Python programs mysite>python Manage.py makemigrations polls Traceback (Most recent call last): File "Manage.py", line 22, in execute_from_command_line(sys.argv) File "C: Python27 lib…
-
1
votes2
answers274
viewsLimit Simultaneous Access in Django
I wonder if there is any native way of the Djang framework itself to limit the amount of screens per user, I have researched about and can’t find anything to answer that. I want to prevent a user…
-
1
votes1
answer988
viewsScheduling of Tasks in Django
Guys is the following, in Django things only happen when some user accesses your application. AN EXAMPLE (fictional) Let’s imagine that you created an application in which the user enters and…
-
1
votes2
answers444
viewsHow to configure the Django environment and maintain settings?
Hello, I’m starting to learn Django and well part of the material teaches how to Make Environment Setup with Virtualenv. However I am having many difficulties to configure the System. First, I use a…
-
1
votes0
answers34
viewsLogging request.META does not work with Django Channels + Asgi_redis
I have a custom class for logging and my Settings this way: base py. LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format':…
-
1
votes1
answer83
viewsAssertionerror: b' Working with test classes in Django (TDD)
I’m starting my test studies with Django and I’m getting an error where apparently it shouldn’t, so much so that the description of traceback leaves me quite confused. I have a class that tests…
-
1
votes2
answers594
viewsHow do I test user type and send to different views in DJANGO Generic views
Hello, I have a question at Django. I’m trying to do it this way. My user model has a "level" field, this field has some levels, among them "root", "seller" etc.. However, I would like to know how I…
-
1
votes1
answer500
viewsHow to redirect url with argument to another page in Django? (Updateview, Genericview)
Well, I have a very pertinent question. I am with an editing class of Django, and when I edit the user, I need it to call from the detail class of the same (Detailview), the two classes are working,…