Create a Django project 2

Project start: 1, run directly pycharm click inside the upper right corner to start

 2, started from the command line, python manage.py runserver

The basic configuration of the project:

3, in the settings.py database configuration, which configuration database

= {DATABASES 
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': the os.path.join (base_dir, 'db.sqlite3'),
}

# 'default': {
# ' ENGINE ':' django.db.backends.mysql ',
#' NAME ':' DB1 ',
#' the USER ':' user1 ',
#' PASSWORD ':' pass111 ',
#' the HOST ':' 192.126.1.1 ' ,
# 'PORT': 3306
#} #MYSQL configuration
}
If you are using MySQL database, you need to join at the contents of a file in _init_.py
pymysql Import 
pymysql.install_as_MySQLdb ()
# If you are using mysql, then this must be added




Guess you like

Origin www.cnblogs.com/lapt/p/12111936.html