Skip to main content

A simple way to demo Flask apps from your machine.

Project description

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 

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

flask-ngrokpy-1.0.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

flask_ngrokpy-1.0.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file flask-ngrokpy-1.0.1.tar.gz.

File metadata

  • Download URL: flask-ngrokpy-1.0.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for flask-ngrokpy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 811145f5e35f5eab196272a9b19b0981fda701d6a4864a075c8c765de1bb8d30
MD5 557d224ad0b4c7ec85f2ace2d8545dc8
BLAKE2b-256 969d58783870a7b0cd47bb506cc3e87c7b20e460d838bca46d131c112893226e

See more details on using hashes here.

File details

Details for the file flask_ngrokpy-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_ngrokpy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4c236b7b983811abc0529af3e8acee0714e9e04619f6690ef17f32c698396a58
MD5 ac7ef51d78c3c0c0fe60aaa184ac1a90
BLAKE2b-256 1e65bbc596d9c5136cddbba0aebc61df0c57de73aa6a3fd940c2f8dd855ca5b3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page