Search This Blog

Monday, September 21, 2009

Django, Admin Interface

add 'django.contrib.admin to INSTALLED_APPS in

run python syncdb (because you've installed a new application to update the db)

in the, uncomment the lines for admin, and uncomment the url pattern for admin

then you can go to /admin/ and log in

To tell the admin to use your model, create an in your my_model directory
from mysite.my_model.models import your_model_method
from django.contrib import admin

Then restart your server.

You can customize your model with your "to string" like method. In your under your model,

class ideaAdmin(admin.ModelAdmin):
list_display = ('title', 'description'), ideaAdmin)

you can easily change the "django" in the admin interface. just make an "admin" directory in your "template" directory,
and then copy the base_site.html from django/contrib/admin/templates/admin to your admin directory.

read more:

No comments: