2012-06-20 1 views
0

파이썬 기본 개발 http 서버를 사용하고 있습니다. 오류는, 현재의 URL은 "http://127.0.0.1:8000 MY 소프트웨어 버전 이후에 이들의 일치하지 않았다 장고 1.4 파이썬 2.6.6파이썬 기본 개발 http 서버, 오류, 현재 URL을 (를) 사용하여 이들 중 어느 것과도 일치하지 않습니다.

내 urls.py 파일 :

from django.conf.urls import patterns, include, url 
#from django.conf.urls.defaults import * 

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

urlpatterns = patterns('', 
    # Examples: 
    # url(r'^$', 'djproject.views.home', name='home'), 
    # url(r'^djproject/', include('djproject.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/', admin.site.urls), 
    url(r'^admin/', admin.site.urls), 
) 

오류 : 순간에 프로젝트에 설치

Page not found (404) 
    Request Method:  GET 
    Request URL: http://127.0.0.1:8000/ 
Using the URLconf defined in djproject.urls, Django tried these URL patterns, in this order: 

    ^admin/ 

The current URL, , didn't match any of these. 

답변

2

유일한 URL은 admin/에 의해 붙 것들이다

목. 가져 오려고하는이 접두어로 시작하지 않습니다.

시도 : http://127.0.0.1:8000/admin/

그냥 장고 함께 시작하는 것 같습니다 : 당신은 아직 튜토리얼을 통해 일한?

+0

thx 작동합니다. 예, 저는 그것에 새로운 것입니다. 지금 튜토리얼 part02를 읽고 있습니다. –

1

당신은 urlpatterns 당신 자체가이 라인 중 주석 "예"절에 보면 :

# url(r'^$', 'djproject.views.home', name='home'), 

기본에 대한 패턴이다. 주석 처리를 제거하고 필요한보기 및 매개 변수를 설정하십시오. 그리고 tutorial을 읽으십시오!

관련 문제