Moved db url parser import to condition
This commit is contained in:
parent
f562c8057f
commit
3f9ff78f01
@ -1,13 +1,12 @@
|
|||||||
from config import *
|
from config import *
|
||||||
|
|
||||||
import dj_database_url
|
|
||||||
|
|
||||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
|
|
||||||
DATABASES = {}
|
DATABASES = {}
|
||||||
|
|
||||||
if DATABASE_URL:
|
if DATABASE_URL:
|
||||||
|
import dj_database_url
|
||||||
# Reads string from DATABASE_URL env by default
|
# Reads string from DATABASE_URL env by default
|
||||||
DATABASES['default'] = dj_database_url.config()
|
DATABASES['default'] = dj_database_url.config()
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user