标签:could not admin round result single define 信息 views doc
Last Update : 10/30/2016 16时48分
Class-based views API reference. For introductory material, see the Class-based views topic guide.
Detailed form API reference. For introductory material, see the Working with forms topic guide.
https://github.com/django/django/blob/master/django/forms/forms.py
Startproject
Startapp
Configuration
url & view
http://www.douban.com/group/topic/42158933/
https://docs.djangoproject.com/en/1.4/topics/generic-views-migration/
https://github.com/disqus/django-mailviews/commit/31d6832128a591607796cfee32a30ce58919ca01#diff-1
https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#howto-custom-template-tags
https://docs.djangoproject.com/en/dev/ref/contrib/csrf/
https://docs.djangoproject.com/en/1.2/howto/static-files/
https://docs.djangoproject.com/en/1.2/topics/http/file-uploads/
http://www.douban.com/group/topic/21131470/
http://blog.mondlab.com/python/django-ckeditor
http://2goo.info/blog/panjj/Django/2010/11/15/139
http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=1836380
运行python manage.py runserver时出现下面错误
Traceback (most recent call last):
File "D:\Python27\lib\wsgiref\handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "D:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", line 72, in __call__
return self.application(environ, start_response)
File "D:\Python27\lib\site-packages\django\core\handlers\wsgi.py", line 236, in __call__
self.load_middleware()
File "D:\Python27\lib\site-packages\django\core\handlers\base.py", line 57, in load_middleware
raise exceptions.ImproperlyConfigured(‘Middleware module "%s" does not define a "%s" class‘ % (mw_module, mw_classname))
ImproperlyConfigured: Middleware module "django.contrib.auth.middleware" does not define a "SessionAuthenticationMiddleware" class
SessionAuthenticationMiddleware 这个是1.7里新加的,把 django版本升级就可以解决这个问题
如何查看 django版本?
import django
django.VERSION
还有一个方法是在 settings.py里删除SessionAuthenticationMiddleware
MIDDLEWARE_CLASSES = (
‘django.contrib.sessions.middleware.SessionMiddleware‘,
‘django.middleware.common.CommonMiddleware‘,
‘django.middleware.csrf.CsrfViewMiddleware‘,
‘django.contrib.auth.middleware.AuthenticationMiddleware‘,
‘django.contrib.auth.middleware.SessionAuthenticationMiddleware‘ ,
‘django.contrib.messages.middleware.MessageMiddleware‘,
‘django.middleware.clickjacking.XFrameOptionsMiddleware‘,
‘django.middleware.security.SecurityMiddleware‘,
)
D:\virtualenv\lwc-ws>pip install django==1.8
Collecting django==1.8
C:\Python27\lib\site-packages\pip-8.1.1-py2.7.egg\pip\_vendor\requests\packages
urllib3\util\ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but
the SNI (Subject Name Indication) extension to TLS is not available on this pla
tform. This may cause the server to present an incorrect TLS certificate, which
can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
C:\Python27\lib\site-packages\pip-8.1.1-py2.7.egg\pip\_vendor\requests\packages
urllib3\util\ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is n
ot available. This prevents urllib3 from configuring SSL appropriately and may c
ause certain SSL connections to fail. For more information, see https://urllib3.
readthedocs.org/en/latest/security.html#insecureplatformwarning.
pip install pyopenssl ndg-httpsclient pyasn1
No matching distribution found for djangocms-installer
(django-cms) D:\virtualenv\django-cms>pip install djangocms-installer –vvv
Collecting djangocms-installer
1 location(s) to search for versions of djangocms-installer:
* https://pypi.python.org/simple/djangocms-installer/
Getting page https://pypi.python.org/simple/djangocms-installer/
Looking up "https://pypi.python.org/simple/djangocms-installer/" in the cache
Starting new HTTPS connection (1): pypi.python.org
https://docs.djangoproject.com/en/1.8/ref/settings/
Verbose name can be too long
Fieldset sequence in admin should align with model definition
关于Django中出现上述问题的解决方法
code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Newfo...Karen
上述网址第八条
Django语法更新
Newforms:clean_data------>cleaned_data
Need prefix for formset
TEMPLATE_DIRS = (
‘simpleToDo/simpleToDo/templates‘
)
simpleToDo: folder
simpleToDo: package name
templates: html folder
Windows用户必须使用斜杠而不是反斜杠。 get_template() 假定的是 Unix 风格的文件名符号约定。
从django1.5 开始
{% url blog_content blog_id=id %}"
需要修改为:
{% url ‘blog_content‘ blog_id=id %}"
‘NAME‘: ‘db.sqlite3‘
修改为
‘NAME‘: os.path.join(BASE_DIR,‘db.sqlite3‘)
初步原因是装了多个版本的Python导致的。
解决方法之一就是直到dianjo安装目录所在的Python来执行这个命令。如:
python c:\python27\scripts\django-admin.py startproject mysite
以及
C:\Python27\python.exe manage.py runserver
这个问题就会解决了。
标签:could not admin round result single define 信息 views doc
原文地址:http://www.cnblogs.com/2dogslife/p/6013436.html