Questions tagged as 'django'

1
answer

Online software hosting using python and django [closed]

I'm developing a small ERP management software in Python and using the Django framework, so I had to install some requirements. How do I host this system? Is it like a website? What are the differences? What is the best hosting system?     
asked by 07.12.2018 / 17:14
2
answers

Random search does not work

I want to do a random search in the database, but it is not working. I want to take a sentence, and show it on the screen, it will be changed every time I refresh the screen. My view.py: def busca_tendencia(request): tendencias = Frase....
asked by 25.10.2018 / 14:50
1
answer

Calculating a date within the Model Django timedelta

I'm declaring a function (data_prox_prog) to calculate a future date and store in the model, but it's not happening as expected. Here is the code: class ProgressaoDocente(models.Model): servidor = models.ForeignKey(Servidor, on_delete=models.P...
asked by 02.09.2018 / 04:56
1
answer

Django forms.CheckboxSelectMultiple issues: Select a valid choice. [''] is not one of the choices available

I'm trying to use a checkbox to select items in a list, but it returns the following error: Select a valid choice. [''] is not one of the available choices. app models.py : from django.db import models from django import forms from djan...
asked by 31.08.2018 / 19:49
1
answer

django does not connect to mysql database

I was doing this project in linux Mint and had to switch to windows and I'm having some problems setting up the environment. when running the command    $ python manage.py migrate I get the following error:    (venv) C:\Users\Nee...
asked by 10.10.2018 / 03:24
1
answer

Django + Postgresql object has no attribute

I'm trying to do a validation before sending my form, however it returns me the following error: 'StudentForm' object has no termAccepted attribute app models.py: from django.db import models from django import forms from django.forms...
asked by 28.08.2018 / 21:07
1
answer

Doubt with Django 2.0 views and urls [closed]

What is the best way to do these functions in views.py , or does it have to be anyway? from django.shortcuts import render def index(request): return render(request, 'contas/index.html') def cadastro(request): return render(re...
asked by 31.07.2018 / 18:55
1
answer

Explain template location in Django

I'm using Django for a project, but I came across a question. In my file settings.py I have the following configuration of templates : TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates',...
asked by 25.07.2018 / 02:13
1
answer

Django Rest Framework with Images

Well I'm still studying this framework, I researched a little tried some ways but they did not work. Error:    'UnboundLocalError at / api / services / 1 / local variable' Service '   referenced before assignment ' Code: Serializer...
asked by 26.07.2018 / 05:24
3
answers

Required field modification if checkbox is selected in Django

I need to check if a "checkbox" button, called yes_no, was selected on my html page and change the "name" field to mandatory when this checkbox is triggered. My code is as follows: In the models.py file: from django.db import models # Crea...
asked by 29.07.2018 / 15:34