Posts by Rodrigo Pereira • 114 points
9 posts
-
1
votes2
answers666
viewsA: Get the user logged in to Django Admin
Hello Alison, Your question is very broad, but let’s see if I can help you: Django Admin comes with several tools disabled, you will have to enable them as you need. The command you need will be for…
-
0
votes1
answer130
viewsA: Insert Alternatives into a Model in Django
Hello, To do what you would like to use, you should models.py the modelchoicefield , and use the mode of choice with alternatives in the forms.py and thus use if if the letter is correct and a else…
-
1
votes2
answers1851
viewsA: How to assign a function to a button in Django Python
Hello, Voce uses the POST method and so Django recognizes HTML by the attribute name <form method = 'POST'> {% csrf_token %} <label for="word">Digite uma palavra:</label> <input…
-
1
votes1
answer474
viewsA: Error executing login() 'Anonymoususer' Object has in attribute '_meta'
Hello Try to remove the request , This could be the possible mistake. user = authenticate(cnpj=cnpj, senha=senha) And to redirect to another page in case of success from django.http import…
-
1
votes1
answer671
viewsA: How to create a user with Abstractbaseuser or Abstractuser. (Login errors)
Ola, Try to do makemigrations and migrate placing the name of the APP python manage.py makemigrations NOMEDOAPLICATIVO python manage.py migrate NOMEDOAPLICATIVO This could be the ERROR, it is not…
-
0
votes2
answers987
viewsA: How to use one Model Class values in another in Django?
Hello, From what I understand, you’ll have to make one forloop more or less thus : Note: The code is not correct class Ingrediente() # a classe custoTotal = 0 for i in Ingrediente # voce chama a…
-
0
votes1
answer48
viewsA: Saving relationships using the Django Rest Framework
Ola, First ,The problem may possibly be the database, do the shell commands again: python manage.py makemigrations and then and python manage.py migrate See if changes appeared. Second, the other…
-
1
votes1
answer418
viewsA: Personalized login in Django, what is the best way to improve?
From what I understand, you want to do a Custom Login, so you will have to study "Abstractbaseuser". And for logout it’s simple: 1.Use these commands in views.py 2.There are libraries for Logout and…
-
1
votes2
answers510
viewsA: Display the value of a Manytomany Django object in the template?
According to the image, the variable "ingredients" is empty, Django’s default is to start the variable "None"(empty), so the problem should be at the beginning. Must be a little typo. You are using…
djangoanswered Rodrigo Pereira 114