<pre name="code" class="python">1.app 创建:python manage.py startapp books
2.启动Python交互解释器: python manage.py shell
3.python manage.py syncdb 生成数据库, python manage.py dbshell启动数据库交互
4.同步数据库:先删除blog中的migrations文件和db.sqlite3
python manage.py makemigrations blog
python manage.py migrate --fake
python manage.py migrate
5.安装PIL
PIL:Python Imaging Library,已经是Python平台事实上的图像处理标准库了。PIL功能非常强大,但API却非常简单易用。
由于PIL仅支持到Python 2.7,加上年久失修,于是一群志愿者在PIL的基础上创建了兼容的版本,名字叫Pillow,
支持最新Python 3.x,又加入了许多新特性,因此,我们可以直接安装使用Pillow。
安装Pillow在命令行下直接通过pip安装:
$ pip install pillow
6.导入以来环境: pip install -r requirements.txt