Re: user defined settings via the admin

2010-11-18 Thread creecode
Hello garagefan,

On Nov 18, 7:07 am, garagefan  wrote:

> what are our options to grant admin based settings? Obviously a model
> called settings with perhaps it's own admin template to only allow/
> show a single entry into this model/db is possible. But should it
> really warrant an additional database call every time the page is
> loaded to grab the settings(lets ignore caching for the moment)?

Don't discount this method to quickly if you use it with caching.
I've had some success with this technique.  Django's contributed Sites
< http://code.djangoproject.com/browser/django/trunk/django/contrib/sites
> application shows a use case.  Sites is used extensively in many
projects.  From there you can modify the admin for your app to allow
only working with the record that was created at syncdb.  This may not
be needed depending on the skill level of your users.  Modifying the
admin in this manner is not fully covered in the docs.  You will need
to dig around the web and the code for some of the techniques needed
for this type of admin customization.

> How
> about an xml file that is editable by the admin? seems like a valid
> option to have a config.xml associated with a project and to have the
> admin site access to it, i presume a feature like this would require a
> hook into the admin site.

Another technique I've been experimenting with is modifying the
settings.py file for a project from an app then reloading the source
code.  Of course you have to have a stack that is setup to use this
technique for this method to work.  Apache with Graham Dumpleton's
mod_wsgi can reload source code < 
http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode
>.

Toodle-looo
creecode

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



user defined settings via the admin

2010-11-18 Thread garagefan
having an application specific settings.py is a nice idea, in our
world.

In the real world websites seem to be managed by non-technical
people... and ultimately we're not just building these applications
for technologically "gifted" people. Settings should be defined with
the admin for certain things... how many blog items or gallery images
would you like per page? this shouldn't require a call to "IT support"
or granting someone server access to change these settings when they
wish (then call IT support when they screw it up)

what are our options to grant admin based settings? Obviously a model
called settings with perhaps it's own admin template to only allow/
show a single entry into this model/db is possible. But should it
really warrant an additional database call every time the page is
loaded to grab the settings(lets ignore caching for the moment)? How
about an xml file that is editable by the admin? seems like a valid
option to have a config.xml associated with a project and to have the
admin site access to it, i presume a feature like this would require a
hook into the admin site.

any input, ideas, experiences?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.