diff options
author | Justin Bronn <jbronn@gmail.com> | 2008-08-05 17:15:33 +0000 |
---|---|---|
committer | Justin Bronn <jbronn@gmail.com> | 2008-08-05 17:15:33 +0000 |
commit | aa239e3e5405933af6a29dac3cf587b59a099927 (patch) | |
tree | ea2cbd139c9a8cf84c09e0b2008bff70e05927ef /docs/tutorial02.txt | |
parent | 45b73c9a4685809236f84046cc7ffd32a50db958 (diff) | |
download | django-attic/gis.tar.gz |
gis: Merged revisions 7981-8001,8003-8011,8013-8033,8035-8036,8038-8039,8041-8063,8065-8076,8078-8139,8141-8154,8156-8214 via svnmerge from trunk.archive/attic/gisattic/gis
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@8215 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/tutorial02.txt')
-rw-r--r-- | docs/tutorial02.txt | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/docs/tutorial02.txt b/docs/tutorial02.txt index c69fd1459f..7ed04be643 100644 --- a/docs/tutorial02.txt +++ b/docs/tutorial02.txt @@ -29,12 +29,36 @@ The Django admin site is not activated by default -- it's an opt-in thing. To activate the admin site for your installation, do these three things: * Add ``"django.contrib.admin"`` to your ``INSTALLED_APPS`` setting. + * Run ``python manage.py syncdb``. Since you have added a new application to ``INSTALLED_APPS``, the database tables need to be updated. + * Edit your ``mysite/urls.py`` file and uncomment the lines below the "Uncomment this for admin:" comments. This file is a URLconf; we'll dig into URLconfs in the next tutorial. For now, all you need to know is that - it maps URL roots to applications. + it maps URL roots to applications. In the end, you should have a + ``urls.py`` file that looks like this: + + .. parsed-literal:: + + from django.conf.urls.defaults import * + + # Uncomment the next two lines to enable the admin: + **from django.contrib import admin** + **admin.autodiscover()** + + urlpatterns = patterns('', + # Example: + # (r'^{{ project_name }}/', include('{{ project_name }}.foo.urls')), + + # Uncomment the next line to enable admin documentation: + # (r'^admin/doc/', include('django.contrib.admindocs.urls')), + + # Uncomment the next line for to enable the admin: + **(r'^admin/(.*)', admin.site.root),** + ) + + (The bold lines are the ones that needed to be uncommented.) Start the development server ============================ @@ -192,7 +216,7 @@ aren't commonly used:: class PollAdmin(admin.ModelAdmin): fieldsets = [ (None, {'fields': ['question']}), - ('Date information', {'fields': ['pub_date'], 'classes': 'pub_date'}), + ('Date information', {'fields': ['pub_date'], 'classes': ['collapse']}), ] .. image:: http://media.djangoproject.com/img/doc/tutorial-trunk/admin09.png @@ -242,7 +266,7 @@ registration code to read:: class PollAdmin(admin.ModelAdmin): fieldsets = [ (None, {'fields': ['question']}), - ('Date information', {'fields': ['pub_date'], 'classes': 'pub_date'}), + ('Date information', {'fields': ['pub_date'], 'classes': ['collapse']}), ] inlines = [ChoiceInline] |