You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
from pathlib import Path
|
|
from json import loads
|
|
from secrets import token_urlsafe
|
|
from os import getenv
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
|
|
load_dotenv()
|
|
|
|
# Site meta
|
|
SITE_NAME = getenv('SITE_NAME', 'Flipbook')
|
|
SECRET_KEY = getenv('SECRET_KEY', token_urlsafe(12))
|
|
SERVER_NAME = getenv('SERVER_NAME', '127.0.0.1:5000')
|
|
|
|
# Web3
|
|
WEB3_PROVIDER_URI = getenv('WEB3_PROVIDER_URI')
|
|
CONTRACT_ABI = loads(Path('flipbook/library/abi/flipbook.json').open().read())
|
|
CONTRACT_ADDRESS = getenv('CONTRACT_ADDRESS')
|
|
|
|
# Uploads
|
|
MAX_CONTENT_LENGTH = 50 * 1024 * 1024
|
|
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'svg'}
|
|
UPLOADS_PATH = getenv('UPLOADS_PATH', 'data/uploads')
|
|
SESSION_LIFETIME = getenv('SESSION_LIFETIME', 60 * 60 * 24)
|
|
|
|
# Development
|
|
TEMPLATES_AUTO_RELOAD = True
|
|
DEBUG = False
|
|
if SERVER_NAME == '127.0.0.1:5000':
|
|
DEBUG = True
|
|
|
|
# Twitter
|
|
TWITTER_CONSUMER_KEY = getenv('TWITTER_CONSUMER_KEY', None)
|
|
TWITTER_CONSUMER_SECRET = getenv('TWITTER_CONSUMER_SECRET', None)
|
|
TWITTER_ACCESS_TOKEN = getenv('TWITTER_ACCESS_TOKEN', None)
|
|
TWITTER_ACCESS_SECRET = getenv('TWITTER_ACCESS_SECRET', None) |