mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-09-26 13:30:13 +00:00
Don't read .env from within Python
Docker already puts the contents of .env in the environment.
This commit is contained in:
parent
304c47863b
commit
072bd3ffe5
3 changed files with 1 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
|||
""" bookwyrm settings and configuration """
|
||||
|
||||
import os
|
||||
from typing import AnyStr
|
||||
|
||||
|
@ -13,7 +14,6 @@ from django.core.exceptions import ImproperlyConfigured
|
|||
# pylint: disable=line-too-long
|
||||
|
||||
env = Env()
|
||||
env.read_env()
|
||||
DOMAIN = env("DOMAIN")
|
||||
|
||||
with open("VERSION", encoding="utf-8") as f:
|
||||
|
|
|
@ -8,11 +8,8 @@ https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
|
|||
"""
|
||||
|
||||
import os
|
||||
from environs import Env
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
Env.read_env()
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookwyrm.settings")
|
||||
|
||||
application = get_wsgi_application()
|
||||
|
|
|
@ -2,10 +2,7 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
from environs import Env
|
||||
|
||||
if __name__ == "__main__":
|
||||
Env.read_env() # load environment variables from .env
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookwyrm.settings")
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
|
|
Loading…
Reference in a new issue