Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tdt4242-base
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Jensen Jonassen
tdt4242-base
Commits
51386bf5
Commit
51386bf5
authored
3 years ago
by
Liam Svanåsbakken Crouch
Browse files
Options
Downloads
Patches
Plain Diff
Fix bad code smell: Unneccesary comments in djangoHeroku.py
parent
d0648298
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/secfit/secfit/djangoHeroku.py
+0
-14
0 additions, 14 deletions
backend/secfit/secfit/djangoHeroku.py
with
0 additions
and
14 deletions
backend/secfit/secfit/djangoHeroku.py
+
0
−
14
View file @
51386bf5
# 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
"
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment