import pymysql pymysql.install_as_MySQLdb()
同时在MySQL数据库里创建一个hotel1的数据库
成功后出现Myapp
在这个文件下新建一个urls
在下面输入以下代码
from django.conf.urls import url
from django.contrib import admin
from MyApp import views
urlpatterns = [
]
将源文件的的这个片段替换为以下
ANGUAGE_CODE = 'zh-hans'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS=(os.path.join(BASE_DIR),'static')