-
Notifications
You must be signed in to change notification settings - Fork 1
Running webapps on Notebooks.ai
Notebooks.ai is a fully capable programming environment on the cloud. Its main purpose is associated with Data Science, but running webapps is also possible. Here's a quick guide on how to do it:
You don't need to do anything special to create the project; we recommend you to pick the Python 3.6 Image if possible (to avoid the DS libraries bloating your environment). If you're working on an existing project, make sure to paste the correct URL in the Github/Bitbucket field:
Notebooks.ai provides terminal access (running a full Debian OS), so you can do pretty much everything; it's your own linux environment in the cloud. Open a new terminal by clicking it the Terminal button, on the launcher. The Launcher is that screen that lets you select Notebooks, or Text Files or Terminals. You can always open a new launcher with the +
button highlighted in the screenshot:
We don't install any web frameworks automatically, so you'll have to do it on your own. It's rather simple, just use pip
to install them from a file (pip install -r requirements.txt
) or individually (pip install Flask
):
Once all your reqs are installed, start serving your app. There's a VERY important note here:
ALWAYS start your app with host
0.0.0.0
and port8080
.
Those are the ports exposed by Notebooks.ai. If you're on Django, you'll need to do django-admin runserver 0.0.0.0:8080
, if you're on Flask, you'll need app.run(host='0.0.0.0', port=8080)
.
Once your app is running, click on the blue rounded button at the bottom-right corner, and you'll see a submenu that reads "Open WebView":