Skip to content
Snippets Groups Projects
Commit 868ca224 authored by Thomas Schneider's avatar Thomas Schneider
Browse files

Allow overriding instance directory location

parent 49072b8e
Branches
No related tags found
No related merge requests found
Pipeline #7131 passed
...@@ -150,10 +150,12 @@ Configuration ...@@ -150,10 +150,12 @@ Configuration
------------- -------------
Configuration and runtime data is stored in the instance directory. For Configuration and runtime data is stored in the instance directory. For
container installs, this is ``/usr/local/var/schilder2000-instance/``. container installs, this is ``/usr/local/var/schilder2000-instance/``. For
For package installs, this is ``{{ python prefix }}/var/schilder2000-instance``; package installs, this defaults to ``{{ python prefix
if in doubt, try to run ``flask -A schilder2000``, the error should tell you }}/var/schilder2000-instance``; if in doubt, try to run ``flask -A
where it expects the instance directory. schilder2000``, the error should tell you where it expects the instance
directory. To override, specify an *absolute* path in the
``SCHILDER2000_INSTANCE_PATH`` environment variable.
Example config and data is located in the ``examples`` directory. The templates Example config and data is located in the ``examples`` directory. The templates
there get their footer text and logo from the application config and should also there get their footer text and logo from the application config and should also
......
import os
from pathlib import Path from pathlib import Path
from flask_multipass import Multipass from flask_multipass import Multipass
...@@ -15,7 +16,11 @@ multipass = Multipass() ...@@ -15,7 +16,11 @@ multipass = Multipass()
def create_app(): def create_app():
app = Flask(__name__, instance_relative_config=True) app = Flask(
__name__,
instance_path=os.getenv("SCHILDER2000_INSTANCE_PATH"),
instance_relative_config=True,
)
app.config.from_pyfile("config/config.py") app.config.from_pyfile("config/config.py")
app.cli.add_command(cli.alembic) app.cli.add_command(cli.alembic)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment