1
0
mirror of https://github.com/TandoorRecipes/recipes.git synced 2026-01-11 17:16:59 -05:00

allow to specify an actual path using DATABASE_URL

This commit is contained in:
Matthias Lohr
2022-01-17 11:21:36 +01:00
parent 0c603e3665
commit b3e971fe09

View File

@@ -258,7 +258,7 @@ WSGI_APPLICATION = 'recipes.wsgi.application'
# Load settings from env files
if os.getenv('DATABASE_URL'):
match = re.match(
r'(?P<schema>\w+):\/\/(?P<user>[\w\d_-]+)(:(?P<password>[^@]+))?@(?P<host>[^:/]+)(:(?P<port>\d+))?(\/(?P<database>[\w\d_-]+))?',
r'(?P<schema>\w+):\/\/(?P<user>[\w\d_-]+)(:(?P<password>[^@]+))?@(?P<host>[^:/]+)(:(?P<port>\d+))?(\/(?P<database>[\w\d\/\._-]+))?',
os.getenv('DATABASE_URL')
)
settings = match.groupdict()