1. Installing
easy_install pip
pip install django-cms
2. start new project
django-admin.py startproject my_project
3. config mysqldb1
2
3
4
5
6
7
8
9
10DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME':'django',
'USER':'demonk',
'PASSWORD':'12345678',
'HOST':'127.0.0.1',
'PORT':'3306',
}
}
4. sync db
manage.py syncdb
5. runserver
manage.py runserver
Q:
1. No module named security
安装
查看版本
python -c “import django;print(django.get_version())”
RESET
删除/usr/lib/pythonXXX/site-packages/django*
安装其实直接去django和django-cms下载最新的然后 python setup.py install就好了,基本上一安装好了数据库配置好了就差不多了
settings.py里的INSTALLED_APPS要加上cms,配置上SITE_ID,然后 manage.py syncdb,再runserver,就算搭建好了,只是没有其他东西而已,关键在于后边创建app
http://www.cncentos.com/forum.php?mod=viewthread&tid=2599