A successor to flask-ngrok for demo Flask apps using ngrok.
Project description
flask-ngrok2
The successor for flask-ngrok2 for making demo Flask apps from personal machine.
Compatability
Python 3.6+ is required.
Installation
pip install flask-ngrok2
Inside Jupyter / Colab Notebooks
Notebooks have an issue with newer versions of Flask, so force an older version if working in these environments.
!pip install flask==0.12.2
See the example notebook for a working example.
Quickstart
- Import with
from flask_ngrok2 import run_with_ngrok - Add
run_with_ngrok(app)to make your Flask app available upon running
# flask_ngrok_example.py
from flask import Flask
from flask_ngrok2 import run_with_ngrok
app = Flask(__name__)
run_with_ngrok(app) # Start ngrok when app is run
@app.route("/")
def hello():
return "Hello World!"
if __name__ == '__main__':
app.run()
Running the example:
python flask_ngrok_example.py
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Running on http://<random-address>.ngrok.io
* Traffic stats available on http://127.0.0.1:4040
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flask-ngrok2-0.2.1.tar.gz.
File metadata
- Download URL: flask-ngrok2-0.2.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8440240933c87fd441cbd0d31fc56da7d0a2b495ba1fb6247bf15b91794bc284
|
|
| MD5 |
704c0e8ffa228918e4c93d56def1dc93
|
|
| BLAKE2b-256 |
6c4b985b3c92f60b5bf83e034c615232cbd6cf41b4e481bb48ae0e86cad81ab6
|
File details
Details for the file flask_ngrok2-0.2.1-py3-none-any.whl.
File metadata
- Download URL: flask_ngrok2-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c16980618da048a4e5dd0028a33d7c0a17dceadb43d7637c7a6a1b326978f03f
|
|
| MD5 |
6677704784475d5c863d4f56e46bca98
|
|
| BLAKE2b-256 |
d0ed3f198226a71fe1971e453ba67f52eba1dcaa7f6c69c8895af4ada6d6c712
|