On Thu, Aug 13, 2009 at 9:49 AM, Alexandru-Emil Lupu
<gang.al...@gmail.com>wrote:

> HI!
> the doc is updated for the 1.1 version ..
> try this
>
> urlpatterns = patterns('',
>    (r'^admin/',admin.site.root),
> )
>
> see more here: http://code.djangoproject.com/ticket/10050
>

Indeed, since the Django version shown on the debug page is 1.0.2 this is
the correct url pattern for admin.  However there's something else going
wrong here also.


> On Thu, Aug 13, 2009 at 3:52 PM, quant <
> spielm...@th.physik.uni-frankfurt.de> wrote:
>
>>
>> hi
>>
>> i am pretty new to django and i started to check the docu out to see
>> how it works and i had a problem to get the admin interface working...
>>
>> i followed all the steps from the doco and if i set the options in the
>> urls.py on i got many errors ans nothing work anymore
>>
>> i set the following in the urls.py:
>>
>> from django.conf.urls.defaults import *
>>
>> from django.contrib import admin
>> admin.autodiscover()
>>
>> urlpatterns = patterns('',
>>    (r'^admin/', include(admin.site.urls)),
>> )
>>
>>
What are you trying to get to work here: the basic admin or the admin
documentation?  The url pattern you show is for admin, not the admin docs.
As mentioned above, it is also the wrong pattern for the version of Django
you are running.  But based on the debug info posted, this url pattern
doesn't appear to be what is being used.  If that pattern were used with
Django 1.0.2, you would get an AttributeError: 'AdminSite' object has no
attribute 'urls'.  Instead what is on the dpaste page is a
TemplateDoesNotExist for admin_doc/missing_docutils.html.  The only way I
can recreate that is if I take the admindoc url pattern:

    (r'^admin/doc/', include('django.contrib.admindocs.urls')),

and remove the trailing doc/ part.  Did you do that?


>>
>> and i got the following error, if i tryed to start the
>> http://127.0.0.1:8000/admin/
>> page
>>
>> http://dpaste.com/79236/
>>
>
The TemplateDoesNotExist error is because you have not included
'django.contrib.admindocs' in your INSTALLED_APPS in settings.py.  But the
fact that the url /admin/ is being routed to an admin docs view would seem
to indicate you've got something misconfigured in your urlpatterns also, as
noted above.  What you should have in your urlpatterns, if you want to use
admindocs and admin on Django 1.0.2, is:

    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
    (r'^admin/(.*)', admin.site.root),

Then when you go to /admin/ you will get the main admin page.  In the upper
right there will be a "Documentation" link, and when you click there (after
putting django.contrib.admindocs in your INSTALLED_APPS) you will likely
(based on the template that admindocs is trying to render) get a message
that you need to install Python's docutils library before you can use Django
admin docs.

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to