views:

41

answers:

2

Does anyone have experience (Django 1.x pref 1.3) with implementing a sort of singleton accessible from the admin page to expose some global variables for editing (site name, keywords, ...). I cant find anything like this and it sounds quite unbelievable!

thanks

(django-preferences is broken with 1.x)

A: 

As lazerscience says, you probably want Django-dbsettings. I have a fork at Github that works with the latest Django versions.

Daniel Roseman
A: 

after some playing I had dbsettings working... but with a few glitches: - Aptana doesnt recognise the import preferences as a valid reference - when I access my /settings/ page with the fields of the model I created and then save it I have a CSRF token missing or incorrect. error

NOTE: The official googlecode repository doesnt work (with 1.3), Daniel's version does instead (I guess he changed newforms -> forms etc). The way I created a new model for the settings veiw is:

from django.db import models
import dbsettings

class ImageLimits(dbsettings.Group):
        maximum_width = dbsettings.PositiveIntegerValue()
        maximum_height = dbsettings.PositiveIntegerValue()
options = ImageLimits()
mαττjαĸøb