https://github.com/pybites/pytip
Building a Simple Web App With Bottle, SQLAlchemy, and the Twitter API
https://github.com/pybites/pytip
Last synced: about 2 months ago
JSON representation
Building a Simple Web App With Bottle, SQLAlchemy, and the Twitter API
- Host: GitHub
- URL: https://github.com/pybites/pytip
- Owner: pybites
- Created: 2017-10-28T11:32:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-26T08:23:12.000Z (almost 2 years ago)
- Last Synced: 2025-03-22T17:11:38.312Z (3 months ago)
- Language: Python
- Homepage: https://realpython.com/building-a-simple-web-app-with-bottle-sqlalchemy-twitter-api/
- Size: 215 KB
- Stars: 46
- Watchers: 4
- Forks: 37
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Daily Python Tips
[](https://bettercodehub.com/)
App built for [Code Challenge 40 - Daily Python Tip Part 1 - Make a Web App](https://pybit.es/codechallenge40.html)
I deployed it to [https://pytip.herokuapp.com](https://pytip.herokuapp.com)

## Setup
To run this app locally:
* Create a virtual env
* Create a DB called *pytip* (I use Postgres)
* Add env variables to venv/bin/activate:* Twitter API: CONSUMER_KEY / CONSUMER_SECRET / ACCESS_TOKEN / ACCESS_SECRET
* DATABASE_URL = 'postgres://user:pw@localhost:5432/pytip' (tests use pytip_tests)
* If your run it on Heroku set APP_LOCATION to *heroku* (similar deployment instructions as [prchecker](https://github.com/pybites/prchecker))* Install the dependencies:
pip install -r requirements.txt
* Get the [python_tip](https://twitter.com/python_tip) tweets:
(venv) $ python tasks/import_tweets.py
* To run the tests create a postgres DB called *pytip_test*, then:
(venv) $ pytest
=== test session starts ===
platform darwin -- Python 3.6.1, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /Users/bbelderb/Documents/code/pytip, inifile:
collected 5 itemstests/test_tasks.py .
tests/test_tips.py ....=== 5 passed in 1.04 seconds ===
* Run the Bottle app:
(venv) $ python app.py
Bottle v0.12.13 server starting up (using WSGIRefServer())...
Listening on http://localhost:8080/
Hit Ctrl-C to quit.* Enjoy!