views:

76

answers:

3

Hi, I would like to create a configuration panel for the homepage of the web-app I'm designing with Django. This configuration panel should let me choose some basic options like highlighting some news, setting a showcase banner, and so on. Basically I don't need an app with different rows, but just a panel page with some configuration options. The automatically generated administration area created by Django doesn't seem to handle this feature as far as I can see, so I'm asking you for some directions. Any hint is highly appreciated. Thank you in advance.

Matteo

A: 

The automatically generated administration area created by Django is for data maintenance.
It provides forms to edit data in your models.

If it doesn't "handle this feature", then it sounds like your "configuration panel" (configuration panel should let me choose some basic options like highlighting some news, setting a showcase banner, and so on) does not have any data model.

If you define a model with basic options like highlighting some news, setting a showcase banner, and so on then the Django admin will update rows in the model. You can then use the model data to configure your application.

If -- for some reason -- you don't want to put this in the database, then there will never be an automatically generated administration area created by Django.

S.Lott
I think the OP is asking for something like the Wordpress "news" section that shows up whenever you log in to a wordpress backend. What you're suggesting sounds like administration for a model.
Goose Bumper
@Goose Bumper. The Django admin is database CRUD transactions. If this "Wordpress "news" section" or "configuration panel" can be mapped to database tables and CRUD rules, then the Django admin does that automatically. If this "Wordpress "news" section" or "configuration panel" does not map to database tables and CRUD rules then the admin cannot do it. It's pretty simple: Django Admin == Automatic CRUD Processing. Nothing more.
S.Lott
@S.Lott: I'm still not sure you understand the OP's question. Take a look at this: http://www.premium-hosting-24.de/wp-content/uploads/2008/02/wordpress-backend-vorher.pngThat's what he's trying to accomplish. Of course the Django admin does CRUD processing already. He's trying to add new things.
Goose Bumper
@Goose Bumper: I'm still not sure you understand the Django admin. If it's not CRUD rules, Django admin doesn't do it as "automatically generated administration area". The Django Admin is not a "site builder" or something else. The Django Admin is CRUD processing. If the OP doesn't want CRUD processing, but what's something more or different it won't be "automatically generated administration area".
S.Lott
+1  A: 

The admin area of Django features views and templates just like the rest of your Django site, so it's just a matter of customizing the relevant files.

This should be a helpful read for you.

In particular, the method that renders the index page can be found in django/contrib/admin/sites.py, and the actual index page can be found in django/contrib/admin/templates/admin. Instead of modifying these directly, you should make copies as the above link explains.

From there it's just a matter of writing the relevant code to display the news section. You can make the news another app if you want, or you can even get the data from another website using XML or something else of your choice.

Goose Bumper
Thank you Goose Bumper. I'd like to create a HomePage-config section in the Admin to let the users manage the content they already put elsewhere, as well as providing some brand new content for the homepage. It seems I have to create a custom admin-app, some custom views and templates.Thank you, I'll give a read to the doc you gave me.
Matteo
+1  A: 

it isnt eaxctly what you are looking for, but you might also be interested in something like django-admin-tools!

lazerscience