File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed
Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1- DEBUG = 1
21SECRET_KEY = foo
32DJANGO_ALLOWED_HOSTS = localhost 127.0.0.1 [::1]
43SQL_ENGINE = django.db.backends.postgresql
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ services:
1616 - ./.env.prod
1717 - ./email.env
1818 - ./keycloak.prod.env
19+ - ./.env.prod.host
1920 depends_on :
2021 - db
2122 db :
Original file line number Diff line number Diff line change 1111"""
1212import os
1313from pathlib import Path
14+ from dotenv import load_dotenv
1415
1516import _locale
1617_locale ._getdefaultlocale = (lambda * args : ['en_US' , 'utf8' ])
1920BASE_DIR = Path (__file__ ).resolve ().parent .parent
2021
2122
22-
23+ load_dotenv ('is_debug.env' )
24+ DEBUG = os .environ .get ('DEBUG' , False ) == 'true'
25+ production = not DEBUG
2326
2427# Quick-start development settings - unsuitable for production
2528# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
26-
27- production = os .environ .get ('PRODUCTION' , False ) == 'true'
2829print (f'production: { production } ' )
2930
3031# SECURITY WARNING: keep the secret key used in production secret!
3132if production :
3233 SECRET_KEY = os .environ .get ('SECRET_KEY' )
3334else :
3435 SECRET_KEY = 'nn@cmln2bw@@omr+_5k)!g&ylxvn+(+j@4=@1=*euv0fw3wbvi'
35- from dotenv import load_dotenv
3636 load_dotenv ('../email.env' )
3737 load_dotenv ('email.env' )
3838 load_dotenv ('keycloak.dev.env' )
Original file line number Diff line number Diff line change 1515"""
1616from django .contrib import admin
1717from django .urls import path , include
18-
1918from django .conf import settings
2019from django .conf .urls .static import static
21-
2220from fabman import views
23- from legacy import views as legacy_views
2421
2522urlpatterns = [
2623 path ('members/' , include ('members.urls' )),
3128] + static (settings .STATIC_URL , document_root = settings .STATIC_ROOT ) \
3229 + static (settings .MEDIA_URL , document_root = settings .MEDIA_ROOT )
3330
31+ if settings .DEBUG :
32+ from debug_toolbar .toolbar import debug_toolbar_urls
33+ urlpatterns += debug_toolbar_urls ()
34+
3435if not settings .DEBUG :
3536 urlpatterns .append (path ('' , views .index ))
3637
3738
38- from django .contrib import admin
3939admin .site .site_header = "Fablab Sion - FabMan"
4040admin .site .site_title = "FabMan"
4141admin .site .index_title = ''
You can’t perform that action at this time.
0 commit comments