- 错误信息
Non-ASCII character '\xe6'
解决方法:
文件头加入
#coding:utf-8
错误信息
raise AppRegistryNotReady("Models aren't loaded yet.")
解决方法:
安装djanog-registration-reduxpip install django-registration-redux -i http://pypi.douban.com/simple
- 错误信息:
页面错误:
NoReverseMatch at /accounts/login/
Reverse for 'auth_password_reset' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
后台错误:
/home/spang/.virtualenvs/env/local/lib/python2.7/site-packages/django/contrib/sites/models.py:78: RemovedInDjango19Warning: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class Site(models.Model):
解决办法:
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.sites',#添加这一行
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'project',
'operation',
'registration',
'debug_toolbar',
)
如果出现以下问题,/admin无法访问,报
DoesNotExist at /admin/login/
Site matching query does not exist.
错误
解决办法:
application中的admin不要使用以下语句:
from django.contrib import admin
# from project.models import xiangmu
# admin.site.register(xiangmu)