Flask app that lists WordPress or Tumblr posts as a dictionary.
Requirements:
- Python
- virtualenv
- Postgres (or other local database)
- foreman (or the Heroku Toolbelt)
$ virtulenv env
$ source env/bin/activate
$ pip install -r requirements.txt
$ cp .env.sample .env
Set your blog info (and, for Tumblr, API key) in the .env file.
Create a local database:
$ createdb metonymic-dev
Set the DATABASE_URL appropriately in your .env file:
DATABASE_URL=postgresql://localhost/metonymic-dev
Load the local database schema:
$ foreman run python
>>> from metonymic import database
>>> database.init_db()
Then, do the initial load of blog info and posts (this might take a few minutes if you have many posts):
$ foreman run python
>>> from metonymic import helpers
>>> helpers.load_blog_info()
>>> helpers.load_posts()
Start foreman, and visit your development server at http://localhost:5000
$ foreman start
Note: gunicorn prevents Flask from displaying a full trace. For debugging, it's easier to run Flask without gunicorn:
$ foreman run python runserver.py