Fix deployment bugs: .env loading and CMD path
This commit is contained in:
@@ -20,7 +20,9 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
env = environ.Env(
|
||||
DEBUG=(bool, False)
|
||||
)
|
||||
environ.Env.read_env(os.path.join(BASE_DIR.parent, '.env'))
|
||||
env_file = os.path.join(BASE_DIR.parent, '.env')
|
||||
if os.path.exists(env_file):
|
||||
environ.Env.read_env(env_file)
|
||||
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
@@ -127,10 +129,10 @@ USE_TZ = True
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/6.1/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
STATIC_URL = '/static/'
|
||||
STATIC_ROOT = BASE_DIR / 'staticfiles'
|
||||
|
||||
MEDIA_URL = 'media/'
|
||||
MEDIA_URL = '/media/'
|
||||
MEDIA_ROOT = BASE_DIR / 'media'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user