Django admin site: how to create a single page for global settings?

I would like to create a single page in the django admin site where I can change some global website variables (website name, items in the navigation menu, etc.). At the moment, I encoded them as context processors, but I would like to make them editable. Something similar to what is happening in WordPress.

Is it possible?

  • I can store data in a database, but can I have a link on the administrator’s site that goes directly to the first record of the document and does not allow creating several records (they do not make sense).
  • Instead of creating a model in the database, one could change some context_processor from the admin site (I think it would be better)
+5
source share
3 answers

django-preferences does exactly what you are looking for. The implementation is a bit hacky (especially setting up __module__in the model class to trick Django into thinking that it was loaded from another application), but it works.

+3
source

There is an application called django-values , which allows you to save certain settings in the database.

+2
source

, .

http://docs.djangoproject.com/en/dev/ref/contrib/sites/

" - " " , Django".

The docs make it look like it's only good for a few sites, but it's a great place to put things in a single site model on django.

+1
source

All Articles