Loading .env_debug in Makefile; make clean command bugfix
This commit is contained in:
parent
9af92175a9
commit
2aeccd44be
3 changed files with 5 additions and 10 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
DEBUG=true
|
||||||
SESSION_KEY=debug
|
SESSION_KEY=debug
|
||||||
CSRF_KEY=debug
|
CSRF_KEY=debug
|
||||||
DB_HOST=localhost
|
DB_HOST=localhost
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -1,5 +1,6 @@
|
||||||
dev:
|
dev:
|
||||||
DEBUG="true" python3 -m uvicorn main:app --reload
|
python3 -m dotenv -f .env_debug run \
|
||||||
|
python3 -m uvicorn main:app --reload
|
||||||
|
|
||||||
prod:
|
prod:
|
||||||
python3 -m uvicorn main:app
|
python3 -m uvicorn main:app
|
||||||
|
@ -16,6 +17,6 @@ docker:
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf app/__pycache__
|
rm -rf app/__pycache__
|
||||||
rm -rf app/paths/__pycache__
|
rm -rf app/*/__pycache__
|
||||||
rm -rf __pycache__
|
rm -rf __pycache__
|
||||||
rm -rf .mypy_cache
|
rm -rf .mypy_cache
|
||||||
|
|
|
@ -15,17 +15,10 @@ templates_dir = str(
|
||||||
static_dir = str(
|
static_dir = str(
|
||||||
file_dir.parent / 'static'
|
file_dir.parent / 'static'
|
||||||
)
|
)
|
||||||
debug_env = str(
|
|
||||||
file_dir.parent / '.env_debug'
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
is_debug = bool(os.getenv('DEBUG'))
|
|
||||||
if is_debug:
|
|
||||||
load_dotenv(debug_env)
|
|
||||||
|
|
||||||
|
|
||||||
class Settings(BaseSettings):
|
class Settings(BaseSettings):
|
||||||
|
debug: bool = False
|
||||||
session_key: str = secrets.token_hex(32)
|
session_key: str = secrets.token_hex(32)
|
||||||
csrf_key: str = secrets.token_hex(32)
|
csrf_key: str = secrets.token_hex(32)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue