快速创建Django和Flask的Python应用

Python 笔记

切换python环境 pyenv global 3.7.3

Django应用笔记

安装django

pip install django
django-admin startproject myDjangoApp

运行
python manage.py runserver 5000

添加一个hello的模块
python manage.py startapp hello


Flask应用笔记

安装Flask
pip install flask

使用Flask-now生成App
https://github.com/ozanonurtek/flask-now

使用Flask-Turbo-Boost生成App
https://pypi.org/project/Flask-Turbo-Boost/

一些优秀的flask cms
https://pythonawesome.com/tag/cms/
http://quokkaproject.org/

林间有风CMS:https://github.com/TaleLin/lin-cms-flask
http://www.7yue.pro/

使用Flask-AppBuilder生成App
安装Flask-AppBuilder
pip install flask-appbuilder

使用fab快速创建flask app

(venv)$ flask fab create-app
Your new app name: first_app
Your engine type, SQLAlchemy or MongoEngine [SQLAlchemy]:
Downloaded the skeleton app, good coding!
(venv)$ cd first_app
(venv)$ export FLASK_APP=app
(venv)$ flask fab create-admin
Username [admin]:
User first name [admin]:
User last name [user]:
Email [admin@fab.org]:
Password:
Repeat for confirmation:

版权所有,转载请注明出处 luowei.github.io.