1. Creating a project
From the command line, CD -to-a directory where you ' d like to store your code and then run the following command:
$ django-admin Startproject MySite
let ' s look at what startproject created:
mysite/manage.py mysite/__init__.py settings.py urls.py wsgi.py
2. Installing Mysqlclient
Pip Install Mysqlclient
PS:MYSQLDB cannot be used for Python3
3.Database Setup? (MySQL)Now , open up mysite/settings.py. It's a normal Python module with Module-level variables representing Django settings.
If you wish to use another database, install the appropriateDatabase bindings, and change the following keys in theDATABASES ' Default 'item to match your database connection settings:
DATABASES = {' Default ': ' ENGINE ': ' Django.db.backends.mysql ', ' NAME ': ' MyDB ',' USER ': ' Root ',
' PASSWORD ': ' Ganbare ',
' HOST ': ' localhost ',
' PORT ': ' 3306 ',}}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
"1" according to the Django website, write a web App