diff --git a/.gitignore b/.gitignore index ad9c1fc7..553403a5 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,7 @@ mediafiles/ \.env staticfiles/ postgresql/ +data/ /docker-compose.override.yml diff --git a/boot.sh b/boot.sh index 2e78ba93..6e94978a 100644 --- a/boot.sh +++ b/boot.sh @@ -35,7 +35,7 @@ echo "Waiting for database to be ready..." attempt=0 max_attempts=20 -if [ "${DB_ENGINE}" != 'django.db.backends.sqlite3' ]; then +if [ "${DB_ENGINE}" == 'django.db.backends.postgresql' ]; then # POSTGRES_PASSWORD (or a valid file at POSTGRES_PASSWORD_FILE) must be set in .env file diff --git a/recipes/settings.py b/recipes/settings.py index 29a65d38..dbbdcb68 100644 --- a/recipes/settings.py +++ b/recipes/settings.py @@ -350,7 +350,7 @@ WSGI_APPLICATION = 'recipes.wsgi.application' # Load settings from env files if os.getenv('DATABASE_URL'): match = re.match( - r'(?P\w+):\/\/(?P[\w\d_-]+)(:(?P[^@]+))?@(?P[^:/]+)(:(?P\d+))?(\/(?P[\w\d\/\._-]+))?', + r'(?P\w+):\/\/(?:(?P[\w\d_-]+)(?::(?P[^@]+))?@)?(?P[^:/]+)(?:(?P\d+))?(?:/(?P[\w\d/._-]+))?', os.getenv('DATABASE_URL') ) settings = match.groupdict()