diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..07f3a00 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn docToPdf.wsgi --log-file - \ No newline at end of file diff --git a/docToPdf/settings.py b/docToPdf/settings.py index dacbb4e..ca6cf40 100644 --- a/docToPdf/settings.py +++ b/docToPdf/settings.py @@ -9,9 +9,13 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """ - +import os from pathlib import Path +import dj_database_url + +db_from_env = dj_database_url.config() + # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -24,10 +28,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [ - 'localhost', - '127.0.0.1', -] +ALLOWED_HOSTS = ['*'] DATA_UPLOAD_MAX_NUMBER_FIELDS = None # Application definition @@ -52,6 +53,8 @@ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + "django.middleware.security.SecurityMiddleware", + "whitenoise.middleware.WhiteNoiseMiddleware", ] ROOT_URLCONF = 'docToPdf.urls' @@ -124,7 +127,8 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.0/howto/static-files/ -STATIC_URL = 'static/' +STATIC_ROOT = os.path.join(BASE_DIR, 'static') +STATIC_URL = '/static/' # Default primary key field type # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field diff --git a/requirements.txt b/requirements.txt index d5025ac..ebad9a5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,35 @@ Django djangorestframework -pywin32; platform_system == "Windows" -docx2pdf; platform_system == "Windows" +pywin32==304; platform_system == "Windows" +docx2pdf==0.1.8; platform_system == "Windows" +dj-database-url==0.5.0 requests==2.28.1 -sphinx -coverage \ No newline at end of file +Sphinx==5.0.2 +coverage +alabaster==0.7.12 +asgiref==3.5.2 +Babel==2.10.3 +certifi==2022.6.15 +charset-normalizer==2.1.0 +colorama==0.4.5 +psycopg2 +docutils==0.18.1 +idna==3.3 +imagesize==1.4.1 +Jinja2==3.1.2 +MarkupSafe==2.1.1 +packaging==21.3 +Pygments==2.12.0 +pyparsing==3.0.9 +pytz==2022.1 +snowballstemmer==2.2.0 +sphinxcontrib-applehelp==1.0.2 +sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-htmlhelp==2.0.0 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-serializinghtml==1.1.5 +sqlparse==0.4.2 +tqdm==4.64.0 +tzdata==2022.1 +urllib3==1.26.9 diff --git a/runtime.txt b/runtime.txt new file mode 100644 index 0000000..4fb51b0 --- /dev/null +++ b/runtime.txt @@ -0,0 +1 @@ +python-3.10.5 \ No newline at end of file