Most voted "django-admin" questions
40 questions
Sort by count of
-
4
votes1
answer888
viewsRegister different types of users in Django admin
I have three types of users: Manager, Teacher and Student. All of them need to log into the system, but the teacher and student have some more information. The manager who creates access for the…
-
2
votes1
answer781
viewsUpload and view PDF’s Django admin
I wanted to ask a question, I am trying to upload a PDF file, on Jango, and I wanted to know if you like I view this pdf, I have the following code: py.models class Edital(models.Model): # ... class…
-
2
votes1
answer906
viewsCustomize Django Admin
I have two classes, one is Division and the other is Group. In the group I have FK for division. I want to register a Storage in the Django Admin and in the Group select I want the group and…
-
2
votes0
answers136
viewsDjango admin using the request attributes
I am developing an application in Django and I used the request data on form to validate some fields. For example, if the user is changing the form for the "Administrator" group, when changing the…
-
1
votes1
answer491
viewsHow to add fields dynamically in Django?
I would like to add fields dynamically in Djangoadmin. File models.py: class Book(models.Model): title = models.CharField(max_length=100) def __str__(self): return self.title class…
-
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
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
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
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
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
votes0
answers242
viewsDjango Admin football game registration
Help me please. I’m learning Django. I have a website that registers games from my hometown. It follows example to understand doubt: Championship: Vacation 2017 Has 2 groups (Group 1 and Group 2) I…
-
1
votes2
answers666
viewsGet the user logged in to Django Admin
Good morning, you guys. I have a small application made entirely in Django Admin and I need to get the user logged in to make a specific query listing registered customers and and other models by…
-
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 5 years, 5 months ago Alison Andrade 52 -
1
votes1
answer110
viewsHow to pull a Foreignkey from the models on Django?
Hello I am developing an application and I have a problem, if someone knows how to solve. I created the following models: class Cliente(models.Model): user = models.OneToOneField(User,…
-
1
votes0
answers14
viewsHow to change field location in Django?
When we register our models on admin.py from Django they are shown as follows:: @admin.register(Beneficio) class BeneficioAdmin(admin.ModelAdmin): list_display = ('nome', 'situacao') They will be…
-
1
votes0
answers16
viewsHow to view and define values for a model using the Django template
Django has HTML files that we can override, one of them is called app_list.html, which has the following code: {% if app_list %} {% for app in app_list %} <div class="app-{{ app.app_label }}…
-
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
votes1
answer713
viewsCustom Admin Django
I’m trying to change the login screen to a new custom screen, but it’s not working. https://github.com/rg3915/custom-admin I set up the Settings: 'DIRS': [os.path.join(BASE_DIR, 'templates_admin')],…
-
0
votes1
answer709
viewsDjango-admin.py execution error on Django 1.9
I am trying to learn Jango and would like to understand this notification I get every time I run the Django-admin command! Note that only Django core Commands are Listed as Settings are not properly…
-
0
votes1
answer201
viewsDjango-admin startproject command does not create the Manage.py file
After running the Django-admin startproject command the Manage.py file is not created. I’m using python 2.7.12 I tested with versions of Django-1.4.3 and Django 1.5.1.…
-
0
votes2
answers783
viewsSet the User logged in to the model as default | Django + Python3
I am trying to learn Django, and with this I am trying to create a simple system of tickets. I have made a lot of progress in my studies, but now I’ve tackled the following problem. How to do by…
-
0
votes1
answer123
viewsUnidentified session in some logins on Django
I am doing a maintenance on a Django app version 1.5 with DRF 2.3. This app features off-the-shelf user authentication that works well. See a summary below: Accounts/views.py class…
python django python-2.7 django-admin django-rest-frameworkasked 7 years, 3 months ago Kaio Cesar 305 -
0
votes2
answers997
viewsfilter list in Django admin Foreign key field
I have two questions, both related to the form generated automatically by the Django admin. If I create an administrative screen I know how to solve these problems, but working directly with the…
-
0
votes1
answer895
viewsUpload photo with model name in Django
I would like help for a task to save images with a custom name and a folder also with the current name, suppose the following Model: class ProdutoA(models.Model): nome_produto_a =…
-
0
votes1
answer351
viewsHow to Put Value in the Django Will HTML Field?
Hello, I’m starting with Django now and wanted to know how to pass the value of the database to a Djando field using HTML to save the edit. Na minha View: @login_required def editar_aluno(request,…
-
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
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
answer54
viewsDjango - How to present last value registered in the database in a registration screen
I’m young, and I’m still facing difficulties that might seem pretty simple to you. I decided for personal reasons to make an application in Django. It is a simple registration of people in a Mysql…
-
0
votes0
answers19
viewsCustomizing the Django Admin Change Log
all right? I am setting up a system to register accesses and users and need to improve the log list of Admin, so that it presents more information as the value changed and not only which fields were…
-
0
votes0
answers18
viewsHow to change inlines according to an option in Django admin
Currently I have the following code: @admin.register(Experiencia) class ExperienciaAdmin(admin.ModelAdmin): list_display = ('tipo', 'data_inicio', 'data_fim') inlines = [AcademicoInline,…
-
0
votes0
answers13
viewsHow to show additional options after filling a Selection box in Django Admin
When trying to register in Django Admin I have three fields to fill out being them tipo_remuneracao valor and valor_max, however depending on the type of compensation I may need to show value and…
-
0
votes1
answer34
viewsHow to format money fields in Django?
I have a field in my admin Django that receives a real value, but I would like that value to be formatted and not receive more than two decimal places. I tried using a javascript to modify the…
-
0
votes1
answer15
viewsHow to put the validation rule only when saving and not validating in the update in Django admin with python?
I am developing in Django the following application of course management, in the register of a class I have a registration informing the amount of vacancies for doctors and academics, and in the…
-
0
votes2
answers45
viewsDjango - No module named 'polls'
Hello, I’m starting to study Django (current version: 3.2.5), and I followed this article in an attempt to configure it (version consulted on 07/29/2021):…
-
-1
votes2
answers249
viewsDashboards of users logged in using Django admin user
Good Morning I am using Django’s standard user model, and I would like to have a Dashboard of logged in users, to check who is using the system, know me inform if Django has this information? I…
-
-1
votes1
answer58
viewsif and Is between loan
Thus, I created a user table and a business, both inherit from the Django user table. Perfect, both your users and tables. But I have a menu and a profile page.html and wanted that in this menu…
-
-1
votes2
answers107
viewsHow to filter choices from a field based on choices from another form field in Django?
In Django Admin I have a model who has two fields: Unidade and Localizacao. Where Unidade has a ManyToManyField for Localizacao, as follows below class Unidade(models.): nome =…
javascript python django django-templates django-adminasked 3 years, 9 months ago Leonardo Furtado 144 -
-1
votes1
answer31
viewsHow to filter form options by foreign key? - Django Admin
I need to show only objects that have the same foreign key company in Django in the admin view. What I got was to show only the related objects using get_queryset, but in the form fields appear all…
-
-1
votes0
answers19
viewsReturn student name in query along with matricula - python and Django admin
Base Class: class Base(models.Model): IncPor = models.IntegerField('Incluido Por', null=True, blank=True) AltPor = models.IntegerField('Alterado Por', null=True, blank=True) IncEm =…
-
-2
votes1
answer62
viewsWhere should the mediafiles directory be in the Django configuration to be able to download the files on the Heroku server (free app)?
After uploading the file for hours I can download the files, but after a while I can not download the files, saying that the file does not exist, only when I consult the database and the table by…