Most voted "django-2.0" questions
65 questions
Sort by count of
-
5
votes1
answer742
viewsDifficulty performing data CRUD with Fullcalendar and Django/Python
I’m trying to use the FullCalendar in my project Django and I’m having a hard time doing the data crud. I would like everything to work on the same screen, that is, when the user selects dates in…
-
2
votes1
answer204
viewsHow to compare two values of two different classes in Django
Hi, I’m new to Django and I have the following problem, I have two classes in Django one of them is : class Apps(models.Model): id = models.UUIDField(db_column='ID', primary_key=True) # Field name…
-
2
votes0
answers182
viewsProblem with success_url in Django
In views I have the following classes class AdicionarPessoaView(CustomCreateView): template_name = "cadastro/adicionar.html" form_class = PessoaForm model = Pessoa obj = Pessoa.objects.all().count()…
-
2
votes1
answer1301
views'Model' Object is not iterable
As soon as I click on a button that calls my view to edit the Row of the table in question shows me the error: 'Meumodel' Object is not iterable. I’m using Django 2.1.15 Python 3.8.1 SQL server…
-
1
votes1
answer64
viewsIs Django 2.0 stable for production use?
I would like to know if I can migrate to Django 2.0 and use this version in production, without worrying about absurd bugs. I will have to update some libs and find solutions to outdated (until then…
django-2.0asked 6 years, 3 months ago Guilherme IA 1,414 -
1
votes1
answer2424
viewsrequests.exceptions.Sslerror: Certificate Verify failed
I’m having a big problem with Django requests. In the last few months I upgraded to version 2.0 of Django, and I’m updating all libs. I noticed that this impacted several scripts that I had, mainly…
-
1
votes0
answers84
viewsTemplate image does not upload
Hello, I’m developing an app that needs the user to upload their profile image, but the 'upload_to' mechanism of the Customuser ft field apparently isn’t working. The image simply does not go to the…
-
1
votes1
answer279
viewsERROR - DJANGO 2.0.9 - Typeerror: create_superuser() Missing 1 required positional argument: 'email'
You can help me with this problem, I’m new to Django: So, I’m taking an Internet course to create a distance learning platform to learn about Django. I am using the version Django 2.0.9, I have a…
-
1
votes0
answers33
viewsCreate Django app backup automatically
I developed a web application in Python and Django and I need to backup the data daily. Currently, I used the Postgres like SGBD. To perform the backup I discovered the module django-dbbackup, but…
-
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
answer374
viewsHow to logout in Django?
I managed to create and log a user into the system, but the logout does not work and I do not understand the reason. View: def logout_view(request): logout(request) return redirect('home') html file…
-
1
votes1
answer515
viewsHow to assign the PK of the logged-in user in Django to an FK in the model?
Hello, what I am trying to do is basically the following, I have in my application a Model called 'Shopping', and one of the fields of this Model is the user who registered the purchase, I want each…
-
1
votes1
answer56
viewsFind file in templates directory
In versions up to 2.2.5 of Django I put my html files that were passed in the view as follows : myapp templates myapp index.html But in Django 2.2.6 and 2.2.7 when I do this gives the following…
-
1
votes1
answer1442
viewsPick a select value in Django
The HTML code: <!doctype html> <html lang="pt-br"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0,…
-
1
votes1
answer32
viewsLabel não some Django
Use a radio and a Javascript script to make the action disappear the agency field of the report Model, the problem is that add only the combobox the label does not add up. Model class…
-
1
votes1
answer110
viewsUpdate on Timefield Django 2.0
I have a model with several fields, one of them is the Timefield type: class Venda(models.Model): id = models.AutoField(u'AÇAIEX', primary_key=True) hora_saida = models.TimeField(max_length=6) To…
-
1
votes0
answers32
viewsSelect multiple in Python and Django
I have a class Lancamento and a class Plano de conta. Plano de conta is a secondary Launch key, ie I register account plans and when registering a launch I select an account plan. For that, I did so…
-
1
votes0
answers357
viewsImport . csv file with Python/Django
models TIPO_PESSOA = [ ('PF', 'Pessoa Física'), ('PJ', 'Pessoa Jurídica'), ] class Pessoa(models.Model): nome_razao_social = models.CharField(max_length=255) tipo_pessoa =…
-
1
votes0
answers15
viewsProblem reading . csv in Python/Django
I am trying to create a new person from a .csv. file My code is as follows:. models TIPO_PESSOA = [ ('PF', 'Pessoa Física'), ('PJ', 'Pessoa Jurídica'), ] class Pessoa(models.Model):…
-
1
votes1
answer593
viewsFormatting Django decimal number template
I’m having trouble displaying the results of a calculation. I have a Decimalfield and want to return it formatted this way: 1.000.000,00 If I order to display normally without tags, it looks like…
-
1
votes1
answer806
viewsError including app urls in project.py urls
I’m at the beginning of a project with Django 2.2.1, creating the first apps and making the links between the pages. In the project’s urls.py, including the Accounts urls worked (with the…
-
1
votes0
answers33
viewsDjango dependent drop down using inline formset
I’m following this tutorial. How to Implement Dependent/Chained Dropdown List with Django But I’m trying to use the inline formset. Has anyone ever used it this way? For my problem is in the…
-
1
votes0
answers120
viewsInternal Server Error 500 (Nginx) when I try to generate PDF by Weasyprint
Good morning, you guys. I have a problem in my application and I tried everything and I could not solve. I decided to generate dynamic PDF in my application and for this I used the Weasyprint…
nginx django-templates django-2.0 django-admin internal-server-errorasked 4 years, 11 months ago Alison Andrade 52 -
1
votes0
answers292
viewsHow do I refresh a page without losing the content typed in a form?
I am developing a web application using Python and Django, and at some point I need the page to be updated, but without losing the information that was typed in a form. I tried to use the script…
-
1
votes0
answers37
viewsHow to change a form dynamically?
I have two models, Empresa and Funcionario. I would like when the user selects the company the employees are dynamically set in the employee form as both Forms will be shown on the same page. So…
-
1
votes1
answer30
viewsDjango: How to prevent date field conflicts in admin
In a record of a Vaga inside the Django admin I have two fields: data_inicio and data_fim. But I wish it wasn’t possible to put one data_fim less than data_inicio, and I don’t know how it can be…
-
0
votes0
answers58
viewsDinamic url assumes user logged in to visuzaliation
I have a system that when the user is logged in the top menu that is fixed appears the photo and his name, plus the options since he is logged in, so far so good. and I’m using dynamic url to do…
-
0
votes1
answer112
viewsCreate database and superusers automatically with Django
I developed a system with Python and Django. Now I would like to make it available on the web so that users can create accounts on the system, for this it would be necessary that each user has their…
-
0
votes0
answers100
viewsDetect distinction between the model chosen by the user for registration
Hello, so, I created some models to register users in Django 2.0 and now I need to know which one the user chose to register. As you can see I have the individual model (Customusern), legal entity…
-
0
votes1
answer314
viewsDjango 2.0.9 - Multiselectformfield - Parameter to make not mandatory
I want to take the field Multiselectfield not mandatory. When I do not choose any of the options the validation is charging mandatory field. I tried to use the parameters Blank=True and null=True,…
-
0
votes3
answers28
viewsShow url name on page
someone knows if da to capture the name of the url on the page? type to want to make a condition to use class="active" example: {% if url 'create_indicador' %} <li class="active">....... {%…
-
0
votes1
answer223
viewsError: Deploy Python Heroku - Runtime (python-3.4.0) is not available
Personal, all right. Someone can help me solve the following problem: I’m making an application in Django and now I’m in the process of uploading to the server. I’ll send it to Heroku. I performed…
-
0
votes1
answer89
viewsDate validation composed of three integers in Django
In my application I am receiving from the user the day, month and year, the three fields are part of a form and are IntegerField. I don’t want to use the DateField, because the user has the options…
-
0
votes2
answers766
viewsLoad image in html from saved path in Django database
I’m trying to make a newspaper using Django and Mysql database and now I need to list the news images: In my database I have saved the image path, because I thought it would have a better…
-
0
votes1
answer543
viewsValueerror: Cannot assign "'1'": "User.campus" must be a "Campus" instance. Super User registration error in Django
I’m developing an application where the user needs to be on a campus. However when superuser is created in the terminal an instance error occurs. Note: The database is correctly pre-filled to fetch…
-
0
votes0
answers496
viewsReverse for is not a Valid view Function or Pattern name. only happens in production
I do not work long with Django but I come here turning around + now I fall into this problem I am not able to solve, so I ask for help from those who can. I have my application working in perfect…
-
0
votes1
answer756
viewsDoubt in Python request Django GET/POST
Good evening, I have a problem that I cannot solve in Python 3.6.7 and Django 2.1.1 I have the following codes: views @login_required def profile_provider(request, provider_id): provider =…
-
0
votes1
answer111
viewsComplex filter with multiplications in the Django model
I have a doubt that I have from the beginning of a project that I am developing and I have not yet found an answer... I have 2 models in my project in Django: class Turma(models.Model): nome =…
-
0
votes1
answer52
viewsDisjunction between two types of users using if
Opa, I’m using djando admin for login, by Accounts, and I’m using the User extended to two different tables, Business and User, and I’m doing fully signed up for user.negocio and user.usuario. So…
-
0
votes1
answer413
viewsAutomatic update of the related model through FK - Django
I am trying to use Signal to do a subtraction update on a table based on the value the user selects. an example situation: On the table Materiais I have the pen material with the fields:…
-
0
votes1
answer85
viewsShow specific attribute in Select using Python and Django
In models.py created the following tables: class UsuarioAdicionalPlano(models.Model): quantidade = models.PositiveIntegerField(primary_key=True) preco = models.DecimalField(decimal_places=2,…
-
0
votes1
answer145
viewsChoices values are being stored like this ['Dog', 'Cat', 'Birds']
I have a system that will have the option of choosing 1 or multiple options in the same field. Bad problem is that I need my field inside the model to be charfield and in Forms to be…
-
0
votes0
answers109
viewsProblem with Static files in Django project deploy on Digitalocean
I deployed a project Python and Django in the Digitalocean, but I’m having trouble with static files Inside my project, in the folder static when typing the command pwd to see the full file path, I…
-
0
votes2
answers883
viewsDecimal places in Django template
Good morning, everyone, I’m having a basic problem but apparently boring to solve: {% load l10n %} {% localize off %} var dados_grafico = [ [ 'Entradas',…
-
0
votes1
answer350
viewsUpdate in a specific field in Django 2.0
I have the following Model: class Venda(models.Model): id = models.AutoField(u'AÇAIEX', primary_key=True) hora_saida = models.TimeField(max_length=6) responsavel_frete =…
-
0
votes1
answer55
viewsDjango - Charfield creates Int field in BD
I have a simple project here, with two models that contain an attribute called phone in both. class Medico (models.Model): nome = models.CharField(max_length=50) endereco =…
-
0
votes1
answer415
viewsLoading 2 form on the same page and saving them
I have a system, and I need to change, I want to take the pets option, and put it in a separate table, because it will have more than one type of user that would use it. But I’m not getting it to…
-
0
votes0
answers21
viewsDjango - Upload image is not working
On the site already have some questions related to this, but none of them solved my problem in fact. I have a table in the database with a FK table User, in this table I put my image that would be…
-
0
votes1
answer524
viewsCatch id and name via form, both forenig key
Basically the user enters the company profile and makes a comment and a rating. I need the company ID to be passed on this form and I get the ID or User Name I have a system that uses USER extended…
-
0
votes1
answer285
viewshow to insert object_list inside the select of the form in the Django 2.1 template
how can I insert a list of my database into the select form? html template. <div class="form-group"> <label for="{{ form.id_departamento }}">Nome departamento</label> <select…