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