Skip to content
Snippets Groups Projects
Commit be62a0c1 authored by Martin Mareš's avatar Martin Mareš
Browse files

Config přesunut do mo/config.py

parent 706fc040
No related branches found
No related tags found
No related merge requests found
# Patří do mo/config.py
SQLALCHEMY_DATABASE_URI = "postgresql:///mo_osmo"
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False
# Vytvořte pomocí python3 -c 'import secrets; print(secrets.token_hex(32))'
SECRET_KEY = "FIXME"
SESSION_COOKIE_PATH = '/'
......
......@@ -367,7 +367,7 @@ def get_session() -> Session:
return flask_db.session
if _session is None:
if _engine is None:
import config
import mo.config as config
_engine = create_engine(config.SQLALCHEMY_DATABASE_URI, echo=config.SQLALCHEMY_ECHO)
MOSession = sessionmaker(bind=_engine)
_session = MOSession()
......
......@@ -2,7 +2,7 @@
from mo.tokens import sign_token, verify_token
import unittest
import config
import mo.config as config
class TestTokens(unittest.TestCase):
......
......@@ -4,7 +4,7 @@ import hmac
import urllib.parse
from typing import Optional, List
import config
import mo.config as config
def _sign_token(token: str, use: str) -> str:
......
......@@ -11,7 +11,7 @@ from typing import Any, Optional, NoReturn
import textwrap
import mo.db as db
import config
import mo.config as config
current_log_user: Optional[db.User] = None
......
......@@ -6,7 +6,7 @@ import locale
import logging
from flask_bootstrap import Bootstrap
import werkzeug.exceptions
import config # FIXME
import mo.config as config
import mo.db as db
import mo.users
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment