First, install distribute or setuptools, I use the Distribute
Download Link: Https://pypi.python.org/pypi/distribute
[Email protected] opt]# TAR-ZXVF distribute-0.6.49.tar.gz [[email protected] opt]# CD Distribute-0.6.49[[email protecte D] distribute-0.6.49]# python setup.py install
Second, installation JINJA2
: HTTPS://PYPI.PYTHON.ORG/PYPI/JINJA2
[Email protected] opt]# TAR-ZXVF jinja2-2.9.6.tar.gz [[email protected] opt]# CD Jinja2-2.9.6[[email protected] opt]# py Thon setup.py Install
Third, install the MySQL 5.x database and MySQL python driver Mysql-connector-python:
[Email protected] opt]# yum-y install mysql* Mysql-connector-python
IV. Structure of the project
Select a working directory to create the following directory structure:
awesome-python-webapp/ <--root directory |+-backup/ <--backup directory |+-conf/<-- configuration file |+-dist/<-- Package Directory |+- www/ <--web directory, storing. py File | | | +-static/ <--store static files | | | +-templates/ <--store template file |+-LICENSE <--code LICENSE
Once you've created your project's directory structure, it's recommended that you set up a git repository and sync to GitHub to keep your code changes safe.
Python-web Development Environment Construction