'리스트에'이라는 하나의 앱이있는 간단한 장고 설치가 있습니다. 나는 지금이 응용 프로그램을 표시 http://127.0.0.1:8000/lists
싶습니다. 그래서 나는 다음에 내 주요 urls.py를 변경 :django가 작동하도록 URL을 가져올 수 없습니다.
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^lists/', include('lists.urls')),
url(r'^admin/', include(admin.site.urls)),
)
그리고 난 다음에 (내 응용 프로그램은 목록이라고합니다) 목록 폴더에있는 urls.py 변경 :
from django.conf.urls import patterns, url
from lists import views
urlpatterns = patterns(
url(r'^$', views.index, name='index')
)
을
는 지금까지 내가 완벽하게 잘 the django tutorial의 지침에 따라 오전 알고,하지만 난 (슬래쉬없이 ) http://127.0.0.1:8000/lists
를 방문 할 때 그것은 나에게 다음과 같은 오류 제공 :
Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/lists
Using the URLconf defined in companyLists.urls, Django tried these URL patterns, in this order:
^lists/
^admin/
The current URL, lists, didn't match any of these.
을
나는 그것이 나에게 다음과 같은 오류 제공 ( 후행 슬래시 ) http://127.0.0.1:8000/lists/
를 방문 할 때 :
Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/lists/
Using the URLconf defined in companyLists.urls, Django tried these URL patterns, in this order:
^admin/
The current URL, lists/, didn't match any of these.
을은^목록을 검색하지 않는 이유는 URL을 방문 할 때 나는/더 이상 이해하지 못하는 뒤에 슬래시가 붙었다. 아무도 내가 여기서 뭘 잘못하고 있는지 알아?
모든 도움말을 환영합니다!
아, 나는 그것을 간과했다. 그것은 정말로 효과가있다! 하지만 가장 중요한 것은; 왜? 처음에는 빈 문자열이 필요한 이유는 무엇입니까? – kramer65
지금 내 대답이 업데이트되었습니다 @ kramer65 - 희망을 명확히합니다. – Ewan