Skip to content
Snippets Groups Projects
Commit 51386bf5 authored by Liam Svanåsbakken Crouch's avatar Liam Svanåsbakken Crouch :speech_balloon:
Browse files

Fix bad code smell: Unneccesary comments in djangoHeroku.py

parent d0648298
No related branches found
No related tags found
No related merge requests found
# import logging
import os
import dj_database_url
......@@ -35,29 +34,20 @@ def settings(
if env.startswith("HEROKU_POSTGRESQL"):
db_color = env[len("HEROKU_POSTGRESQL_") :].split("_")[0]
# logger.info('Adding ${} to DATABASES Django setting ({}).'.format(env, db_color))
config["DATABASES"][db_color] = dj_database_url.parse(
url, conn_max_age=conn_max_age, ssl_require=True
)
if "DATABASE_URL" in os.environ:
# logger.info('Adding $DATABASE_URL to default DATABASE Django setting.')
# Configure Django for DATABASE_URL environment variable.
config["DATABASES"]["default"] = dj_database_url.config(
conn_max_age=conn_max_age, ssl_require=True
)
# logger.info('Adding $DATABASE_URL to TEST default DATABASE Django setting.')
# Enable test database if found in CI environment.
if "CI" in os.environ:
config["DATABASES"]["default"]["TEST"] = config["DATABASES"]["default"]
# else:
# logger.info('$DATABASE_URL not found, falling back to previous settings!')
if test_runner:
# Enable test runner if found in CI environment.
if "CI" in os.environ:
......@@ -65,8 +55,6 @@ def settings(
# Staticfiles configuration.
if staticfiles:
# logger.info('Applying Heroku Staticfiles configuration to Django settings.')
config["STATIC_ROOT"] = os.path.join(config["BASE_DIR"], "staticfiles")
config["STATIC_URL"] = "/static/"
......@@ -91,11 +79,9 @@ def settings(
] = "whitenoise.storage.CompressedManifestStaticFilesStorage"
if allowed_hosts:
# logger.info('Applying Heroku ALLOWED_HOSTS configuration to Django settings.')
config["ALLOWED_HOSTS"] = ["*"]
# SECRET_KEY configuration.
if secret_key:
if "SECRET_KEY" in os.environ:
# logger.info('Adding $SECRET_KEY to SECRET_KEY Django setting.')
# Set the Django setting from the environment variable.
config["SECRET_KEY"] = os.environ["SECRET_KEY"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment