diff --git a/.flaskenv b/.flaskenv new file mode 100644 index 0000000..f5b59b8 --- /dev/null +++ b/.flaskenv @@ -0,0 +1,4 @@ +FLASK_APP=strong_but_simple_passwords +FLASK_ENV=development + +SBSP_SECRET_KEY=something-secret diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7849652 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +venv/ +htmlcov/ +.coverage +__pycache__/ +*.egg-info diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..6069e45 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +graft strong_but_simple_passwords/templates diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..84569af --- /dev/null +++ b/setup.py @@ -0,0 +1,9 @@ +from setuptools import setup, find_packages + +setup( + name="strong-but-simple-passwords", + version="0.1.0", + packages=find_packages(), + include_package_data=True, + install_requires=["flask"], +) diff --git a/strong_but_simple_passwords/__init__.py b/strong_but_simple_passwords/__init__.py new file mode 100644 index 0000000..9ed42a4 --- /dev/null +++ b/strong_but_simple_passwords/__init__.py @@ -0,0 +1,16 @@ +from flask import Flask +from .config import get_config_from_env_vars +from . import views + + +def create_app(config=None): + app = Flask(__name__) + + if config is None: + config = get_config_from_env_vars() + + app.config.from_object(config) + + app.add_url_rule("/", "index", view_func=views.index) + + return app diff --git a/strong_but_simple_passwords/config.py b/strong_but_simple_passwords/config.py new file mode 100644 index 0000000..d4e1834 --- /dev/null +++ b/strong_but_simple_passwords/config.py @@ -0,0 +1,8 @@ +import os + + +def get_config_from_env_vars(): + class Config: + SECRET_KEY = os.environ["SBSP_SECRET_KEY"] + + return Config diff --git a/strong_but_simple_passwords/templates/index.html b/strong_but_simple_passwords/templates/index.html new file mode 100644 index 0000000..93eaf34 --- /dev/null +++ b/strong_but_simple_passwords/templates/index.html @@ -0,0 +1,13 @@ + + + +
+ +