您好,提前谢谢您,
当我安装 django-profiles 和 django-registration 时。我相信我正确地遵循了有关如何配置它们的教程:
http://agiliq.com/books/djenofdjango/chapter5.html#reusable-apps
现在,当我尝试访问 website.com/accounts 时,我得到一个 404 页面:
使用 acme_p.urls 中定义的 URLconf,Django 按以下顺序尝试了这些 URL 模式:
^$
^accounts/
^admin/doc/
^admin/
当前的 URL、帐户与其中任何一个都不匹配。
我的网址文件如下所示:
#acme_p urls - Django Project
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', include('user_prof.urls')),
# Examples:
# url(r'^$', 'acme_p.views.home', name='home'),
# url(r'^acme_p/', include('acme_p.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)),
)
user_prof urls.py - Django App 比上述项目低一级
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^login/$', 'auth.views.login_user'),
(r'^accounts/', include('registration.urls')),
# (r'^accounts/', include('registration.backends.default.urls')),
)
谢谢你的帮助。
dp