Commit fa96f773 authored by Nicholas Anderson's avatar Nicholas Anderson
Browse files

Upgraded to Django 1.9

Additionally:
- Pulled some settings out of settings.py and into config.py
- Changed the DOCTYPE to the standard HTML5 DOCTYPE
- Added link to admin index page within navbar for site staff

TODO:
- Get Piwik back into all this somehow
parent bdd01530
Django==1.7.3
Whoosh==2.6.0
argparse==1.2.1
beautifulsoup4==4.3.2
django-allauth==0.20.0
django-analytical==0.19.0
django-autoslug==1.7.2
django-braces==1.4.0
django-crispy-forms==1.4.0
git+https://github.com/the-ben-waters/django-cas.git
django-gravatar2==1.1.4
django-haystack==2.3.1
django-localflavor==1.0
django-model-utils==2.2
beautifulsoup4==4.4.1
Django==1.9
django-allauth==0.24.1
django-analytical==1.0.0
django-autoslug==1.9.3
django-braces==1.8.1
django-crispy-forms==1.5.2
django-gravatar2==1.3.0
django-haystack==2.4.1
django-localflavor==1.2
django-model-utils==2.4
django-multiselectfield==0.1.3
django-randomslugfield==0.3.0
django-ratelimit==0.6.0
django-redis-cache==0.13.0
flake8==2.4.0
mccabe==0.3
MySQL-python==1.2.5
oauthlib==0.7.2
pep8==1.5.7
pyflakes==0.8.1
django-redis-cache==1.6.4
flake8==2.5.0
mccabe==0.3.1
# MySQL-python==1.2.5
mysqlclient
oauthlib==1.0.3
pep8==1.6.2
pyflakes==1.0.0
python-openid==2.2.5
redis==2.10.3
requests==2.5.1
requests-oauthlib==0.4.2
six==1.8.0
wsgiref==0.1.2
redis==2.10.5
requests==2.8.1
requests-oauthlib==0.5.0
six==1.10.0
wheel==0.26.0
Whoosh==2.7.0
git+https://github.com/the-ben-waters/django-cas.git
......@@ -31,3 +31,16 @@ EMAIL_PORT = 25
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_SSL = False
# Where is Redis listening? Can be either a host:part or a UNIX socket
REDIS_PATH = 'localhost:6379'
# Django debug file path
DEBUG_FILE_PATH = '/path/to/debug.log'
# Needed for allauth, what protocol are we going to be using?
ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'http'
# Mainly for deployment, where do we want our static files to go when running:
# python manage.py collectstatic
STATIC_ROOT = '/path/to/static_files/'
......@@ -9,6 +9,7 @@ https://docs.djangoproject.com/en/1.7/ref/settings/
"""
from __future__ import absolute_import, print_function
from . import config
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
......@@ -27,6 +28,8 @@ STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
STATIC_ROOT = config.STATIC_ROOT
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
......@@ -41,14 +44,11 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.request',
'allauth.account.context_processors.account',
'allauth.socialaccount.context_processors.socialaccount',
'django.core.context_processors.request'
)
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
from . import config
DEBUG = config.DEBUG
TEMPLATE_DEBUG = config.TEMPLATE_DEBUG
ALLOWED_HOSTS = config.ALLOWED_HOSTS
......@@ -67,6 +67,7 @@ INSTALLED_APPS = (
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.humanize',
'cas',
# apps
'api',
'housing',
......@@ -74,7 +75,6 @@ INSTALLED_APPS = (
# packages
'crispy_forms',
'django_gravatar',
'analytical',
'randomslugfield',
'haystack',
'multiselectfield',
......@@ -99,8 +99,6 @@ MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'cas.middleware.CASMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
......@@ -207,7 +205,7 @@ else:
'default': {
'BACKEND': 'redis_cache.RedisCache',
# configure to redis port
'LOCATION': '/var/run/redis/redis.sock',
'LOCATION': config.REDIS_PATH,
},
}
......@@ -228,6 +226,8 @@ if not DEBUG:
EMAIL_HOST_PASSWORD = config.EMAIL_HOST_PASSWORD
EMAIL_USE_SSL = config.EMAIL_USE_SSL
ACCOUNT_DEFAULT_HTTP_PROTOCOL = config.ACCOUNT_DEFAULT_HTTP_PROTOCOL
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
......@@ -237,7 +237,7 @@ if not DEBUG:
'class': 'logging.FileHandler',
# make sure to change this to the proper path, and one that
# can be written to
'filename': '/path/to/django/debug.log',
'filename': config.DEBUG_FILE_PATH,
},
# 'mail_admins' by default does not include a traceback attachment
# setting 'include_html' to True will attach an html traceback file to the email
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
......@@ -13,7 +12,6 @@
</head>
<body>
{% load piwik %}
<div id="wrap" style="display: flex;">
{% include 'layouts/navbar.html' %}
<div id="contentcontain" class="container">
......@@ -30,7 +28,6 @@
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
{% block javascript %}
{% endblock javascript %}
{% piwik %}
</body>
</html>
......@@ -28,6 +28,9 @@
<li>
<a href="{% url 'updateStudent' request.user.username %}"><i class="fa fa-cog fa-fw fa-lg"></i></a>
</li>
{% if user.is_staff %}
<li><a href="{% url 'admin:index' %}">Admin</a></li>
{% endif %}
<li><a href="{% url 'logout' %}">Logout</a>
</li>
{% else %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment