From e610400ab548b86ba67eff2b205d7bdc4ee30e5f Mon Sep 17 00:00:00 2001 From: ngfchl Date: Wed, 24 Aug 2022 16:46:08 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E9=87=8D=E6=96=B0=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=202.=20=E8=B0=83=E6=95=B4=E4=B8=BA=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=203.=20=E6=B7=BB=E5=8A=A0=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E7=AB=AF=E5=8F=A3=E7=9A=84=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 ++ db/pt.json => pt.json | 0 ptools/settings.py | 7 +++++++ start.sh | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) rename db/pt.json => pt.json (100%) diff --git a/Dockerfile b/Dockerfile index 5d20993..5eadc13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,8 @@ ENV PYTHONUNBUFFERED 1 ENV DJANGO_SUPERUSER_USERNAME=admin ENV DJANGO_SUPERUSER_EMAIL=admin@eamil.com ENV DJANGO_SUPERUSER_PASSWORD=adminadmin +ENV DJANGO_WEB_PORT=8000 +ENV DJANGO_DEBUG=True COPY pip.conf /root/.pip/pip.conf diff --git a/db/pt.json b/pt.json similarity index 100% rename from db/pt.json rename to pt.json diff --git a/ptools/settings.py b/ptools/settings.py index 3bdf83d..608562a 100644 --- a/ptools/settings.py +++ b/ptools/settings.py @@ -23,6 +23,13 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = 'django-insecure-6wrh^t$@gbb^s^=79@%cv=%yhq6gl^kane#g@-n-*n6+s1lo2f' # SECURITY WARNING: don't run with debug turned on in production! +# if os.environ.get('DJANGO_DEBUG'): +# print("Debug is enabled.") +# DEBUG = True +# # When not specified, ALLOW_HOSTS defaults to: +# # ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]'] +# else: +# DEBUG = False DEBUG = True ALLOWED_HOSTS = ['*'] diff --git a/start.sh b/start.sh index d8f7329..389210f 100755 --- a/start.sh +++ b/start.sh @@ -9,7 +9,7 @@ if [ ! -f ./db/db.sqlite3 ]; then # 如果数据库存在,就不执行 python manage.py makemigrations && python manage.py migrate && - python manage.py loaddata db/pt.json + python manage.py loaddata pt.json # mv db.sqlite3 ./db/db.sqlite3 fi if [ ! -e $CONTAINER_ALREADY_STARTED ]; then