Skip to content

Commit

Permalink
New features
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikbehl99 committed Nov 7, 2020
1 parent a38f213 commit 07a3e5a
Show file tree
Hide file tree
Showing 39 changed files with 1,614 additions and 761 deletions.
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
line_length = 88
multi_line_output = 3
include_trailing_comma = True
known_third_party = boto3,botocore,cryptography,flask,pytest,sqlalchemy,werkzeug
known_third_party = celery,cryptography,flask,pytest,requests,sqlalchemy,werkzeug,yaml
18 changes: 15 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
import logging

from flask import Flask, json
from werkzeug.exceptions import HTTPException

from ssh_manager_backend.config import routes
from ssh_manager_backend.db.database import db_session

app = Flask(__name__)

app.register_blueprint(routes.rsa_)
app.register_blueprint(routes.users_)


@app.teardown_appcontext
def shutdown_session() -> None:
def shutdown_session(*args) -> None:
"""
Shuts down database session on application close
Args:
*args:
:return: None
"""

db_session.remove()


@app.errorhandler(HTTPException)
@app.errorhandler(Exception)
def handle_exception(e):
"""Return JSON instead of HTML for HTTP errors."""
# start with the correct headers and status code from the error
Expand All @@ -34,4 +43,7 @@ def handle_exception(e):


if __name__ == "__main__":
logging.basicConfig(format="%(asctime)s %(message)s")
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
app.run(host="0.0.0.0", port=5000, debug=True, threaded=True)
7 changes: 4 additions & 3 deletions ssh_manager_backend/app/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ssh_manager_backend.app.controllers import api
from ssh_manager_backend.app.controllers.key import Key
from ssh_manager_backend.app.controllers import api_controller

# from ssh_manager_backend.app.controllers.key import Key
from ssh_manager_backend.app.controllers.secrets import Secrets
from ssh_manager_backend.app.controllers.user import User
from ssh_manager_backend.app.controllers.user_controller import UserController
Loading

0 comments on commit 07a3e5a

Please sign in to comment.