Drop python-dotenv and load straight form Pipenv + xppl.config.
This commit is contained in:
parent
83655165c1
commit
0c35a4a008
1
Pipfile
1
Pipfile
@ -15,7 +15,6 @@ flask-wtf = "*"
|
|||||||
gunicorn = "*"
|
gunicorn = "*"
|
||||||
marshmallow = "*"
|
marshmallow = "*"
|
||||||
pyrqlite = {git = "https://github.com/rqlite/pyrqlite.git"}
|
pyrqlite = {git = "https://github.com/rqlite/pyrqlite.git"}
|
||||||
python-dotenv = "*"
|
|
||||||
requests = "*"
|
requests = "*"
|
||||||
sqlalchemy-rqlite = {git = "https://github.com/rqlite/sqlalchemy-rqlite.git"}
|
sqlalchemy-rqlite = {git = "https://github.com/rqlite/sqlalchemy-rqlite.git"}
|
||||||
wand = "*"
|
wand = "*"
|
||||||
|
10
Pipfile.lock
generated
10
Pipfile.lock
generated
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"hash": {
|
"hash": {
|
||||||
"sha256": "61237413ec4bbfe6f01892041e07854eee51ea334dbb78852c065c9cd50b4536"
|
"sha256": "a35be8aef6002cbae949a73ffb88c1b482994149c663455c3f31421cd465d388"
|
||||||
},
|
},
|
||||||
"pipfile-spec": 6,
|
"pipfile-spec": 6,
|
||||||
"requires": {},
|
"requires": {},
|
||||||
@ -333,14 +333,6 @@
|
|||||||
"git": "https://github.com/rqlite/pyrqlite.git",
|
"git": "https://github.com/rqlite/pyrqlite.git",
|
||||||
"ref": "f8cd41e0522af36a234088b3c876ccfc5078f662"
|
"ref": "f8cd41e0522af36a234088b3c876ccfc5078f662"
|
||||||
},
|
},
|
||||||
"python-dotenv": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:122290a38ece9fe4f162dc7c95cae3357b983505830a154d3c98ef7f6c6cea77",
|
|
||||||
"sha256:4a205787bc829233de2a823aa328e44fd9996fedb954989a21f1fc67c13d7a77"
|
|
||||||
],
|
|
||||||
"index": "pypi",
|
|
||||||
"version": "==0.9.1"
|
|
||||||
},
|
|
||||||
"python-engineio": {
|
"python-engineio": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:306a91fda59e3678b34755f475ff6b5b3dc0deb0272a23e213f2f259b5602c4c",
|
"sha256:306a91fda59e3678b34755f475ff6b5b3dc0deb0272a23e213f2f259b5602c4c",
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
"""Main application factory."""
|
"""Main application factory."""
|
||||||
|
|
||||||
from os import makedirs
|
from os import makedirs, pardir
|
||||||
from os.path import exists
|
from os.path import exists
|
||||||
|
|
||||||
from dotenv import find_dotenv, load_dotenv
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from sqlalchemy.dialects import registry
|
from sqlalchemy.dialects import registry
|
||||||
|
|
||||||
@ -13,7 +12,6 @@ def create_app(config):
|
|||||||
|
|
||||||
app.config.from_object(config)
|
app.config.from_object(config)
|
||||||
|
|
||||||
configure_dotenv()
|
|
||||||
configure_pyrqlite()
|
configure_pyrqlite()
|
||||||
configure_socketio(app)
|
configure_socketio(app)
|
||||||
configure_sqlalchemy(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):
|
def configure_sqlalchemy(app):
|
||||||
"""Configure SQLAlchemy."""
|
"""Configure SQLAlchemy."""
|
||||||
from xppl.database import db
|
from xppl.database import db
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""The Application settings."""
|
"""The Application settings."""
|
||||||
|
|
||||||
from os import urandom
|
from os import getenv, urandom
|
||||||
from os.path import abspath, dirname, isdir, join
|
from os.path import abspath, dirname, isdir, join
|
||||||
|
|
||||||
BASEDIR = abspath(dirname(__file__))
|
BASEDIR = abspath(dirname(__file__))
|
||||||
@ -15,6 +15,7 @@ class Base():
|
|||||||
UPLOAD_FOLDER_COVER = join(BASEDIR, 'cover')
|
UPLOAD_FOLDER_COVER = join(BASEDIR, 'cover')
|
||||||
UPLOAD_FOLDER = join(BASEDIR, 'uploads')
|
UPLOAD_FOLDER = join(BASEDIR, 'uploads')
|
||||||
LIGHT = not isdir(UPLOAD_FOLDER)
|
LIGHT = not isdir(UPLOAD_FOLDER)
|
||||||
|
SECRET_KEY = getenv('SECRET_KEY')
|
||||||
|
|
||||||
|
|
||||||
class Production(Base):
|
class Production(Base):
|
||||||
|
Loading…
Reference in New Issue
Block a user