-
安装 Python 2.7, pip
-
安装虚拟环境
首先安装 virtualenv
# pip install virtualenv
创建虚拟环境
$ virtualenv venv
等待几分钟,安装完毕后运行(Windows)
$ venv\Scripts\activate.bat
或者(Linux)
$ source venv/bin/activate
然后在虚拟环境中安装第三方库
pip install -r requirements.txt
打开 venv/lib/python2.7/site-packages/flaskext/themes.py 找到 333 行,将:
if USING_BLUEPRINTS and not self.as_blueprint:
改为:
if USING_BLUEPRINTS and self.as_blueprint:
-
创建数据库 进入数据库控制台输入以下代码创建数据库
CREAT DATABASE microblog;
-
修改项目配置文件
打开 microblog/config.py,将 DB_PASSWORD = 'whypro' 中的 'whypro' 修改为您的数据库 root 密码
-
运行服务器
python runserver.py
-
初始化数据库
打开 http://localhost:5000/admin/install/ 自动初始化数据库,成功后将跳转至首页
-
注册一个账号体验吧!
q442333521/weibo-python
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published