Skip to content

Commit 2852ea0

Browse files
committed
fix: web API return 500
1 parent 0a1cd91 commit 2852ea0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ DB_HOST='127.0.0.1'
55
DB_PORT='5432'
66
SECRET_KEY='SXCiKvMy8#4&*W&nNT5kGX&Q2EmUKmxSXCiKvMy8#4&*W&nNT5kGX&Q2EmUKmxSXCiKvMy8#4&*W&nNT5kGX&Q2EmUKmx'
77
ENVIRONMENT='development'
8+
DEBUG=True

PastebinAPI/settings.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
ENVIRONMENT = config("ENVIRONMENT", default="development")
2222
IN_DEV = ENVIRONMENT == "development"
23-
IN_PROD = ENVIRONMENT == "production"
2423

2524
# Quick-start development settings - unsuitable for production
2625
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
@@ -29,10 +28,8 @@
2928
SECRET_KEY = config("SECRET_KEY")
3029

3130
# SECURITY WARNING: don't run with debug turned on in production!
32-
DEBUG = True
31+
DEBUG = config("DEBUG", default=False, cast=bool)
3332

34-
if IN_PROD:
35-
DEBUG = False
3633

3734
ALLOWED_HOSTS = ['0.0.0.0', 'localhost', '127.0.0.1',
3835
'pastebin-api-nc-b2d037a42bfc.herokuapp.com']
@@ -159,6 +156,10 @@
159156
MEDIA_URL = "media/"
160157
STATIC_URL = "static/"
161158

159+
STATICFILES_DIRS = [
160+
os.path.join(BASE_DIR, "dist", "static"),
161+
]
162+
162163
# Default primary key field type
163164
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
164165

0 commit comments

Comments
 (0)