From 20c72e3af037dafaf6addc4f1ff0c0763e298f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Cort=C3=A9s?= Date: Thu, 19 Nov 2020 03:15:09 -0300 Subject: [PATCH] Acomodados packages para funcionar con gunicorn --- __init__.py => home/__init__.py | 0 app.py => home/entry.py | 5 ++--- home/services/__init__.py | 1 + {services => home/services}/currency.py | 0 {services => home/services}/photos.py | 0 {services => home/services}/weather.py | 0 settings.py.example => home/settings.py.example | 0 services/__init__.py | 4 ---- wsgi.py | 4 ++++ 9 files changed, 7 insertions(+), 7 deletions(-) rename __init__.py => home/__init__.py (100%) rename app.py => home/entry.py (85%) create mode 100644 home/services/__init__.py rename {services => home/services}/currency.py (100%) rename {services => home/services}/photos.py (100%) rename {services => home/services}/weather.py (100%) rename settings.py.example => home/settings.py.example (100%) delete mode 100644 services/__init__.py create mode 100644 wsgi.py diff --git a/__init__.py b/home/__init__.py similarity index 100% rename from __init__.py rename to home/__init__.py diff --git a/app.py b/home/entry.py similarity index 85% rename from app.py rename to home/entry.py index 39594f8..06827c8 100644 --- a/app.py +++ b/home/entry.py @@ -1,8 +1,8 @@ from flask import Flask -from start import services +from . import services app = Flask(__name__) -app.config.from_object('start.settings') +app.config.from_object('home.settings') @app.route('/currency') def currency(): @@ -16,7 +16,6 @@ def weather(): def photos(): return services.photos.get(app.config['UNSPLASH_KEY']) - @app.route('/') def hello_world(): return 'Hello, World!' diff --git a/home/services/__init__.py b/home/services/__init__.py new file mode 100644 index 0000000..406e6b8 --- /dev/null +++ b/home/services/__init__.py @@ -0,0 +1 @@ +from . import currency, photos, weather diff --git a/services/currency.py b/home/services/currency.py similarity index 100% rename from services/currency.py rename to home/services/currency.py diff --git a/services/photos.py b/home/services/photos.py similarity index 100% rename from services/photos.py rename to home/services/photos.py diff --git a/services/weather.py b/home/services/weather.py similarity index 100% rename from services/weather.py rename to home/services/weather.py diff --git a/settings.py.example b/home/settings.py.example similarity index 100% rename from settings.py.example rename to home/settings.py.example diff --git a/services/__init__.py b/services/__init__.py deleted file mode 100644 index 50f8c7b..0000000 --- a/services/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from . import weather -from . import currency -from . import photos - diff --git a/wsgi.py b/wsgi.py new file mode 100644 index 0000000..be1cc22 --- /dev/null +++ b/wsgi.py @@ -0,0 +1,4 @@ +from home.entry import app + +if __name__ == '__main__': + app.run()