mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-25 00:31:55 +00:00
preparing for django 1.8
This commit is contained in:
parent
453af2851b
commit
4c44a504ed
@ -45,4 +45,7 @@ def _resolves(url):
|
|||||||
resolve(url)
|
resolve(url)
|
||||||
return True
|
return True
|
||||||
except http.Http404:
|
except http.Http404:
|
||||||
return False
|
return False
|
||||||
|
except:
|
||||||
|
print(url)
|
||||||
|
raise
|
||||||
|
@ -14,7 +14,8 @@ try:
|
|||||||
except ImportError: # django >= 1.7
|
except ImportError: # django >= 1.7
|
||||||
SiteProfileNotAvailable = type('SiteProfileNotAvailable', (Exception,), {})
|
SiteProfileNotAvailable = type('SiteProfileNotAvailable', (Exception,), {})
|
||||||
|
|
||||||
from django.db.models import get_model
|
from django.db import models
|
||||||
|
#from django.db.models import get_model
|
||||||
|
|
||||||
|
|
||||||
def get_profile_model():
|
def get_profile_model():
|
||||||
@ -28,7 +29,7 @@ def get_profile_model():
|
|||||||
if (not hasattr(settings, 'AUTH_PROFILE_MODULE')) or \
|
if (not hasattr(settings, 'AUTH_PROFILE_MODULE')) or \
|
||||||
(not settings.AUTH_PROFILE_MODULE):
|
(not settings.AUTH_PROFILE_MODULE):
|
||||||
raise SiteProfileNotAvailable
|
raise SiteProfileNotAvailable
|
||||||
profile_mod = get_model(*settings.AUTH_PROFILE_MODULE.split('.'))
|
profile_mod = models.get_model(*settings.AUTH_PROFILE_MODULE.split('.'))
|
||||||
if profile_mod is None:
|
if profile_mod is None:
|
||||||
raise SiteProfileNotAvailable
|
raise SiteProfileNotAvailable
|
||||||
return profile_mod
|
return profile_mod
|
||||||
|
12
settings.py
12
settings.py
@ -31,9 +31,8 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
|||||||
|
|
||||||
# Django settings for troggle project.
|
# Django settings for troggle project.
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
TEMPLATE_DEBUG = DEBUG
|
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['expo.survex.com']
|
ALLOWED_HOSTS = ['expo.survex.com','localhost', '127.0.0.1']
|
||||||
|
|
||||||
ADMINS = (
|
ADMINS = (
|
||||||
# ('Your Name', 'your_email@domain.com'),
|
# ('Your Name', 'your_email@domain.com'),
|
||||||
@ -96,12 +95,14 @@ SMART_APPEND_SLASH = True
|
|||||||
# Make this unique, and don't share it with anybody.
|
# Make this unique, and don't share it with anybody.
|
||||||
SECRET_KEY = 'a#vaeozn0)uz_9t_%v5n#tj)m+%ace6b_0(^fj!355qki*v)j2'
|
SECRET_KEY = 'a#vaeozn0)uz_9t_%v5n#tj)m+%ace6b_0(^fj!355qki*v)j2'
|
||||||
|
|
||||||
|
TEMPLATES = [{}]
|
||||||
|
TEMPLATE_DEBUG = DEBUG
|
||||||
|
|
||||||
# List of callables that know how to import templates from various sources.
|
# List of callables that know how to import templates from various sources.
|
||||||
TEMPLATE_LOADERS = (
|
TEMPLATE_LOADERS = (
|
||||||
'django.template.loaders.filesystem.Loader',
|
'django.template.loaders.filesystem.Loader',
|
||||||
'django.template.loaders.app_directories.Loader',
|
'django.template.loaders.app_directories.Loader',
|
||||||
)
|
)
|
||||||
|
|
||||||
authmodule = 'django.contrib.auth.context_processors.auth'
|
authmodule = 'django.contrib.auth.context_processors.auth'
|
||||||
TEMPLATE_CONTEXT_PROCESSORS = ( authmodule, "core.context.troggle_context", )
|
TEMPLATE_CONTEXT_PROCESSORS = ( authmodule, "core.context.troggle_context", )
|
||||||
|
|
||||||
@ -112,12 +113,8 @@ INSTALLED_APPS = (
|
|||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
'django.contrib.contenttypes',
|
'django.contrib.contenttypes',
|
||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
# 'django.contrib.sites',
|
|
||||||
# 'django.contrib.redirects',
|
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
# 'django_extensions',
|
|
||||||
# 'tinymce',
|
|
||||||
# 'registration',
|
# 'registration',
|
||||||
'troggle.profiles',
|
'troggle.profiles',
|
||||||
'troggle.core',
|
'troggle.core',
|
||||||
@ -128,7 +125,6 @@ MIDDLEWARE_CLASSES = (
|
|||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
# 'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
|
|
||||||
'django.middleware.csrf.CsrfViewMiddleware',
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
|
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
|
Loading…
Reference in New Issue
Block a user