-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsettings.py
More file actions
98 lines (84 loc) · 2.76 KB
/
settings.py
File metadata and controls
98 lines (84 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- coding: utf-8 -*-
from mezzanine.project_template.settings import *
import os
# Paths
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1]
STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL.strip("/"))
MEDIA_ROOT = os.path.join(PROJECT_ROOT, *MEDIA_URL.strip("/").split("/"))
ROOT_URLCONF = "%s.urls" % PROJECT_DIRNAME
TEMPLATE_DIRS = (os.path.join(PROJECT_ROOT, "templates"),)
INSTALLED_APPS = (
"main", # the main app
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.redirects",
"django.contrib.sessions",
"django.contrib.sites",
"django.contrib.sitemaps",
"django.contrib.staticfiles",
"mezzanine.boot",
"mezzanine.conf",
"mezzanine.core",
"mezzanine.generic",
"mezzanine.accounts",
# gunicorn for production
# gunicorn_django --daemon -b 127.0.0.1:17734 -w 2 --max-requests 500
"gunicorn",
# =persona for authentication
"django_browserid",
# south for migrations
"south",
)
# from /fn-env/src/mezzanine/mezzanine/project_template
AUTHENTICATION_BACKENDS = (
"mezzanine.core.auth_backends.MezzanineBackend",
"django_browserid.auth.BrowserIDBackend", # =persona
)
ACCOUNTS_PROFILE_FORM_EXCLUDE_FIELDS = (
"email",
"first_name",
"last_name",
)
# from /fn-env/src/mezzanine/mezzanine/project_template
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.static",
"django.core.context_processors.media",
"django.core.context_processors.request",
"django.core.context_processors.tz",
"mezzanine.conf.context_processors.settings",
"django_browserid.context_processors.browserid", # =persona
)
LOGIN_REDIRECT_URL = '/' # =persona
LOGIN_REDIRECT_URL_FAILURE = '/' # =persona
LOGOUT_REDIRECT_URL = '/' # =persona
# remove?
MIDDLEWARE_CLASSES = (["mezzanine.core.middleware.UpdateCacheMiddleware"] +
list(MIDDLEWARE_CLASSES) +
["mezzanine.core.middleware.FetchFromCacheMiddleware"])
MIDDLEWARE_CLASSES.remove("mezzanine.pages.middleware.PageMiddleware")
# Mezzanine
AUTH_PROFILE_MODULE = "main.Profile"
SITE_TITLE = "Food News"
RATINGS_RANGE = (-1, 1)
RATINGS_ACCOUNT_REQUIRED = True
COMMENTS_ACCOUNT_REQUIRED = True
ACCOUNTS_PROFILE_VIEWS_ENABLED = True
# Drum
ALLOWED_DUPLICATE_LINK_HOURS = 24 * 7 * 3
ITEMS_PER_PAGE = 30
try:
from local_settings import *
except ImportError:
pass
try:
from mezzanine.utils.conf import set_dynamic_settings
except ImportError:
pass
else:
set_dynamic_settings(globals())