Questions tagged as 'django'

0
answers

Django 2.0.9 - docker-compose up - creation of super user

Good morning. Can anyone help me with the following problem: I'm creating a docker-compose from a Django application . I need to create a super user at the moment of the command: $ docker-compose up However, I'm not getting it, here...
asked by 03.12.2018 / 22:13
0
answers

Date field with default value in the database

When I create a DataTimeField type field in Django, it has already been defined so that it contains the current date in this way: dt = models.DateTimeField(auto_now_add=True) or dt = models.DataTimeField(auto_now=True) But that way the...
asked by 04.12.2018 / 18:10
1
answer

I need a one to many relationship between 3 tables

Hello, I have the table People, Vehicles and Monthly who are the users that pay per month the precise stamping that each person can have more than one vehicle, but when registering in the monthly table when selecting a persona appear in the othe...
asked by 11.12.2018 / 09:26
0
answers

Django 2.0.9 - Dock application - Difficulty in completing the process

Good afternoon, guys. I'm doing a job at the University. Basically it is an application in Django version 2.0.9. However, the teacher asked us to perform the following procedure to deploy the application to a university server: "In the las...
asked by 02.12.2018 / 17:57
0
answers

Heroku - Git - Error in push - command: python manage.py collectstatic --noinput

Person, good evening. Can anyone help me? I have the following problem when installing the static files. It looks like the static folder is not being recognized. When I run the command $ git push heroku master The following error...
asked by 22.11.2018 / 00:30
0
answers

Django saves the records only with a default value and not with the value of the form

Good night, I'm having a big problem with django, no matter what I do, it always saves the data I set as the default rather than the data I sent through the form. models.py from django.db import models from django.contrib.auth.models impo...
asked by 22.11.2018 / 06:25
0
answers

error in the pattern when uploading the dropbox via django admin

WhenItrytouploadanimageviaDjangoAdmintosaveitonthemediaanduploadittothedropboxaccordingtothesettings: link MEDIA_URL = '/ media /' MEDIA_ROOT = os.path.join (BASE_DIR, 'media') STATIC_URL = '/ static /' STATIC_ROOT = os.path.join...
asked by 27.11.2018 / 14:23
1
answer

How to put value in Django field goes HTML?

Hello, I'm starting with Django now and wanted to know how to pass the value of the database to a Djan field using HTML to save the edit. Na minha View: @login_required def editar_aluno(request, id): aluno = Aluno.objects.get(id=id) if...
asked by 21.11.2018 / 08:09
0
answers

Django - CPF or CNPJ

Good afternoon, people. As a way of learning, I'm creating a system in Django with a Customer registry. Someone could help me in the logic so that in the register I can choose CPF or CNPJ. My Models is currently like this: class Clien...
asked by 13.11.2018 / 20:21
0
answers

RelatedObjectDoesNotExist (Django)

I have the error RelatedObjectDoesNotExist, follow the Traceback. Traceback: File "/usr/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner   34. response = get_response (request) File "/usr/lib/python3.7/site-packages/...
asked by 22.11.2018 / 16:27