在浏览器中输入:http://127.0.0.1/ 试试,看到了什么?
7. 安装mysql
安装Mysql5
安装MySQL-python-1.2.2
修改项目的配置文件:(配置数据库的连接)
DATABASE_ENGINE = ‘mysql’ # ‘postgresql_psycopg2′, ‘postgresql’, ‘mysql’, ‘sqlite3′ or ‘oracle’.
DATABASE_NAME = ‘db_name’ # Or path to database file if using sqlite3.
DATABASE_USER = ‘root’ # Not used with sqlite3.
DATABASE_PASSWORD = ‘***’ # Not used with sqlite3.
DATABASE_HOST = ” # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = ” # Set to empty string for default. Not used with sqlite3.
在mysql命令行输入:create database dbmclsite default charset utf8 collate utf8_unicode_ci
在windows命令行输入:python manage.py syncdb
出错啦!
DLL load failed: 找不到指定的模块. 解决方案:
1) libmmd.dll, libguide40.dll和libmySQL.dll三个dll文件复制到python安装目录的Lib\site-packages下。
2) file “__init__”, replace:
from sets import ImmutableSet
class DBAPISet(ImmutableSet):
with
class DBAPISet(frozenset):
3) file “converters.py”, remove:
from sets import BaseSet, Set
4) file “converters.py”, change “Set” by “set” (IMPORTANT: only two places):
line 48: return set([ i for i in s.split(',') if i ])
line 128: set: Set2Str,
OK, Let’s try!
python manage.py syncdb
It words!
到这里,环境的搭建工作就算基本完成了。
References:
http://www.3gmatrix.cn/4/viewspace-16757.html
http://hi.baidu.com/doublelook/blog/item/e7fe3918c4b6d74d42a9ad4c.html
http://isun.blog.sohu.com/88570908.html
二、 启用管理界面及更改管理界面的外观
http://docs.djangoproject.com/en/dev/intro/tutorial02/#customize-the-admin-form
三、 国际化
http://docs.djangoproject.com/en/1.1/topics/i18n/
需要用到的gettext工具:
http://sourceforge.net/projects/gettext/
四、 支持富文本编辑
tinymce
http://tinymce.moxiecode.com/download.php
五、常用命令
MySQL:
show databases;
use db_name;
create database db_name default character set utf8 collate utf8_unicode_ci;
show create database db_name;
show tables;
show create table_name;