1
我正在自定義django註冊模塊。到目前爲止,我傳遞的URL像Django註冊模塊success_url沒有返回
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
from django.contrib import admin
admin.autodiscover()
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
import registration.backends.default.urls as regUrls
from profile import UserRegistrationForm
from registration.views import register
import regbackend, views
from accounts import profile
urlpatterns = patterns('',
# (r'^conf/admin/(.*)', admin.site.root),
url(r'^register/$', register, {'backend': 'registration.backends.default.DefaultBackend','success_url':profile,'form_class': UserRegistrationForm}, name='registration_register'),
(r'^accounts/', include(regUrls)),
url('^profile/$', direct_to_template, {'template': 'profile.html'}, name="profile"),
)
當URL請求我的錯誤No module named django.views
,它是不會去success_url
。
我想我在做錯了urls.py
但我看不到什麼。請幫助我。
在此先感謝。
請你能更新你的文章,包括你的完整的urls.py? – Alasdair 2012-07-31 09:33:07
另外某種堆棧跟蹤會有所幫助。 – 2012-07-31 10:19:28