From 1f9ef5ba780b4419cc42679d77f11882060fb1e2 Mon Sep 17 00:00:00 2001 From: Jeremy Epstein Date: Sun, 28 Aug 2016 17:52:21 +1000 Subject: [PATCH] move autoapp to project root, update readme, update travis file --- {{cookiecutter.app_name}}/.travis.yml | 4 +-- {{cookiecutter.app_name}}/README.rst | 31 +++++++------------ .../autoapp.py | 0 3 files changed, 13 insertions(+), 22 deletions(-) rename {{cookiecutter.app_name}}/{{{cookiecutter.app_name}} => }/autoapp.py (100%) diff --git a/{{cookiecutter.app_name}}/.travis.yml b/{{cookiecutter.app_name}}/.travis.yml index c91b1d9..e5f5f13 100644 --- a/{{cookiecutter.app_name}}/.travis.yml +++ b/{{cookiecutter.app_name}}/.travis.yml @@ -7,5 +7,5 @@ python: - 3.4 - 3.5 install: pip install -r requirements/dev.txt -before_script: python manage.py lint -script: python manage.py test +before_script: flask lint +script: flask test diff --git a/{{cookiecutter.app_name}}/README.rst b/{{cookiecutter.app_name}}/README.rst index 4c43557..895deec 100644 --- a/{{cookiecutter.app_name}}/README.rst +++ b/{{cookiecutter.app_name}}/README.rst @@ -14,38 +14,31 @@ First, set your app's secret key as an environment variable. For example, exampl export {{cookiecutter.app_name | upper}}_SECRET='something-really-secret' +Before running shell commands, set the ``FLASK_APP`` environment variable :: -Then run the following commands to bootstrap your environment. - + export FLASK_APP=/path/to/autoapp.py -:: +Then run the following commands to bootstrap your environment :: git clone https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.app_name}} cd {{cookiecutter.app_name}} pip install -r requirements/dev.txt bower install - python manage.py server + flask run You will see a pretty welcome screen. -Once you have installed your DBMS, run the following to create your app's database tables and perform the initial migration: - -:: - - python manage.py db init - python manage.py db migrate - python manage.py db upgrade - python manage.py server +Once you have installed your DBMS, run the following to create your app's database tables and perform the initial migration :: + flask db init + flask db migrate + flask db upgrade + flask run Deployment ---------- -Before running shell commands, set the ``FLASK_APP`` environment variable :: - - export FLASK_APP="{{cookiecutter.app_name}}.autoapp" - In your production environment, make sure the ``{{cookiecutter.app_name|upper}}_ENV`` environment variable is set to ``"prod"``. @@ -70,13 +63,11 @@ To run all tests, run :: Migrations ---------- -Whenever a database migration needs to be made. Run the following commands: -:: +Whenever a database migration needs to be made. Run the following commands :: flask db migrate -This will generate a new migration script. Then run: -:: +This will generate a new migration script. Then run :: flask db upgrade diff --git a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/autoapp.py b/{{cookiecutter.app_name}}/autoapp.py similarity index 100% rename from {{cookiecutter.app_name}}/{{cookiecutter.app_name}}/autoapp.py rename to {{cookiecutter.app_name}}/autoapp.py