It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center




7年前关闭。





我正在尝试让django注册并在Eclipse上的新手安装程序上运行。

我看到django在随附的django.contrib.auth应用程序中具有许多帮助程序视图来处理登录,注销,注册等操作。我按照the docs中的说明包含了auth网址,但登录仍然无法正常进行。当运行本地服务器并点击/accounts/login/端点时,它会发现那里有一个端点,但TemplateDoesNotExist错误。

我试图弄清楚为什么内置的登录视图不起作用。请参阅以下错误:

在/ accounts / login /下的TemplateDoesNotExist

registration / login.html

请求方法:GET
请求网址:http:// localhost:8000 / accounts / login /
Django版本:1.2.4
异常类型:TemplateDoesNotExist
异常值:registration / login.html

异常位置:find_template,第138行中的C:\ Python25 \ lib \ site-packages \ django \ template \ loader.py
Python可执行文件:C:\ Python25 \ python.exe
Python版本:2.5.4
Python路径:[
'C:\\ dd \\ ddproject \\ src',
'C:\\ dd \\ ddproject \\ src',
'C:\\ Python25 \\ Lib \\ site-packages \\ django',
'C:\\ Python25 \\ Lib \\ site-packages \\ django \\ contrib',
'C:\\ Python25 \\ Lib \\ site-packages \\ django \\ contrib \\ admin',
'C:\\ Python25 \\ Lib \\ site-packages \\ django \\ db',
'C:\\ Python25 \\ Lib \\ site-packages \\ Django-1.2.4-py2.5.egg-info',
'C:\\ Python25 \\ Lib \\ site-packages \\ django \\ contrib \\ auth',
'C:\\ Python25 \\ Lib \\ site-packages \\ django_registration-0.7-py2.5.egg',
'C:\\ Python25 \\ Lib \\ site-packages \\ django_registration-0.7-py2.5.egg \\ registration',
'C:\\ Python25',
'C:\\ Python25 \\ DLLs',
'C:\\ Python25 \\ lib',
'C:\\ Python25 \\ lib \\ lib-tk',
'C:\\ Python25 \\ lib \\ plat-win',
'C:\\ Python25 \\ lib \\ site-packages',
'C:\\ Python25 \\ lib \\ site-packages \\ PIL',
'C:\\ WINDOWS \\ system32 \\ python25.zip'
]

最佳答案

如果您使用的是django-registration,则必须自己创建注册模板。默认情况下,应将它们设置为/ accounts /的url路径内。

08-06 05:19