Creting custom "panels" in the settings

22 views
Skip to first unread message

Eduardo Rivas

unread,
Sep 15, 2012, 8:31:34 PM9/15/12
to mezzani...@googlegroups.com
When I register settings in my custom applicattion (in defaults.py), they get aggregated to the "Miscelaneous" panel in the Settings page. Is there a way to create a custom panel, for example, titled "My App" for the settings page?

Stephen McDonald

unread,
Sep 15, 2012, 9:06:02 PM9/15/12
to mezzani...@googlegroups.com
The groupings are defined by the names of the settings, so if you name your settings MYAPP_FOO and MYAPP_BAR, and there is more than one setting with that prefix, it will be grouped the way you want.


On Sun, Sep 16, 2012 at 10:31 AM, Eduardo Rivas <jeriva...@gmail.com> wrote:
When I register settings in my custom applicattion (in defaults.py), they get aggregated to the "Miscelaneous" panel in the Settings page. Is there a way to create a custom panel, for example, titled "My App" for the settings page?



--
Stephen McDonald
http://jupo.org

Eduardo Rivas

unread,
Sep 15, 2012, 9:27:37 PM9/15/12
to mezzani...@googlegroups.com
Excellent, thank you. You should add this piece of info to the docs, along with the usage of the "label" parameter. Another question, is it possible to have a defaults.py for a project, independant of any application? Right now, only those that reside in an installed app folder get picked up.

Stephen McDonald

unread,
Sep 15, 2012, 9:48:56 PM9/15/12
to mezzani...@googlegroups.com
On Sun, Sep 16, 2012 at 11:27 AM, Eduardo Rivas <jeriva...@gmail.com> wrote:
Excellent, thank you. You should add this piece of info to the docs, along with the usage of the "label" parameter.

That's a great idea. Would you consider doing it and sending a pull request?
 
Another question, is it possible to have a defaults.py for a project, independant of any application? Right now, only those that reside in an installed app folder get picked up.

No that's not possible - it follows the same discovery pattern as models.py, admin.py, etc - INSTALLED_APPS is iterated through and they're loaded from there. We could certainly extend it to pick up from the project as well, but I think the consistency here with existing patterns is a good thing.
 

El sábado, 15 de septiembre de 2012 18:31:34 UTC-6, Eduardo Rivas escribió:
When I register settings in my custom applicattion (in defaults.py), they get aggregated to the "Miscelaneous" panel in the Settings page. Is there a way to create a custom panel, for example, titled "My App" for the settings page?
Reply all
Reply to author
Forward
0 new messages