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
5
votes
3 answers

Model field not displaying in Django Admin

I have a Django project hosted on heroku I added a new slug field to model from django.db import models class Category(models.Model): name = models.CharField(max_length=30) slug = models.SlugField(unique=True) def __unicode__(self): …
zephyr
  • 1,775
  • 6
  • 20
  • 31
5
votes
1 answer

Django admin: Format fields in list, but keep sortable?

I keep numeric fields like "size", "width", "height" in my database. Now I would attach units like "KiB" or "pixels" to them when showing them in the change list. This could easily be achieved by adding callables such as "size_formatted" etc to…
Sam
  • 491
  • 1
  • 4
  • 16
5
votes
2 answers

Django Inline Model Admin filter Foreign Field

I have a following problem. I have 3 models: class Deal(models.Model): name = models.CharField(max_length=80) class Site(models.Model): name = models.CharField(max_length=80) deal = models.ForeignKey(Deal) class Picture(models.Model): …
Byteme
  • 589
  • 2
  • 6
  • 10
5
votes
1 answer

How do I add a custom button next to a field in Django admin?

I have a Client model, which includes a field for a client API key. When adding a new client in Django Admin, I'd like to have a button next to the API field to generate a new key (i have the method for this). The field will then be updated with…
greenafrican
  • 2,516
  • 5
  • 27
  • 38
5
votes
4 answers

Django, how to generate an admin panel without models?

I'm building a rather large project, that basically consists of this: Server 1: Ice based services. Glacier2 for session handling. Firewall allowing access to Glacier2. Server 2: Web interface (read, public) for Ice services via Glacier2. …
user168833
  • 167
  • 2
  • 8
5
votes
1 answer

Column/field level permissions in Django admin site?

Is it possible to implement column level permissions per user in the Django admin site? Its a small project and I only need two groups of permissions. In the docs I cant find anything out of the box however I was wondering if its possible to create…
ccnet
  • 53
  • 3
5
votes
1 answer

How to create a Django custom Field to store MYSQL DATETIME(6) and enable fractional seconds (milliseconds and or microseconds) in Django/MySQL?

MySQL 5.6.4 and up expands fractional seconds support for TIME, DATETIME, and TIMESTAMP values, with up to microseconds (6 digits) precision: http://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html Django 1.5 and up supports fractional…
allcaps
  • 10,945
  • 1
  • 33
  • 54
5
votes
2 answers

django-admin.py can't find custom settings file

I have several customized django settings, this is basically my project structure: MainProject/ manage.py my_project/ settings/ base.py dev.py prod.py I've created the __init__.py files inside the directories to identify…
Leonardo
  • 4,046
  • 5
  • 44
  • 85
5
votes
1 answer

How can I get the grappelli autocomplete widget to work in place of a ModelMultipleChoiceField (in the one-to-many direction)?

Using the Django Grappelli admin tools, I can configure a ForeignKey (many-to-one) field to display as an autocomplete widget, rather than a drop down field, as follows: class MyModel(models.Model): related = models.ForeignKey(RelatedModel,…
Troy
  • 21,172
  • 20
  • 74
  • 103
5
votes
2 answers

Django Admin - Re-authentication?

I'm in a bit of a dilemma at the moment regarding Django's admin backend. The default authentication system allows already logged-in users that have staff privileges to access the admin site, however it just lets them straight in. This doesn't feel…
user212081
5
votes
1 answer

Django Admin: show single instance of duplicate instances

I'm trying to show a single instance (db row) from a model where several instances share the same field (column) value for several rows. To clarify that statement,I have the following situation: ID/Title/Slug/Modified 1 Car A 1s ago 2 Car …
user772401
  • 2,754
  • 3
  • 31
  • 50
5
votes
2 answers

post_save signal and relations

I am applying the post_save signal to apply user rights per object, and then filter the queryset accordingly. My model is like this: class Project(models.Model): # Relations with other entities. employees =…
sogeking
  • 1,216
  • 2
  • 14
  • 45
5
votes
2 answers

Django Multiple Authentication Backends Based On Status

I was wondering how to tell Django which authentication backend to use based on if the user is marked as staff or if they are not. Can this be done?
5
votes
1 answer

Django admin: use one-to-one relationship in search_fields

I am trying to to add a search to my model admin list page using the following Model and ModelAdmin classes: models.py from django.contrib.auth.models import User class UserProfile(models.Model): user = models.OneToOneField(User) …
Ryu_hayabusa
  • 3,666
  • 2
  • 29
  • 32
5
votes
3 answers

Filter a User list using a UserProfile field in Django Admin

I'm trying to filter the User list in Django using a UserProfile Field... I need to implement a queue system where new users are put in a queue until an Admin approves them. I simply added a is_in_queue boolean field to my UserProfile model...…
jeannicolas
  • 3,139
  • 4
  • 24
  • 25