-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
executable file
·57 lines (41 loc) · 1.81 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
'''Config file for application.'''
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config():
'''Config class for application.'''
PROJECT_NAME = 'Review'
SECRET_KEY = os.environ.get('SECRET_KEY') or 'supersecretkey'
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'data.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False
# Extend csrf token expiry to 1 week
# Note: If set to None, the CSRF token is valid for the life of the session
WTF_CSRF_TIME_LIMIT = 3600 * 24 * 7
# To address cookie security
SESSION_COOKIE_SECURE = True
REMEMBER_COOKIE_SECURE = True
# For sending emails:
MAIL_SERVER = os.environ.get('MAIL_SERVER')
MAIL_PORT = int(os.environ.get('MAIL_PORT') or 25)
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
# For receiving emailed error log, contact emails:
ADMINS = [os.environ.get('ADMIN')]
# This email address is used for the following:
# - will be used as the sender for the password reset emails
HOSTNAME_EMAIL = '[email protected]'
# The api url for a github repo containing files to be studied:
API_START = 'https://api.github.com/repos/'
API_END = '/contents'
# The url for particular file in a repo:
URL_START = 'https://github.com/'
URL_END = '/blob/master/'
# Repo API url should look like:
# https://api.github.com/repos/jessicarush/python-notes/contents
# Repo urls look like:
# https://github.com/jessicarush/python-notes
# File urls look like:
# https://github.com/jessicarush/python-notes/blob/master/classes.py