Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/CleverCloud/flask-example
Run Flask on Clever Cloud
https://github.com/CleverCloud/flask-example
clevercloud-example flask python
Last synced: about 2 months ago
JSON representation
Run Flask on Clever Cloud
- Host: GitHub
- URL: https://github.com/CleverCloud/flask-example
- Owner: CleverCloud
- Created: 2015-08-23T12:21:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-23T12:39:34.000Z (over 9 years ago)
- Last Synced: 2024-08-25T12:01:13.763Z (5 months ago)
- Topics: clevercloud-example, flask, python
- Language: Python
- Homepage:
- Size: 148 KB
- Stars: 5
- Watchers: 16
- Forks: 43
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-clever-cloud - demo-flask
README
# Flask Demo
This is a small Flask app that replies with a header dump to any request.
You can deploy this application as is on Clever Cloud:
```bash
git remote add clevercloud {your-clever-cloud-endpoint}
git push clevercloud master
```And it will do the trick.
We demonstrate several Clever Cloud possibilities in here:
## Choose python version
We have a python_version file in the clevercloud repository that
contains "3". This will select the latest python 3 version installed (at the time of
this writing, 3.4). Doc here:
[https://www.clever-cloud.com/doc/python/python_apps/#use-python-3](https://www.clever-cloud.com/doc/python/python_apps/#use-python-3)## Build app in a subfolder
In the `clevercloud/python.json` file, we have the
"build"."folder" field that points to the "app" folder. We will build & run the app
from this "app" folder.## Static files
We set up in `clevercloud/python.json` a "static" folder: everything in
that folder will be served statically. Note that the static folder will be the root of
static files requests. In this example, to get to Cat.svg which is in the "s" folder in
the clevercloud/static folder, you need to request "http://{yourdomain}/s/Cat.svg".You can also see that "s" is a link to the static folder at the root of the app. It's just
to show that you can do symlinks.## Run the app
As explained in
[https://www.clever-cloud.com/doc/python/python_apps/#select-your-module](https://www.clever-cloud.com/doc/python/python_apps/#select-your-module)
we ask Clever Cloud to run the "app" Flask application defined in the "hello.py" file. So
the "module" field is "hello:app".