Giter Site home page Giter Site logo

davz33 / flask-ngrok2-pageprinter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mohamedalirashad/flask-ngrok2

0.0 0.0 0.0 61 KB

The successor for flask-ngrok2 for making demo Flask apps from personal machine.

License: Other

Python 100.00%

flask-ngrok2-pageprinter's Introduction

flask-ngrok2-pageprinter

Based on flask-ngrok and flask-ngrok2 The successor for flask-ngrok for making demo Flask apps from personal machine with added auth token functionality to build indipendent full stack apps within jupyer notebook and google collab. notebooks.

Compatability

Python 3.6+ is required.

Installation

pip install git+https://github.com/Davz33/flask-ngrok2-pageprinter

Quickstart

  1. Import with from flask_ngrok2_pp import run_with_ngrok
  2. Add run_with_ngrok(app,logpath,auth_token) to make your Flask app available upon running
  3. At server start, the log at logpath will contain the ngrok tunnel address. You can then json.load-it and make use of it for http/https request within jupyter notebooks.

To make full sense of this package, you need to run the following as python command from a .py external script: If you want to self-contain every piece of your notebook, just !touch script.py and write into from your j.notebook cell.

# flask_ngrok_example.py
from flask import Flask
from flask_ngrok2_pp import run_with_ngrok

app = Flask(__name__)
run_with_ngrok(app, logpath=LOGPATH, auth_token=authtoken)  # Start ngrok when app is run

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == '__main__':
    app.run()

Then, in your jupyer notebook, you can use json.load() to pull the active tunnel address.

flask-ngrok2-pageprinter's People

Contributors

awaisrafiq410 avatar davz33 avatar gstaff avatar mohamedalirashad avatar nejdetckenobi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.