-
Notifications
You must be signed in to change notification settings - Fork 8
Explore the FAB Quick Start Utility
Use this page to explore fab-quick-start, the command line utility to generate fab views.py
files.
The fab_quick-start
project contains 2 main folders - see the screen shot below:
-
nw
: is a fab project for a sqlite version northwind (nw), for illustration and testing. It was built using the QuickStart procedure. -
fab_quick_start_util/fab_quick_start.py
code
To get started, you will need:
- Python3: run the windows installer; on mac/Unix, consider using brew
- virtualenv - see here (e.g.,
pip install virtualenv
) - An IDE - any will do (I've used PyCharm and VSCode, install notes here) - ide will do, though different install / generate / run instructions apply for running programs
Issues? Try here
Get the project. First fork it on GitHub, then clone:
git clone https://github.com/valhuber/fab-quick-start.git
In VSCode Python Debug Console:
cd fab-quick-start
virtualenv venv
# windows: .\venv\Scripts\activate
source venv/bin/activate
pip install -r requirements.txt
In VSCode, you must also choose your Python Interpreter (e.g., .\venv\bin\python
).
Note: Windows Powershell requires privileges as described here
Then, in VSCode, select and run Launch Config: fab-quick-start run
.
Or, in a terminal window:
cd nw-app
python ../fab_quick_start_util/fab_quick_start.py run
Copy the console output over the nw-app/app/views.py
file.
In a terminal window:
cd nw
export FLASK_APP=app
flask run
Login as admin
, p
It's advisable to test the PyPi install process locally before using the test systems. We have seen many issues in Python Path not getting set.
Prepare the distribution:
cd fab-quick-start
deactivate
python3 setup.py sdist bdist_wheel
Then, from a test project, install from the local dist (e.g., /Users/val/python/pycharm/fab-quick-start
)
source venv/bin/activate
pip install -e /Users/val/python/pycharm/fab-quick-start
Since fab-quick-start
is normally run via the command line, we must deploy to the PyPi site.
Using this reference...
Acquire the setup software (initial, 1-time setup):
cd fab-quick-start
deactivate
python setup.py install
python3 -m pip install --user --upgrade twine
python3 -m pip install --user --upgrade setuptools wheel
Creating the dist
, first time
Get a Saved API Key
cd fab-quick-start
deactivate
python3 setup.py sdist bdist_wheel
# verify this produced the dist folder; next command uploads to test Pypi
python3 -m twine upload --repository testpypi dist/*
User is __token__
, pwd is Saved API Key (from above).
This should upload to the test Pypi site
To re-upload:
- Delete the
dist
folder (andbuild
, and.egg
) - Alter the version number in
setup.py
deactivate
python3 setup.py sdist bdist_wheel
python3 -m twine upload --skip-existing --repository testpypi dist/*
To install (beware - may require 15 mins until new version is active.
source venv/bin/activate
pip uninstall fab-quick-start
pip install -i https://test.pypi.org/simple/ fab-quick-start
cd nw-app
val@valMbp nw-app % fab-quick-start --help
Once you've verified it on testpypi, production deploy is:
python3 -m twine upload --u vhuber --p ??? dist/*