作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我收到上述错误,完整的回溯如下:-
ImportError at /login/
No module named views
Request Method: GET
Request URL: abc.com
Django Version: 1.6
Exception Type: ImportError
Exception Value:
No module named views
Exception Location: /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in import_module, line 40
Python Executable: /usr/bin/python
Python Version: 2.7.3
Python Path:
['/home/prajakta/.virtualenvs/cptm_venv/lib/python2.7/site-packages',
'/var/www/cptm/libs',
'/var/www/cptm/apps',
'/var/www/cptm',
'/usr/local/lib/python2.7/dist-packages/setuptools-5.4.1-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/django_ajax_search-1.5.1-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/goose_extractor-1.0.19-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/jieba-0.32-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/cssselect-0.9.1-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/Pillow-2.5.1-py2.7-linux-i686.egg',
'/usr/local/lib/python2.7/dist-packages/oauth2client-1.2-py2.7.egg',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PIL',
'/usr/lib/python2.7/dist-packages/gst-0.10',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.7',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
'/usr/lib/python2.7/dist-packages/ubuntuone-couch',
'/usr/lib/python2.7/dist-packages/ubuntuone-installer',
'/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol',
'/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode',
'/var/www/cptm/~/.virtualenvs/cptm_venv/local/lib/python2.7/site-packages',
'/var/www/cptm',
'/var/www/cptm/cptm',
'/var/www/cptm/apps',
'~/virtualenv/cptm_venv/local/lib/python2.7/django',
'/var/www/cptm/',
'/var/www/',
'/var/www/cptm/',
'/var/www/']
Server time: Mon, 21 Jul 2014 23:29:42 +0530
Error during template rendering
In template /var/www/cptm/templates/user_management/sign_in.html, error at line 64
No module named views
54
55 <body>
56
57 <div id="backgroundPopup"></div>
58 <div class="container">
59
60 {% if form.errors %}
61 <p>Your username and password didn`t match. Please try again.</p>
62 {% endif %}
63
64 <form class="form-signin" method="post" action="{%url 'django.contrib.auth.views.login' %}">
65 {% csrf_token %}
66 <h2 class="form-signin-heading">Please sign in</h2>
67 <input type="text" name="username" class="input-block-level" placeholder="Username">
68 <input type="password" name="password" class="input-block-level" placeholder="Password">
69
70 <input type="hidden" name="next" value="{{next}}"/>
71 <button class="btn btn-large btn-primary" type="submit">Sign in</button>
72 <a href="#" class="forgotpass pull-right" id="forgotpass">Forgot Your Password?</a>
73 </form>
74
最佳答案
如果您没有指定 login_url
参数,您需要确保 settings.LOGIN_URL
和您的登录 View 正确关联。例如,使用默认值,将以下行添加到您的 URLconf:
(r'^accounts/login/$', 'django.contrib.auth.views.login'),
关于python - 我收到异常值 :No module named views in django,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24872369/
我是一名优秀的程序员,十分优秀!