Skip to content

Commit

Permalink
Now 1.10 compatible?
Browse files Browse the repository at this point in the history
  • Loading branch information
Dillon Lareau committed Sep 6, 2018
1 parent a9532b4 commit ab49895
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions config/puzzlehunt_setup.sh
Expand Up @@ -24,7 +24,7 @@ apt-get install -y git
try cd /vagrant
try ln -s /vagrant/puzzlehunt_server /home/vagrant/puzzlehunt_server
try cd /home/vagrant/puzzlehunt_server
try git checkout development # Only needed until test branch is merged
try git checkout tests # Only needed until test branch is merged

# Make sure we don't get prompted for anything
try export DEBIAN_FRONTEND="noninteractive"
Expand All @@ -39,9 +39,12 @@ apt-get install -y libapache2-mod-proxy-html || true
# Set up MYSQL user and database
try mysql -uroot -p$MYSQL_ROOT_PASSWORD -e "CREATE DATABASE IF NOT EXISTS $MYSQL_PUZZLEHUNT_DB"
try mysql -uroot -p$MYSQL_ROOT_PASSWORD -e "grant all privileges on $MYSQL_PUZZLEHUNT_DB.* to '$MYSQL_NORMAL_USER'@'localhost' identified by '$MYSQL_NORMAL_PASSWORD'"
try mysql -uroot -p$MYSQL_ROOT_PASSWORD -e "grant all privileges on test_$MYSQL_PUZZLEHUNT_DB.* to '$MYSQL_NORMAL_USER'@'localhost'"

# Configure application (Consider this the same as modifying secret_settings.py.template)
try cat > puzzlehunt_server/secret_settings.py <<EOF
try cat > puzzlehunt_server/settings/local_settings.py <<EOF
from .base_settings import *
DEBUG=False
SECRET_KEY = '$(head /dev/urandom | LC_ALL=C tr -dc 'A-Za-z0-9!@#$%^&*(\-_=+)' | head -c 50)'
DATABASES = {
'default': {
Expand All @@ -67,6 +70,7 @@ try source venv/bin/activate
try pip install -r requirements.txt

# Run application setup commands
export DJANGO_SETTINGS_MODULE="puzzlehunt_server.settings.local_settings"
try mkdir -p ./media/puzzles
try python manage.py migrate
try python manage.py collectstatic --noinput
Expand Down
4 changes: 2 additions & 2 deletions puzzlehunt_server/urls.py
Expand Up @@ -13,7 +13,7 @@
1. Add an import: from blog import urls as blog_urls
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url, patterns
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as base_auth_views
from django.conf import settings
Expand All @@ -36,4 +36,4 @@
if(settings.DEBUG):
import debug_toolbar
urlpatterns = urlpatterns + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += patterns('', url(r'^__debug__/', include(debug_toolbar.urls)), )
urlpatterns.append(url(r'^__debug__/', include(debug_toolbar.urls)))

0 comments on commit ab49895

Please sign in to comment.