Skip to main content

flask-ngrokpy

Run it button

PyPI version Downloads Downloads Python 3.6

This inspired from flask-ngrok

Important :-

Some time, flask-ngrok need root or sudo permission. so , if you are a non-root user, you can't use it.

And flask-ngrok download ngrok in temp directory (/tmp in linux) so if you run it after shutdown or restart, its download ngrok every time.

In flask-ngrokpy both problems are fixed.

Disclaimer:-

Use it only for educational purpose.

A simple way to demo Flask apps from your machine. Makes your Flask apps running on localhost available over the internet via the excellent ngrok tool.

Compatability

Python 3.6+ is required.

Installation

pip install flask-ngrokpy

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

See the example notebook for a working example.

Quickstart

  1. Import with from flask_ngrokpy import run_with_ngrok
  2. Add run_with_ngrok(app) to make your Flask app available upon running
# flask_ngrok_example.py
from flask import Flask
from flask_ngrokpy 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 

Metadata

Release files for flask-ngrokpy 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-ngrokpy 1.0.1
File Size Uploaded
flask-ngrokpy-1.0.1.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flask-ngrokpy 1.0.1
File Interpreter ABI Platform
flask_ngrokpy-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / flask-ngrokpy-1.0.1.tar.gz

Download URL flask-ngrokpy-1.0.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
811145f5e35f5eab196272a9b19b0981fda701d6a4864a075c8c765de1bb8d30
BLAKE2b-256 checksum
How to use checksums
969d58783870a7b0cd47bb506cc3e87c7b20e460d838bca46d131c112893226e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Release files / flask_ngrokpy-1.0.1-py3-none-any.whl

Download URL flask_ngrokpy-1.0.1-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c236b7b983811abc0529af3e8acee0714e9e04619f6690ef17f32c698396a58
BLAKE2b-256 checksum
How to use checksums
1e65bbc596d9c5136cddbba0aebc61df0c57de73aa6a3fd940c2f8dd855ca5b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page