1 # Django settings for pgweb project.
4 PROJECT_ROOT
= os
.path
.abspath(os
.path
.dirname(__file__
))
9 ('PostgreSQL Webmaster', 'webmaster@postgresql.org'),
16 'ENGINE': 'django.db.backends.postgresql_psycopg2',
21 DEFAULT_AUTO_FIELD
= 'django.db.models.AutoField'
23 # Local time zone for this installation. Choices can be found here:
24 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
25 # although not all choices may be available on all operating systems.
26 # If running in a Windows environment this must be set to the same as your
30 # Language code for this installation. All choices can be found here:
31 # http://www.i18nguy.com/unicode/language-identifiers.html
32 LANGUAGE_CODE
= 'en-us'
36 # If you set this to False, Django will make some optimizations so as not
37 # to load the internationalization machinery.
40 # Absolute path to the directory that holds media.
41 # Example: "/home/media/media.lawrence.com/"
44 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
45 # trailing slash if there is a path component (optional in other cases).
46 # Examples: "http://media.lawrence.com", "http://example.com/media/"
48 STATIC_URL
= '/media/'
54 # Make this unique, and don't share it with anybody.
55 SECRET_KEY
= 'REALLYCHANGETHISINSETTINGS_LOCAL.PY'
58 'django.middleware.common.CommonMiddleware',
59 'django.contrib.sessions.middleware.SessionMiddleware',
60 'django.contrib.messages.middleware.MessageMiddleware',
61 'django.middleware.csrf.CsrfViewMiddleware',
62 'django.contrib.auth.middleware.AuthenticationMiddleware',
63 'pgweb.util.middleware.PgMiddleware',
66 CSRF_FAILURE_VIEW
= 'pgweb.core.views.csrf_failure'
68 ROOT_URLCONF
= 'pgweb.urls'
71 'BACKEND': 'django.template.backends.django.DjangoTemplates',
72 'DIRS': ['templates', ],
74 'context_processors': [
75 'django.template.context_processors.request',
76 'django.contrib.auth.context_processors.auth',
77 'django.contrib.messages.context_processors.messages',
78 'django.template.context_processors.media',
79 'pgweb.util.contexts.PGWebContextProcessor',
82 'pgweb.util.templateloader.TrackingTemplateLoader',
83 'django.template.loaders.filesystem.Loader',
84 'django.template.loaders.app_directories.Loader',
89 LOGIN_URL
= '/account/login/'
90 LOGIN_REDIRECT_URL
= '/account/'
91 LOGOUT_URL
= '/account/logout/'
93 AUTHENTICATION_BACKENDS
= (
94 'pgweb.util.auth.AuthBackend',
98 'django.contrib.auth',
99 'django.contrib.contenttypes',
100 'django.contrib.messages',
101 'django.contrib.sessions',
102 'django.contrib.admin',
103 'django.contrib.staticfiles',
104 'pgweb.core.apps.CoreAppConfig',
112 'pgweb.contributors',
119 'pgweb.featurematrix',
125 # Default format for date/time (as it changes between machines)
126 DATETIME_FORMAT
= "Y-m-d H:i:s"
127 DATE_FORMAT
= "Y-m-d"
129 # Configure recaptcha. Most details contain keys and are thus handled
130 # in settings_local.py. Override NOCAPTCHA to actually use them.
132 RECAPTCHA_SITE_KEY
= ""
133 RECAPTCHA_SECRET_KEY
= ""
136 # Application specific settings, likely overridden in settings_local.py.
138 # In particular, adjust the email addresses
140 SESSION_COOKIE_SECURE
= True # Allow our session only over https
141 SESSION_COOKIE_DOMAIN
= "www.postgresql.org" # Don't allow access by other postgresql.org sites
142 SESSION_COOKIE_HTTPONLY
= True # Access over http only, no js
143 CSRF_COOKIE_SECURE
= SESSION_COOKIE_SECURE
144 CSRF_COOKIE_DOMAIN
= SESSION_COOKIE_DOMAIN
145 CSRF_COOKIE_HTTPONLY
= SESSION_COOKIE_HTTPONLY
147 SITE_ROOT
= "https://www.postgresql.org" # Root of working URLs
148 FTP_PICKLE
= "/usr/local/pgweb/ftpsite.pickle" # Location of file with current contents from ftp site
149 YUM_JSON
= "/usr/local/pgweb/external/yum.json"
150 STATIC_CHECKOUT
= "/usr/local/pgweb-static" # Location of a checked out pgweb-static project
151 NOTIFICATION_EMAIL
= "someone@example.com" # Address to send notifications *to*
152 NOTIFICATION_FROM
= "someone@example.com" # Address to send notifications *from*
153 ACCOUNTS_NOREPLY_FROM
= "someone@example.com" # Address to send account messages from
154 BUGREPORT_EMAIL
= "someone@example.com" # Address to pgsql-bugs list
155 BUGREPORT_NOREPLY_EMAIL
= "someone-noreply@example.com" # Address to no-reply pgsql-bugs address
156 DOCSREPORT_EMAIL
= "someone@example.com" # Address to pgsql-docs list
157 DOCSREPORT_NOREPLY_EMAIL
= "someone-noreply@example.com" # Address to no-reply pgsql-docs address
158 NEWS_MAIL_SENDER
= "someone-noreply@example.com" # Address news is sent from
159 NEWS_MAIL_RECEIVER
= "some-announce@example.com" # Address news is sent to
160 NEWS_MAIL_RECEIVER_NAME
= "Some Announcement List" # Name field for sending news
161 NEWS_MAIL_TAGKEY
= "" # Key used to sign tags for pglister delivery
162 FRONTEND_SERVERS
= () # A tuple containing the *IP addresses* of all the
163 # varnish frontend servers in use.
164 FTP_MASTERS
= () # A tuple containing the *IP addresses* of all machines
165 # trusted to upload ftp structure data
166 VARNISH_PURGERS
= () # Extra servers that can do varnish purges through our queue
167 DO_ESI
= False # Generate ESI tags
168 ARCHIVES_SEARCH_SERVER
= "archives.postgresql.org" # Where to post REST request for archives search
169 ARCHIVES_SEARCH_PLAINTEXT
= False # Contact ARCHIVES_SEARCH_SERVER with http instead of https
170 ARCHIVES_FRONT_ADDRESS
= "https://www.postgresql.org" # Domain to read archives messages
171 SEARCH_DSN
= "dbname=pgsearch" # database for search, see tools/search/sql/README
172 FRONTEND_SMTP_RELAY
= "magus.postgresql.org" # Where to relay user generated email
173 OAUTH
= {} # OAuth providers and keys
174 PGDG_ORG_ID
= -1 # id of the PGDG organisation entry
176 # For debug toolbar, can then be fully configured in settings_local.py
177 DEBUG_TOOLBAR
= False
182 # Load local settings overrides
183 from .settings_local
import *
185 if DEBUG
and DEBUG_TOOLBAR
:
186 MIDDLEWARE
.append('debug_toolbar.middleware.DebugToolbarMiddleware')
187 INSTALLED_APPS
.append('debug_toolbar')