On Sat, Oct 6, 2012 at 10:24 AM, Dae_James <daeda...@126.com> wrote: > My urls is: > 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'^$', 'test6.views.home', name='home'), > # url(r'^test6/', include('test6.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)), > ) > This looks ok. Try typing in a nonsense url like http://localhost:8000/hi
It won't match anything, but it will list the available urls that you have. This may give you a clue as to what is going wrong > Just uncommented three sentences. > > On Friday, October 5, 2012 8:35:15 PM UTC+8, Tom Evans wrote: >> >> On Fri, Oct 5, 2012 at 9:18 AM, Dae_James <daed...@126.com> wrote: >> > I created a new django project and did the following three things: >> > 1, Uncomment "django.contrib.admin" in the INSTALLED_APPS setting. >> > 2, Run python manage.py syncdb. Since you have added a new application >> > to >> > INSTALLED_APPS, the database tables need to be updated. >> > 3, Edit your mysite/urls.py file and uncomment the lines that reference >> > the >> > admin – there are three lines in total to uncomment. >> > >> > And then typed in "python manage.py runserver" to start server. >> > >> > After all this, when I visit http://127.0.0.1:8000/admin/ , welcome site >> > displayed instead of the admin site. >> > What's the matter, please ? I'm a new hand to django. >> > >> >> Can you show your urls? I expect the one for 'welcome site' matches >> the url for the admin site before the admin url is tested, and so is >> routed there instead. >> >> Cheers >> >> Tom > -- Joel Goldstick -- 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.