-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
executable file
·93 lines (75 loc) · 2.29 KB
/
Copy pathsettings.py
File metadata and controls
executable file
·93 lines (75 loc) · 2.29 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
# Django settings for npp project.
DEBUG = False
TEMPLATE_DEBUG = False
ADMINS = (
("Jason Leveille", "jason@nationalpriorities.org"),
("Becky Sweger", "bsweger@nationalpriorities.org"),
)
MANAGERS = ADMINS
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
ROOT_URLCONF = 'npp_api.urls'
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django_extensions',
'npp_api.data',
'npp_api.api',
'piston',
'south',
'raven.contrib.django',
)
#api reocrds per page
SEARCH_PAGINATE_BY = 20
class IPList(list):
def __init__(self, ips):
try:
#http://software.inl.fr/trac/wiki/IPy
#ubuntu: apt-get install python-ipy
from IPy import IP
for ip in ips:
self.append(IP(ip))
except ImportError:
pass
def __contains__(self, ip):
try:
for net in self:
if ip in net:
return True
except:
pass
return False
INTERNAL_IPS = IPList(['127.0.0.1', '192.168.0.0/24', '75.144.180.37'])
PISTON_DISPLAY_ERRORS = False
PISTON_EMAIL_ERRORS = True
#import any local overrides to settings
try:
from local_settings import *
except ImportError, exp:
pass
#if local settings wants to append any settings info, do that now
try:
import local_settings
local_settings.modify(globals())
except:
pass