Upgrade Django
This commit is contained in:
1 parent
5364f7f49c
commit
b034744725
2 files changed
+30
-26
No files matched your search
+16
-12
@@ -23,11 +23,8 @@ SECRET_KEY = secrets.SECRET_KEY
|
|||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
||||||
TEMPLATE_DEBUG = False
|
|
||||||
|
|
||||||
if 'runserver' in sys.argv:
|
if 'runserver' in sys.argv:
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
TEMPLATE_DEBUG = True
|
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['sec1.aii.avans.nl']
|
ALLOWED_HOSTS = ['sec1.aii.avans.nl']
|
||||||
|
|
||||||
@@ -98,10 +95,22 @@ STATIC_URL = '/static/'
|
|||||||
PROJECT_PATH = os.path.realpath(os.path.dirname(__file__)) + '/..'
|
PROJECT_PATH = os.path.realpath(os.path.dirname(__file__)) + '/..'
|
||||||
MEDIA_ROOT = PROJECT_PATH + '/media/'
|
MEDIA_ROOT = PROJECT_PATH + '/media/'
|
||||||
|
|
||||||
# Additional locations of static files
|
TEMPLATES = [
|
||||||
TEMPLATE_DIRS = (
|
{
|
||||||
PROJECT_PATH + '/templates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
)
|
'DIRS': [],
|
||||||
|
'APP_DIRS': True,
|
||||||
|
'OPTIONS': {
|
||||||
|
'context_processors': [
|
||||||
|
'django.template.context_processors.debug',
|
||||||
|
'django.template.context_processors.request',
|
||||||
|
'django.contrib.auth.context_processors.auth',
|
||||||
|
'securityquiz.settings.closed',
|
||||||
|
'django.contrib.messages.context_processors.messages',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
STATICFILES_DIRS = (
|
STATICFILES_DIRS = (
|
||||||
PROJECT_PATH + '/static',
|
PROJECT_PATH + '/static',
|
||||||
@@ -109,8 +118,3 @@ STATICFILES_DIRS = (
|
|||||||
|
|
||||||
def closed(request):
|
def closed(request):
|
||||||
return {'CLOSED': CLOSED}
|
return {'CLOSED': CLOSED}
|
||||||
|
|
||||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
|
||||||
'django.contrib.auth.context_processors.auth',
|
|
||||||
'securityquiz.settings.closed'
|
|
||||||
)
|
|
||||||
+14
-14
@@ -1,21 +1,21 @@
|
|||||||
from django.conf.urls import patterns, include, url
|
from django.conf.urls import patterns, include, url
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
import views
|
||||||
|
|
||||||
admin.autodiscover()
|
admin.autodiscover()
|
||||||
|
|
||||||
from views import SecurityApi
|
urlpatterns = [
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
|
||||||
# Examples:
|
# Examples:
|
||||||
url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
|
url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
|
||||||
url(r'^api/hello', SecurityApi.as_view()),
|
url(r'^api/hello', views.SecurityApi.as_view()),
|
||||||
url(r'^callback$', 'views.avans_callback'),
|
url(r'^callback$', views.avans_callback),
|
||||||
url(r'^logout$', 'views.avans_logout'),
|
url(r'^logout$', views.avans_logout),
|
||||||
url(r'^pull$', 'views.git_pull'),
|
url(r'^pull$', views.git_pull),
|
||||||
url(r'^admin/', include(admin.site.urls)),
|
url(r'^admin/', include(admin.site.urls)),
|
||||||
url(r'^save$', 'views.save'),
|
url(r'^save$', views.save),
|
||||||
url(r'^sign$', 'views.sign'),
|
url(r'^sign$', views.sign),
|
||||||
url(r'^graderhelper$', 'views.graderhelper'),
|
url(r'^graderhelper$', views.graderhelper),
|
||||||
url(r'^letsencrypt$', 'views.letsencrypt'),
|
url(r'^letsencrypt$', views.letsencrypt),
|
||||||
url(r'^\.well-known/acme-challenge/(.+)', 'views.letsencrypt_challenge'),
|
url(r'^\.well-known/acme-challenge/(.+)', views.letsencrypt_challenge),
|
||||||
url(r'^(.*)$', 'views.home', name='home'),
|
url(r'^(.*)$', views.home, name='home'),
|
||||||
)
|
]
|
||||||
Reference in new issue
Block a user