Skip to content

Instantly share code, notes, and snippets.

View ericbarnhill's full-sized avatar

Eric Barnhill ericbarnhill

View GitHub Profile
import socks
import socket
import stem.process
def scrape_with_tor():
SOCKS_PORT=9050# You can change the port number
tor_process = stem.process.launch_tor_with_config(
config = {
'SocksPort': str(SOCKS_PORT),
},
@ericbarnhill
ericbarnhill / insight-python-flask-heroku.md
Last active June 6, 2020 14:52
Building an Insight project with Python, Flask, and Heroku

Building an Insight project with Python, Flask, and Heroku

A common goal in Insight data science projects is to deploy one's work as an app. The recommended app is Flask due to its dynamic page construction and easy interoperability with SQL databases. Heroku is then a great choice for deployment as it interacts easily with Python and Flask.

However a lot of information is out-of-date or suboptimal. This project will document how I built my Insight project app using Python, Flask, and Heroku.

*This project is adapted from and enormously indebted to the excellent "Flask by Example" tutorial found here. Basically I take this tutorial a little less far, fix some errors and adapt it to the requirements of the Insight project.

Contents

@ericbarnhill
ericbarnhill / gist:3e3cfe143efc147759f6d3ad33e1d628
Last active June 20, 2018 15:30
Errata for Flask by Example Tutorial in Ubuntu 18.04 LTS

Errata for RealPython's "Flask by Example", updated for Ubuntu LTS

These are notes on the excellent "Flask by Example" tutorial which begins here: https://realpython.com/flask-by-example-part-1-project-setup/

I really appreciate this tutorial and its use of several relevant frameworks and services.

However, many of the code snippets do not work exactly as written for a user coming in with a blank slate and the latest Ubuntu LTS. I took notes as I went along making it work and keep them stored here. I will format these later after I am done.

Chapter 1