Questions tagged [django-admin]

Django's built-in, automatic admin interface (django.contrib.admin) which is part of the Django Web framework for the Python programming language.

One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site. The admin’s recommended use is limited to an organization’s internal management tool. It’s not intended for building your entire front end around.

-- Django Admin Documentation

Resources:

10185 questions
4
votes
4 answers

How Do I Show Django Admin Change List View of foreign key children?

I'm working on an app with a Model hierarchy of Campaign > Category > Account. Ideally, I'd like users to be able to click on a link in the campaign admin list view and go to a URL like "/admin/myapp/campaign/2/accounts/" which will show a Django…
Hari Honor
  • 8,677
  • 8
  • 51
  • 54
4
votes
1 answer

Django Migration from 2.0 to 2.2(View Permissions Issue)

While Migrating the Django Facing issue related to migration : python manage.py migrate demo --database demo Getting Error related to : ValueError: Cannot assign "ContentType: ContentType object (1)": the current database router prevents this…
4
votes
1 answer

Django : How to send notification to admin on a specific user activity?

I'm building a website that needs sending a notification to the admin when a request for help happens, It doesn't need to be literally a notification, it may b email in the admin panel or so, Thanks ^^
4
votes
1 answer

Add staff user permissions in admin with custom user model

There are a number of questions about this, but they all seem slightly different to what I need. I have a custom user model in my core app in models.py in django: from django.db import models from django.contrib.auth.models import * from…
Davtho1983
  • 3,827
  • 8
  • 54
  • 105
4
votes
3 answers

Django Admin - prevent save under certain conditions and display message to user

I am putting together a Django app - created and registered the models and model forms. When adding or editing a particular model record, I need to call an external service for some information. If the information is retrieved successfully I want to…
solo1977
  • 355
  • 3
  • 14
4
votes
2 answers

Using object's id in change_form_object_tools.html template

I have two buttons that appointing to different paths. And i want to pass the object.id with parameter. my urls urlpatterns = [ path('', admin.site.urls, name ='home'), path('dpo/imprimir/aprovado//',Aprovado, name ='aprovado'), …
Pedro Mariz
  • 151
  • 2
  • 20
4
votes
1 answer

How do create url to django Admin within my user page (HTML)

I'm new to coding, I'm trying to create URL link in NavBar to redirect my Django Admin exmple: Admin site However, Django do find; No-Reverse-Match, It works for other URL links Things I had to…
Fool Baby
  • 178
  • 2
  • 10
4
votes
1 answer

Search field on generic foreign key field

I am trying to add a search field to the Django admin model CreditsAdmin that will allow me to search the email of related customer objects. The Customer object has a generic foreign key to many different typed of object all of which have an…
4
votes
5 answers

Django Admin: add inlines dynamically

class MyTemplateAdmin(admin.ModelAdmin): list_display = ('name') search_fields = ['name'] inlines = [ Template1Inline, Template2Inline, Template3Inline, ] This works fine. But what I need is to make it dynamic. Whenever the admin adds a…
Saikat
  • 2,613
  • 1
  • 22
  • 14
4
votes
0 answers

Django inline form validation based on sibling records

I have Admin model which has inline model with its form e.g class ParentAdmin(admin.Model): inlines = (ChildInline,) class ChildInline(admin.TabularInline): .. form = ChildInlineForm .. class ChildInlineForm(forms.ModelForm): def…
sakhunzai
  • 13,900
  • 23
  • 98
  • 159
4
votes
1 answer

django admin override filter_horizontal

I'm aiming to make an "advanced" filter_horizontal, one with more filters, but I can't seem to find the widget to override. I know it uses the related_widget_wrapper.html, but if I want to add functionalities to it in a clear way, what is the widget…
Dany Y
  • 6,833
  • 6
  • 46
  • 83
4
votes
1 answer

django autocomplete_fields doesn't work in TabularInline (but works in StackedInline)

I'm trying to use autocomplete-fields in TabularInine Below my code : class PersonInstitutionsInline(admin.TabularInline): autocomplete_fields = ['institution'] model = PersonInstitution extra = 0 When rendering the dropdown is simply…
Dany Y
  • 6,833
  • 6
  • 46
  • 83
4
votes
2 answers

Django - Admin - How to override change_list template for Model Proxy?

I made a simple Django app. I have one model "Visitor". My goal is to have two tables appear in the Django admin. One with all of the visitors and one with only those for today. I got everything working with the code below by following these…
Greg
  • 45,306
  • 89
  • 231
  • 297
4
votes
1 answer

Paginator for TabularInline models in Django admin

I checked this Paginator for inline models in django admin question but none of answers doesnt work for me. I use django 1.11 . Are there any other solution?
4
votes
3 answers

Django - Difference between admin save_model() and post_save signal

For my application I need to do extra operations when a model is saved via form. In practice, I need to add a value in another model if certain conditions are present in the form. To do this I have two options, but I want to understand the pros and…
max
  • 366
  • 5
  • 18
1 2 3
99
100