Skip to content

Instantly share code, notes, and snippets.

View officestarmb's full-sized avatar
🎯
Focusing

Bogdan officestarmb

🎯
Focusing
View GitHub Profile
@mayukh18
mayukh18 / flask_setup_heroku.md
Created September 28, 2017 19:38
How to setup flask app with database on heroku

Setting up flask app in heroku with a database

The below article will cover the intricacies of setting up databases and heroku in respect to a flask app. This is more like a memo and will have out of sequence instructions or solutions to errors so read thoroughly.

Setting up a database

You'll need the packages

@macloo
macloo / local_db_setup.py
Created April 15, 2016 00:13
If you have a MySQL database in XAMPP, and you're running a Flask app locally that needs to connect to that database, this works.
#!/Users/username/Documents/python/projectname/env/bin/python
# edit line 1 to match what YOU get when you are in YOUR virtualenv and type: which python
# NO SPACES in first 3 chars in line 1: #!/
# make sure env is activated!
# make sure you have "started all" in XAMPP!
# code below works for a MySQL database in XAMPP on Mac OS
# pymysql can be installed with pip: pip install PyMySQL
import pymysql