Skip to content

Commit

Permalink
Merge pull request #394 from steveandroulakis/secret_key
Browse files Browse the repository at this point in the history
SECRET_KEY removed from settings
  • Loading branch information
grischa committed Feb 25, 2015
2 parents 9756fa1 + 749815d commit 799b336
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ pip install -r requirements-osx.txt

mkdir -p var/store

# execute this wonderful command to have your settings.py created/updated
# with a generated Django SECRET_KEY (required for MyTardis to run)
python -c "import os; from random import choice; key_line = '%sSECRET_KEY=\"%s\" # generated from build.sh\n' % ('from tardis.settings_changeme import * \n\n' if not os.path.isfile('tardis/settings.py') else '', ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789\\!@#$%^&*(-_=+)') for i in range(50)])); f=open('tardis/settings.py', 'a+'); f.write(key_line); f.close()"

python test.py
python mytardis.py collectstatic
# for empty databases, sync all and fake migrate, otherwise run a real migration
Expand Down
6 changes: 1 addition & 5 deletions tardis/settings_changeme.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,7 @@

USE_I18N = True

SECRET_KEY = 'ij!%7-el^^rptw$b=iol%78okl10ee7zql-()z1r6e)gbxd3gl'
'''
Before running as production server Make this unique, and don't share it with
anybody.
'''
# SECRET_KEY has been removed. Generate one by referring to build.sh

ALLOWED_HOSTS = ['*']
'''
Expand Down
2 changes: 2 additions & 0 deletions tardis/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,5 @@ def get_all_tardis_apps():
AUTOGENERATE_API_KEY = True

MIDDLEWARE_CLASSES += ('tardis.tardis_portal.filters.FilterInitMiddleware',)

SECRET_KEY = 'ij!%7-el^^rptw$b=iol%78okl10ee7zql-()z1r6e)gbxd3gl'

0 comments on commit 799b336

Please sign in to comment.