Skip to content
Snippets Groups Projects
Unverified Commit d973dd48 authored by Marco Ciotola's avatar Marco Ciotola
Browse files

Upgrade Django to 1.9

parent a70a4be2
No related branches found
No related tags found
No related merge requests found
......@@ -2,17 +2,20 @@
Testing Helios Features
"""
from helios.models import *
from helios_auth.models import *
import uuid
from helios.models import Voter
from helios_auth.models import User
def generate_voters(election, num_voters=1000, start_with=1):
# generate the user
for v_num in range(start_with, start_with + num_voters):
user = User(user_type='password', user_id='testuser%s' % v_num, name='Test User %s' % v_num)
user.put()
user.save()
voter = Voter(uuid=str(uuid.uuid1()), election=election, voter_type=user.user_type, voter_id=user.user_id)
voter.put()
voter.save()
def delete_voters(election):
for v in Voter.get_by_election(election):
......
Django==1.8.19
Django==1.9.13
anyjson==0.3.3
celery==3.1.25
django-celery==3.2.2
......
......@@ -2,6 +2,6 @@
set -e # Exit immediately if a command exits with a non-zero status.
dropdb helios
createdb helios
python manage.py syncdb
python manage.py makemigrations
python manage.py migrate
echo "from helios_auth.models import User; User.objects.create(user_type='google',user_id='ben@adida.net', info={'name':'Ben Adida'})" | python manage.py shell
\ No newline at end of file
......@@ -47,7 +47,7 @@ if get_from_env('DATABASE_URL', None):
import dj_database_url
DATABASES['default'] = dj_database_url.config()
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
DATABASES['default']['CONN_MAX_AGE'] = 600
DATABASES['default']['CONN_MAX_AGE'] = '600'
# require SSL
DATABASES['default']['OPTIONS'] = {'sslmode': 'require'}
......@@ -93,7 +93,7 @@ SECRET_KEY = get_from_env('SECRET_KEY', 'replaceme')
ALLOWED_HOSTS = get_from_env('ALLOWED_HOSTS', 'localhost').split(",")
# Secure Stuff
if (get_from_env('SSL', '0') == '1'):
if get_from_env('SSL', '0') == '1':
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
......@@ -104,7 +104,7 @@ SESSION_COOKIE_HTTPONLY = True
# let's go with one year because that's the way to do it now
STS = False
if (get_from_env('HSTS', '0') == '1'):
if get_from_env('HSTS', '0') == '1':
STS = True
# we're using our own custom middleware now
# SECURE_HSTS_SECONDS = 31536000
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment