コード例 #1
0
ファイル: test_converters.py プロジェクト: jameysharp/dcon
    def setUp(self):
        self.app = Flask(__name__)
        self.app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite://"
        self.converter_cls = make_model_converter(self.app, Newspost, "time")
        self.converter = self.converter_cls(None)

        db.init_app(self.app)
        with self.app.test_request_context():
            db.create_all()
コード例 #2
0
ファイル: main.py プロジェクト: jameysharp/dcon
if wd is None:
    wd = os.getcwd()

wd = FilePath(wd)

app.debug = True

# This default should be sufficient to limp along for starters.
app.config["DCON_STATIC_URL"] = "/static/"

app.config["DCON_PATH"] = wd
app.config["DCON_PASSWORD_FILE"] = wd.child("passwords.dcon")
app.config["DCON_UPLOAD_PATH"] = wd.child("uploads")
app.config["SECRET_KEY"] = wd.child("secret.key").open("rb").read()

app.config["UPLOADS_DEFAULT_DEST"] = app.config["DCON_UPLOAD_PATH"].path
app.config["SESSION_PROTECTION"] = None

load_config(app)

configure_uploads(app, (images,))
patch_request_class(app)

db.init_app(app)
lm.setup_app(app)

app.register_blueprint(users)
app.register_blueprint(admin, url_prefix="/admin")
app.register_blueprint(comics)
app.register_blueprint(osuchan, url_prefix="/chan")