-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
39 lines (30 loc) · 1.06 KB
/
config.py
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
from datetime import datetime
# SET START and END date of voting
# Needs to be in dd/mm/yyyy format
V_START_DATE = "28/11/2019 09:00:00"
# Needs to be in dd/mm/yyyy format
V_END_DATE = "28/11/2019 09:00:00"
def parse_datetime(dt_string):
"""
parses the dt in dd/mm/yyyy format
:param dt_string:
:return: parsed dt
"""
return datetime.strptime(dt_string, "%d/%m/%Y %H:%M:%S")
class Config(object):
DEBUG = False
TESTING = False
SECRET_KEY = '\x88\xbf\xaa[\xa9\xc6\x8f\x8c x\x9bV\xe1C\x0e\n\xe9\x1c`\xc0\xa3\xd8\xcd\xc3' # to keep client sides ewcure
VOTING_START_DATE = parse_datetime(V_START_DATE)
VOTING_END_DATE = parse_datetime(V_END_DATE)
NO_FACULTY_OFFICERS_POSITION = ("Faculty Officer", 16)
NO_PRESIDENT_POSITION = ("President", 1)
NO_GSU_OFFICERS_POSITION = ("GSU Officers", 3)
NO_CANDIDATES_PER_POSITION = 4
ZODB_STORAGE = 'file://./local_database/votes.fs'
class ProductionConfig(Config):
# same as the base class
pass
class DevelopmentConfig(Config):
DEBUG = True
TESTING = True