Browse Source

Drop python-dotenv and load straight form Pipenv + xppl.config.

ansible-setup-and-deploy
decentral1se 3 years ago
parent
commit
0c35a4a008
No known key found for this signature in database GPG Key ID: 5E2EF5A63E3718CC
  1. 1
      Pipfile
  2. 10
      Pipfile.lock
  3. 9
      xppl/app.py
  4. 3
      xppl/config.py

1
Pipfile

@ -15,7 +15,6 @@ flask-wtf = "*"
gunicorn = "*"
marshmallow = "*"
pyrqlite = {git = "https://github.com/rqlite/pyrqlite.git"}
python-dotenv = "*"
requests = "*"
sqlalchemy-rqlite = {git = "https://github.com/rqlite/sqlalchemy-rqlite.git"}
wand = "*"

10
Pipfile.lock

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "61237413ec4bbfe6f01892041e07854eee51ea334dbb78852c065c9cd50b4536"
"sha256": "a35be8aef6002cbae949a73ffb88c1b482994149c663455c3f31421cd465d388"
},
"pipfile-spec": 6,
"requires": {},
@ -333,14 +333,6 @@
"git": "https://github.com/rqlite/pyrqlite.git",
"ref": "f8cd41e0522af36a234088b3c876ccfc5078f662"
},
"python-dotenv": {
"hashes": [
"sha256:122290a38ece9fe4f162dc7c95cae3357b983505830a154d3c98ef7f6c6cea77",
"sha256:4a205787bc829233de2a823aa328e44fd9996fedb954989a21f1fc67c13d7a77"
],
"index": "pypi",
"version": "==0.9.1"
},
"python-engineio": {
"hashes": [
"sha256:306a91fda59e3678b34755f475ff6b5b3dc0deb0272a23e213f2f259b5602c4c",

9
xppl/app.py

@ -1,9 +1,8 @@
"""Main application factory."""
from os import makedirs
from os import makedirs, pardir
from os.path import exists
from dotenv import find_dotenv, load_dotenv
from flask import Flask
from sqlalchemy.dialects import registry
@ -13,7 +12,6 @@ def create_app(config):
app.config.from_object(config)
configure_dotenv()
configure_pyrqlite()
configure_socketio(app)
configure_sqlalchemy(app)
@ -34,11 +32,6 @@ def configure_pyrqlite():
)
def configure_dotenv():
"""Configure the environment."""
load_dotenv(find_dotenv())
def configure_sqlalchemy(app):
"""Configure SQLAlchemy."""
from xppl.database import db

3
xppl/config.py

@ -1,6 +1,6 @@
"""The Application settings."""
from os import urandom
from os import getenv, urandom
from os.path import abspath, dirname, isdir, join
BASEDIR = abspath(dirname(__file__))
@ -15,6 +15,7 @@ class Base():
UPLOAD_FOLDER_COVER = join(BASEDIR, 'cover')
UPLOAD_FOLDER = join(BASEDIR, 'uploads')
LIGHT = not isdir(UPLOAD_FOLDER)
SECRET_KEY = getenv('SECRET_KEY')
class Production(Base):

Loading…
Cancel
Save