-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfig.py.example
More file actions
132 lines (118 loc) · 5.88 KB
/
config.py.example
File metadata and controls
132 lines (118 loc) · 5.88 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import locale
import os
from datetime import datetime
# On a new deployment (whether production or development) make
# a copy of this file called 'config.py' and change 'False' for
# SECRET_KEY to a newly generated string using these python commands:
# $ import os
# $ os.urandom(32)
# Same for CACHE_PURGE_KEY, which can only contain lowercase letters:
# $ import secrets
# $ import string
# $ ''.join(secrets.choice(string.ascii_lowercase) for _ in range(32))
basedir = os.path.abspath(os.path.dirname(__file__))
locale.setlocale(locale.LC_NUMERIC, 'nl_NL.UTF-8')
locale.setlocale(locale.LC_TIME, 'nl_NL.UTF-8')
class Config(object):
SESSION_COOKIE_SAMESITE = "Strict"
SECRET_KEY = False
SERVER_NAME = 'waarismijnstemlokaal.nl'
PREFERRED_URL_SCHEME = 'https'
FORCE_HOST_FOR_REDIRECTS = 'waarismijnstemlokaal.nl'
USE_SESSION_FOR_NEXT = True
SESSION_2FA_CONFIRMED_NAME = '2fa_confirmed'
SESSION_2FA_LAST_ATTEMPT = '2fa_last_attempt'
CACHE_PURGE_KEY = False
BABEL_DEFAULT_LOCALE = 'nl'
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:<DB_PASSWORD>@mysql:3306/stembureaus'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False # Set to True to see SQL statements created
# If 'False', allows gemeenten to add stembureaus. Set to 'True' once the
# election day has passed as gemeenten are not allowed to add/edit
# stembureaus anymore.
UPLOAD_DEADLINE_PASSED = False
# Path for waarismijnstemlokaal.nl/<SIGNUP_FORM_PATH>
SIGNUP_FORM_PATH = ''
# Title for waarismijnstemlokaal.nl/<SIGNUP_FORM_PATH>
SIGNUP_FORM_TITLE = ''
# The signup form can have these three states:
# 'open-collecting': Before Wims is ready for gemeenten to be invited and
# enter their stembureaus we already want to collect as
# many of their email addresses as possible, so the form
# is opened up. We simply store the email addresses
# entered during this phase in app/data/signup_form.csv
# which is later used when the invites are sent.
# 'open-mailing': Once all the gemeenten are invited and allowed to enter
# their stembureaus, we still keep this form open. If a new
# email address is entered we don't write it to the .csv
# but directly add the user to the database and send out an
# invitation email.
# 'closed': Once the gemeenten can no longer change their stembureaus (so a
# few days before the election or on/directly after the election)
# we also want to close this form so no new signups are possible.
SIGNUP_FORM_STATE = ''
CKAN_URL = ''
CKAN_API_KEY = ''
# List the resource IDs of the elections which are allowed to be
# edited. The ID can be found in the CKAN URL of the resource, e.g.
# https://ckan.dataplatform.nl/dataset
# /stembureaus-nederland-gemeenteraadsverkiezingen-2018/resource
# /2fc13394-c2fc-4492-843c-cba07e4bf8f5.
# 'publish_resource' contains the IDs of resources
# of upcoming elections where the stemlokalen data will be made
# public, while the 'draft_resource' contains the IDs of
# resources where drafts of the stemlokalen data will be saved while
# the gemeenten input all the information. For 'election_number'
# fill in a unique number of this election in the format '001',
# '002', etc. Check the 'election_number' of the previous
# election and increment it with 1 to get the election number of
# this election. For 'election_date' fill in the date of the
# election in 'YYYYMMDD' format, e.g. '20180321'.
# NOTE 1: Use the exact same '<name of election>' values in
# the 'verkiezingen' field in 'app/data/gemeenten.json'
# NOTE 2: Make sure to capitalize the Provinciale Stateverkiezingen,
# Tweede Kamerverkiezingen and Europese Parlementsverkiezingen and don't
# capitalize the other elections
ELECTION_DATE = '<date_of_this_election>' # Format YYYY-MM-DD e.g. 2025-02-19
ELECTION_DATE_LONG = datetime.strptime(ELECTION_DATE, "%Y-%m-%d").date().strftime("%-d %B %Y")
ELECTION_DATE_DAY_MONTH = datetime.strptime(ELECTION_DATE, "%Y-%m-%d").date().strftime("%-d %B")
# ELECTION_TYPE options: 'Tweede Kamerverkiezingen'
# 'gemeenteraadsverkiezingen'
# 'Provinciale Statenverkiezingen'
# 'kiescollegeverkiezingen'
# 'eilandsraadsverkiezingen'
# 'Europese Parlementsverkiezingen'
# 'waterschapsverkiezingen'
ELECTION_TYPE = '<election_type>'
PREVIOUS_ELECTION_DATE = '<date_of_previous_election>' # Format YYYY-MM-DD e.g. 2025-02-19
PREVIOUS_ELECTION_DATE_LONG = datetime.strptime(PREVIOUS_ELECTION_DATE, "%Y-%m-%d").date().strftime("%-d %B %Y")
PREVIOUS_ELECTION_DATE_DAY_MONTH = datetime.strptime(PREVIOUS_ELECTION_DATE, "%Y-%m-%d").date().strftime("%-d %B")
PREVIOUS_ELECTION_TYPE = '<election_type>'
CKAN_CURRENT_ELECTIONS = {
f'{ELECTION_TYPE} 2025': {
'publish_resource': '<ID_of_resource>',
'draft_resource': '<ID_of_resource>',
'election_number': '<unique_number_for_this_election>',
'election_date': ELECTION_DATE.replace('-', '')
}
}
# Stembureaumanager URL and API key
STEMBUREAUMANAGER_BASE_URL = ''
STEMBUREAUMANAGER_API_KEY = ''
# TSA URL and API Key
TSA_BASE_URL = ''
TSA_API_KEY = ''
# Procura URL and API Key
PROCURA_BASE_URL = ''
PROCURA_API_KEY = ''
# Mail configuration
MAIL_SERVER = ''
MAIL_PORT = ''
MAIL_USE_TLS = True
MAIL_USERNAME = ''
MAIL_PASSWORD = ''
FROM = 'Naam <email address>'
ADMINS = ['']
# Monitoring settings
MAX_GEMEENTEN_PER_USER = 5
MAX_GEMEENTEN_PER_USER_EXCEPTIONS = []