0
我有一個網址,配置的問題我Django項目,在我的根URL的配置我有這樣的:Django中找不到網頁(404)的錯誤與URL配置
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', include('main.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^profile/', include('accounts.urls')),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += staticfiles_urlpatterns()
在我的應用程序網址的配置,我有這樣的:
from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^$', 'main.view.home', name='main_home'),
url(r'^integrations/$', 'main.view.integrations', name='main_integrations'),
)
但是,當我去渲染這個網址http://127.0.0.1:8000/integrations/我得到一個錯誤404未找到。
謝謝你的答案。
什麼是您的應用程序的名稱?主要?可以顯示視圖代碼? –