Skip to content

Latest commit

 

History

History
executable file
·
55 lines (34 loc) · 1.03 KB

File metadata and controls

executable file
·
55 lines (34 loc) · 1.03 KB

疫情常态化下的旅游出行线路推荐系统

duma/duma/setting.py中添加自己本地mysql账户以及secret key

SECRET_KEY = 'your-secret-key'

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'HOST': 'localhost',
        'PORT': 3306,
        'USER': 'root',
        'PASSWORD': '',
        'NAME': 'your-database',
    }
}   

如果未安装pymysql

pip install pymysql

如果第一次运行,请先删除duma/ncov/migrations/下的文件

Terminal打开到duma/路径下,并执行以下语句:

python manage.py makemigrations ncov
python manage.py migrate

如果第一次运行,进入本地mysql数据库your-data-base,直接粘贴duma/ncov/sql/insert-data.sql中的语句,或者直接在CLI中执行:

mysql -h localhost -u root -p your-data-base < /path/to/duma/ncov/sql/insert-data.sql

Terminal中继续执行:

python manage.py runserver

浏览器打开网址http://127.0.0.1:8000/ncov/