Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#20324 closed Bug (invalid)

Had to modify the urls.py to get the admin interface up

Reported by: dwisehart@… Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Here is what my urls.py had in it:

from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'bidding.views.home', name='home'),
    # url(r'^bidding/', include('bidding.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
)

I uncommented a few lines and then the admin interface started to work:

from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'bidding.views.home', name='home'),
    # url(r'^bidding/', include('bidding.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)

Change History (5)

comment:1 by Aymeric Augustin, 11 years ago

Resolution: worksforme
Status: newclosed

I don't understand the problem you're reporting; that's the expected behavior.

comment:2 by anonymous, 11 years ago

Resolution: worksforme
Status: closednew

As I follow through the tutorial, I get to the top of part 2 and it says I should see the admin login, but I did not. I went back to part 1 and did everything it asked a second time but still I did not see the admin login. I thought maybe I had done something wrong. Then I noticed the default pages said something about I had not set up in URLs, so I dug into the existing url.py file and guessed that the only thing I had to do was uncomment the lines I did. Thankfully that was all I was missing.

Does that help? I followed the tutorial but did not get the admin login until I took steps not listed in the tutorial.

Thanks,
Daniel

comment:3 by Aymeric Augustin, 11 years ago

Resolution: invalid
Status: newclosed

You're probably following the tutorial for the in-development version (future 1.6) while using Django 1.5 or earlier.

Make sure you're reading the documentation for the version of Django you're using. There's a version switcher at the bottom right corner of every page.

comment:4 by anonymous, 11 years ago

OK, that solved it. Thank you.

You might consider editing this sentence at the top of the document: "If the Django version doesn’t match, you can refer to the tutorial for your version of Django or update Django to the newest version." I read it but I had no idea where to go get the tutorial for my version of Django.

If instead you wrote: "If the Django version doesn’t match, you can refer to the tutorial for your version of Django by using the version switcher at the bottom right corner of this page or by updating Django to the newest version." or something like that I would never have been confused.

comment:5 by Aymeric Augustin <aymeric.augustin@…>, 11 years ago

In f7f69cf7dd2730f3cf07f8dc71fc60b6c15bbf64:

Pointed to the docs version switcher in tutorial 1.

Refs #20324. Thanks dwisehart for the suggestion.

Note: See TracTickets for help on using tickets.
Back to Top