Django学习笔记+官方网站
来源:互联网 发布:windows开机不显示壁纸 编辑:程序博客网 时间:2024/05/17 15:57
新手指南: https://django-chinese-docs.readthedocs.org/en/latest/intro/tutorial01.html
1、快速入门
http://blog.csdn.net/wcc526/article/details/160682992、新版django1.6的Hello world
http://blog.csdn.net/chenggong2dm/article/details/17394439
3、错误信息:You're using the Django "sites framework" without having set the SITE_ID setting. Create a site in your database and set the SITE_ID setting to fix this error.
原因:settings.py里# Application definition中添加了'django.contrib.sites'模块后需要设置SITE_ID
处理:在settings.py里添加配置:SITE_ID = 1
4、错误信息:(1146, "Table 'django_db.django_site' doesn't exist")
原因:settings.py里# Application definition中添加了'django.contrib.sites'模块而没有创建相应的表
解决:python manage.py syncdb
5、访问html时提示UnicodeDecodeErroror等编码错误
解决:a、在数据库连接语句上添加:charset='utf8',对中文支持好一点。例如:conn=MySQLdb.connect(host="localhost", user="me", passwd="secret", db="mydb", charset='utf8')"
b、在html文件中, 要加 ,否则如果数据库中的数据有汉字,访问html文件时就有可能会抛出编码异常问题。
0 0
- Django学习笔记+官方网站
- Django学习笔记-初识Django
- Django学习笔记
- django学习笔记
- [学习笔记]Django安装
- Django 学习笔记
- Django学习笔记
- Django学习笔记
- django系统学习笔记
- Django学习笔记
- Django学习笔记
- Django学习笔记
- Django学习笔记(一)
- Django学习笔记(二)
- Django学习笔记(三)
- Django学习笔记(四)
- Django学习笔记(五)
- Django学习笔记(六)
- Spring组件扫描<context:component-scan/>使用详解
- Date、String和Timestamp类型转换
- inotify的一个简单程序
- linux下安装boost
- LOGO图片详细说明(作业)
- Django学习笔记+官方网站
- android【资源汇总分享】Android开发资源汇总之一
- CSS 实现加载动画之七-彩环旋转
- Oracle中通过Function,存储过程,触发器,调用实现解析Clob字段中存在的xml字符串
- rz传文件老是不对的问题
- MySQL InnoDB性能调整的一点实践
- leetcode_Maximum Product Subarray
- php获取网页内容方法总结
- phpmyadmin 免登陆