2010-04-14 16:47:53 +02:00
|
|
|
/ Flaskr /
|
|
|
|
|
|
|
|
|
|
a minimal blog application
|
|
|
|
|
|
|
|
|
|
|
2010-04-14 17:09:34 +02:00
|
|
|
~ What is Flaskr?
|
2010-04-14 16:47:53 +02:00
|
|
|
|
|
|
|
|
A sqlite powered thumble blog application
|
|
|
|
|
|
|
|
|
|
~ How do I use it?
|
|
|
|
|
|
2010-05-27 21:17:25 +02:00
|
|
|
1. edit the configuration in the flaskr.py file or
|
|
|
|
|
export an FLASKR_SETTINGS environment variable
|
|
|
|
|
pointing to a configuration file.
|
2010-04-14 16:47:53 +02:00
|
|
|
|
2016-07-05 20:30:59 -04:00
|
|
|
2. install the app from the root of the project directory
|
2014-04-29 01:48:31 +02:00
|
|
|
|
2016-07-05 20:30:59 -04:00
|
|
|
pip install --editable .
|
2014-04-29 01:48:31 +02:00
|
|
|
|
2016-07-05 20:30:59 -04:00
|
|
|
3. Instruct flask to use the right application
|
|
|
|
|
|
2016-08-31 12:37:36 -04:00
|
|
|
export FLASK_APP=flaskr
|
2016-07-05 20:30:59 -04:00
|
|
|
|
|
|
|
|
4. initialize the database with this command:
|
2014-04-29 01:48:31 +02:00
|
|
|
|
2016-05-26 20:45:50 +02:00
|
|
|
flask initdb
|
|
|
|
|
|
2016-07-05 20:30:59 -04:00
|
|
|
5. now you can run flaskr:
|
2016-05-26 20:45:50 +02:00
|
|
|
|
|
|
|
|
flask run
|
2014-04-29 01:48:31 +02:00
|
|
|
|
|
|
|
|
the application will greet you on
|
|
|
|
|
http://localhost:5000/
|
2014-11-05 06:45:22 +03:00
|
|
|
|
2010-04-14 16:47:53 +02:00
|
|
|
~ Is it tested?
|
|
|
|
|
|
2016-07-05 20:30:59 -04:00
|
|
|
You betcha. Run `python setup.py test` to see
|
2010-04-14 16:47:53 +02:00
|
|
|
the tests pass.
|