Skip to content
This repository was archived by the owner on Jan 23, 2021. It is now read-only.

Commit 0dab5e7

Browse files
committed
Split settings into settings and local_settings.
local_settings.py should not be under version control, an example is added.
1 parent 44c1c68 commit 0dab5e7

File tree

2 files changed

+64
-13
lines changed

2 files changed

+64
-13
lines changed

events/local_settings_example.py

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Dyonisos local settings file
2+
3+
# SECURITY WARNING: Make this unique, and don't share it with anybody.
4+
SECRET_KEY = ''
5+
6+
# SECURITY WARNING: don't run with debug turned on in production!
7+
DEBUG = False
8+
TEMPLATE_DEBUG = False
9+
10+
ALLOWED_HOSTS = []
11+
12+
ADMINS = (
13+
('name', 'name@domain.com'),
14+
)
15+
16+
ALLOWED_HOSTS = ['events.jongedemocraten.nl']
17+
18+
DATABASES = {
19+
'default': {
20+
'ENGINE': 'django.db.backends.mysql',
21+
'NAME': 'events',
22+
'USER': 'events',
23+
'PASSWORD': '',
24+
'HOST': '127.0.0.1',
25+
'PORT': '',
26+
}
27+
}
28+
29+
LANGUAGE_CODE = 'nl_NL'
30+
TIME_ZONE = 'Europe/Amsterdam'
31+
32+
STATIC_ROOT = '/usr/share/events/htdocs/'
33+
STATIC_URL = 'https://events-static.jongedemocraten.nl/'
34+
35+
# Janeus settings
36+
37+
JANEUS_SERVER = "ldap://127.0.0.1:389/"
38+
JANEUS_DN = "cn=readuser, ou=sysUsers, dc=jd, dc=nl"
39+
JANEUS_PASS = ""
40+
JANEUS_AUTH = lambda user, groups: "role-team-ict" in groups or "role-bestuur-landelijk" in groups
41+
from django.db.models import Q
42+
JANEUS_AUTH_PERMISSIONS = lambda user,groups: Q(content_type__app_label='subscribe')
43+
AUTHENTICATION_BACKENDS = ('janeus.backend.JaneusBackend', 'django.contrib.auth.backends.ModelBackend',)
44+
45+
46+
# Dyonisos specific configuration
47+
48+
MOLLIE = { # Mollie config
49+
'partner_id': 0, # Mollie.nl accountnummer
50+
'profile_key': '',
51+
'report_url': 'https://events.jongedemocraten.nl/report/',
52+
'return_url': 'https://events.jongedemocraten.nl/return/',
53+
'testmode': 'false'
54+
}

events/settings_default.py events/settings.py

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Django settings for Dyonisos project.
2+
# use local_setings.py to configure local settings
23

34
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
45
import os
@@ -8,11 +9,15 @@
89
SECRET_KEY = ''
910

1011
# SECURITY WARNING: don't run with debug turned on in production!
11-
DEBUG = True
12-
TEMPLATE_DEBUG = True
12+
DEBUG = False
13+
TEMPLATE_DEBUG = False
1314

1415
ALLOWED_HOSTS = []
1516

17+
ADMINS = (
18+
('name', 'name@domain.com'),
19+
)
20+
1621
# Application definition
1722

1823
INSTALLED_APPS = (
@@ -45,8 +50,8 @@
4550
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
4651
DATABASES = {
4752
'default': {
48-
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
49-
'NAME': '', # Or path to database file if using sqlite3.
53+
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
54+
'NAME': 'dev.sqlite', # Or path to database file if using sqlite3.
5055
'USER': '', # Not used with sqlite3.
5156
'PASSWORD': '', # Not used with sqlite3.
5257
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
@@ -118,14 +123,6 @@
118123
}
119124
}
120125

121-
# Dyonisos specific configuration
122-
123-
MOLLIE = { # Mollie config
124-
'partner_id': 0, # Mollie.nl accountnummer
125-
'profile_key': 0,
126-
'report_url': 'https://events.jongedemocraten.nl/report/',
127-
'return_url': 'https://events.jongedemocraten.nl/return/',
128-
'testmode': 'false'
129-
}
130126

127+
from local_settings import *
131128

0 commit comments

Comments
 (0)