mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-15 04:13:33 -06:00
begin adding base configuration
yeah this is totally copied from xevion.dev
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,6 @@
|
|||||||
|
# Repository specific
|
||||||
|
.vscode/**
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# Main Flask and Flask configs
|
||||||
|
from flask import Flask
|
||||||
|
from config import Config
|
||||||
|
# Flask Extensions
|
||||||
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
|
from flask_migrate import Migrate
|
||||||
|
from flask_login import LoginManager
|
||||||
|
from flask_limiter import Limiter
|
||||||
|
from flask_limiter.util import get_remote_address
|
||||||
|
|
||||||
|
# App & App config setup
|
||||||
|
app = Flask(__name__)
|
||||||
|
app.config.from_object(Config)
|
||||||
|
app.url_map.strict_slashes = False
|
||||||
|
# App extension setup
|
||||||
|
login = LoginManager(app)
|
||||||
|
login.login_view = 'login'
|
||||||
|
db = SQLAlchemy(app)
|
||||||
|
migrate = Migrate(app, db)
|
||||||
|
limiter = Limiter(app, key_func=get_remote_address, default_limits=["10 per second"])
|
||||||
|
|
||||||
|
from app import models
|
||||||
|
from app import routes, simple_routes, hidden, dashboard
|
||||||
|
from app import ftbhot, custom, spotify, panzer, sound
|
||||||
17
config.py
17
config.py
@@ -0,0 +1,17 @@
|
|||||||
|
import os, json
|
||||||
|
|
||||||
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
keys = json.load(open(os.path.join(basedir, 'keys.json'), 'r'))
|
||||||
|
|
||||||
|
class Config(object):
|
||||||
|
SECRET_KEY = keys['SECRET_KEY']
|
||||||
|
HIDDEN_NUMBER = keys['HIDDEN_NUMBER']
|
||||||
|
TEMPLATES_AUTO_RELOAD=True
|
||||||
|
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
|
||||||
|
'sqlite:///' + os.path.join(basedir, 'app.db')
|
||||||
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||||
|
# Flask-User settings
|
||||||
|
USER_APP_NAME = "Xevion.dev" # Shown in and email templates and page footers
|
||||||
|
USER_ENABLE_EMAIL = False # Disable email authentication
|
||||||
|
USER_ENABLE_USERNAME = True # Enable username authentication
|
||||||
|
USER_REQUIRE_RETYPE_PASSWORD = True
|
||||||
Reference in New Issue
Block a user