From 2711c436c60fda272204e37f5eac1b6093e859f8 Mon Sep 17 00:00:00 2001 From: JohnYan <84345999@qq.com> Date: Mon, 30 Nov 2020 12:30:40 +0800 Subject: [PATCH] fix bug for python3.6 and django2.1 --- README.md | 4 +++- django_smartchart/settings.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 424e4d2..fdd2201 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ #### 安装使用说明: ```python -pip install django-smartchart +pip install django-smartchart #只支持最新版Python3.9.x +pip install django-smartchart==3.6 #支持python3.6.x 安装完成后, 你可以直接在命令行输入smartchart,即可启动 访问url: http://127.0.0.1:8000, 帐号密码都是admin @@ -35,6 +36,7 @@ from django.views.generic import RedirectView path('echart/', include('smart_chart.echart.urls')), path('', RedirectView.as_view(url='echart/index/')), #smartchart报表管理页, 自行更改路由 6. 初始化DB, 命令行输入: + python manage.py makemigrations python manage.py migrate 7. 建立管理员帐号, 如果已有可忽略 python manage.py createsuperuser diff --git a/django_smartchart/settings.py b/django_smartchart/settings.py index 4c6e55d..8822957 100644 --- a/django_smartchart/settings.py +++ b/django_smartchart/settings.py @@ -26,7 +26,7 @@ SECRET_KEY = '#$lc1_v_)tof%192ew9fow#o+1#d1qu74d@c11y*sgjqkkl*&b' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['*'] # Application definition @@ -79,7 +79,7 @@ WSGI_APPLICATION = 'django_smartchart.wsgi.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } }