Skip to content

Commit 40573a6

Browse files
Add README.
1 parent 493f5b1 commit 40573a6

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Flask Sample Application
2+
3+
This repository provides a sample Python web application implemented using the Flask web framework. It is intended to be used to demonstrate deployment of Python web applications to OpenShift 3.
4+
5+
## Implementation Notes
6+
7+
This sample Python application relies on the support provided by the default S2I builder for deploying a WSGI application. The requirements which need to be satisfied for this to work are:
8+
9+
* The WSGI application code file needs to be named ``wsgi.py``.
10+
* The WSGI application entry point within the code file needs to be named ``application``.
11+
* The ``gunicorn`` package must be listed in the ``requirements.txt`` file for ``pip``.
12+
13+
## Deployment Steps
14+
15+
To deploy this sample Python web application from the OpenShift web console, you should select ``python:2.7``, ``python:3.3``, ``python:3.4`` or ``python:latest``, when using _Add to project_. Use of ``python:latest`` is the same as having selected the most up Python version available, which at this time is ``python:3.4``.
16+
17+
The HTTPS URL of this code repository which should be supplied to the _Git Repository URL_ field when using _Add to project_ is:
18+
19+
* https://gitlab.com/graham-dumpleton/python-flask-auto.git
20+
21+
If using the ``oc`` command line tool instead of the OpenShift web console, to deploy this sample Python web application, you can run:
22+
23+
```
24+
oc new-app https://gitlab.com/graham-dumpleton/python-flask-auto.git
25+
```
26+
27+
In this case, because no language type was specified, OpenShift will determine the language by inspecting the code repository. Because the code repository contains a ``requirements.txt``, it will subsequently be interpreted as including a Python application. When such automatic detection is used, ``python:latest`` will be used.
28+
29+
If needing to select a specific Python version when using ``oc new-app``, you should instead use the form:
30+
31+
```
32+
oc new-app python:2.7~https://gitlab.com/graham-dumpleton/python-flask-auto.git
33+
```
34+

0 commit comments

Comments
 (0)