1. Create a new virtulenv
Mkvirtulenv Mxonlie
2. Installing Django under Mxonlie
Pip Install django==1.9
PS: Why not use Django 1.10 here? Because the later development process is useful to a framework, only support to Django1.9 version, the old and semi-Django1.10 version support many new features, but we do not use here, so only need to install Django 1.9 version can be
3. New Project
4. Successful creation
5, install Python-mysql Drive
6. Configure the connection to the database in code--settings.py DATABASES
7. New Database Mxonline
8. Generate Django Default database tables
Error when running manage.py
We can ignore this error and continue
Run: makemigrations command: Migrate
Run: Migrate
You can observe the database tables that Django gave us by default
9, enter the debug mode, you can break point
10. Development Server Domain name
11, run the domain name, IT worked said OK
Python Web Development (1)--New project