2018-05-17 16:18:20 +02:00
|
|
|
# Content DB
|
|
|
|
# Copyright (C) 2018 rubenwardy
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
2018-03-18 18:43:30 +01:00
|
|
|
from flask import *
|
|
|
|
from flask_user import *
|
2018-03-18 19:05:53 +01:00
|
|
|
import flask_menu as menu
|
2018-05-14 01:40:34 +02:00
|
|
|
from flask_mail import Mail
|
2018-03-18 19:05:53 +01:00
|
|
|
from flask.ext import markdown
|
|
|
|
from flask_github import GitHub
|
2018-05-13 19:37:57 +02:00
|
|
|
from flask_wtf.csrf import CsrfProtect
|
2018-05-14 15:46:41 +02:00
|
|
|
from flask_flatpages import FlatPages
|
2018-03-24 03:36:14 +01:00
|
|
|
import os
|
2018-03-18 18:43:30 +01:00
|
|
|
|
2018-05-25 16:23:55 +02:00
|
|
|
app = Flask(__name__, static_folder="public/static")
|
2018-05-14 15:46:41 +02:00
|
|
|
app.config["FLATPAGES_ROOT"] = "flatpages"
|
|
|
|
app.config["FLATPAGES_EXTENSION"] = ".md"
|
2018-03-24 03:36:14 +01:00
|
|
|
app.config.from_pyfile(os.environ["FLASK_CONFIG"])
|
2018-03-18 18:43:30 +01:00
|
|
|
|
2018-03-18 19:05:53 +01:00
|
|
|
menu.Menu(app=app)
|
2018-03-24 20:19:04 +01:00
|
|
|
markdown.Markdown(app, extensions=["fenced_code"], safe_mode=True, output_format="html5")
|
2018-03-18 19:05:53 +01:00
|
|
|
github = GitHub(app)
|
2018-05-13 19:37:57 +02:00
|
|
|
csrf = CsrfProtect(app)
|
2018-05-14 01:40:34 +02:00
|
|
|
mail = Mail(app)
|
2018-05-14 15:46:41 +02:00
|
|
|
pages = FlatPages(app)
|
2018-03-18 19:05:53 +01:00
|
|
|
|
2018-07-06 23:52:19 +02:00
|
|
|
if not app.debug:
|
|
|
|
from .maillogger import register_mail_error_handler
|
|
|
|
register_mail_error_handler(app, mail)
|
|
|
|
|
2018-05-11 13:57:16 +02:00
|
|
|
from . import models, tasks
|
2018-03-20 01:44:47 +01:00
|
|
|
from .views import *
|