-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
55 lines (39 loc) · 1.73 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 26 16:55:34 2018
@author: joseph
"""
from dotenv import load_dotenv
import os
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config(object):
'''
Configuration class for pygempick web application.
'''
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
#allows you to deploy web app on linux based cloud server
#SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
#'mysql+pymysql://jmarsil:Revl*2018@localhost/pypick'
# use the following code below to deploy on a virtual server on mac/linux...
# 'sqlite:///' + os.path.join(basedir, 'app.db')
'''
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://username:password@localhost/db_name'
https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/miguelgrinberg/microblog/tree/v0.22/deployment
https://stackoverflow.com/questions/27766794/switching-from-sqlite-to-mysql-with-flask-sqlalchemy
'''
SQLALCHEMY_TRACK_MODIFICATIONS = False
POSTS_PER_PAGE = 25
DOWNLOADS_PER_PAGE = 10
# sets Mail server settings of web application
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')
ADMINS = ['[email protected]']
LANGUAGES = ['en', 'en-CA', 'fr']
# sets the redis task manager for task processing
REDIS_URL = os.environ.get('REDIS_URL') or 'redis://'