Python Web develop-1 set up environment

Source: Internet
Author: User

Build the development environment

First, confirm that the Python version of the system installation is 2.7.x:

$ python --versionPython 2.7.5

Then, install the third-party libraries you need to develop your web app:

Front-end template engine jinja2:

$ sudo apt-get install python-jinja*

有python-jinja2 和python3-jinja2,以及python-jinja2-doc

MySQL 5.x database, downloaded from the official website and installed, after installation, it is important to remember the root password. To avoid forgetting passwords, it is recommended to set the root password directly password ;

$ sudo apt-get install mysql-server-5.6

MySQL python driver Mysql-connector-python:

$ sudo apt-get install python-mysql.connector
Project structure

Select a working directory, and then we create the following directory structure:

awesome-python-webapp/   <-- 根目录|+- backup/               <-- 备份目录|+- conf/                 <-- 配置文件|+- dist/                 <-- 打包目录|+- www/                  <-- Web目录,存放.py文件|  ||  +- static/            <-- 存放静态文件|  ||  +- templates/         <-- 存放模板文件|+- LICENSE               <-- 代码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.

To learn about git and github usage, go to the Git tutorial.

Development tools

Sublime Text is recommended for your own use.

Python Web develop-1 set up environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.