# Flask Sample Application
This repository provides a sample Python web application implemented using the Flask web framework and hosted using ``gunicorn``. It is intended to be used to demonstrate deployment of Python web applications to OpenShift 3.
## Implementation Notes
This sample Python application relies on the support provided by the default S2I builder for deploying a WSGI application using the ``gunicorn`` WSGI server. The requirements which need to be satisfied for this to work are:
* The WSGI application code file needs to be named ``wsgi.py``.
* The WSGI application entry point within the code file needs to be named ``application``.
* The ``gunicorn`` package must be listed in the ``requirements.txt`` file for ``pip``.
In addition, the ``.s2i/environment`` file has been created to allow environment variables to be set to override the behaviour of the default S2I builder for Python.
* The environment variable ``APP_CONFIG`` has been set to declare the name of the config file for ``gunicorn``.
## Deployment Steps
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 to date Python version available, which at this time is ``python:3.4``.
The HTTPS URL of this code repository which should be supplied to the _Git Repository URL_ field when using _Add to project_ is:
* https://github.com/OpenShiftDemos/os-sample-python.git
If using the ``oc`` command line tool instead of the OpenShift web console, to deploy this sample Python web application, you can run:
```
oc new-app https://github.com/OpenShiftDemos/os-sample-python.git
```
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.
If needing to select a specific Python version when using ``oc new-app``, you should instead use the form:
```
oc new-app python:2.7~https://github.com/OpenShiftDemos/os-sample-python.git
```
没有合适的资源?快使用搜索试试~ 我知道了~
使用 OpenShift 默认 Python S2I 构建器和 gunicorn 测试 OpenShift 3 部署的示例 Py...

共7个文件
txt:3个
py:2个
md:1个

1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 160 浏览量
2024-11-24
16:19:39
上传
评论
收藏 2KB ZIP 举报
温馨提示
使用 OpenShift 默认 Python S2I 构建器和 gunicorn 测试 OpenShift 3 部署的示例 Python Flask 应用程序。Flask 示例应用程序此存储库提供了一个使用 Flask Web 框架实现并使用 托管的示例 Python Web 应用程序gunicorn。它旨在用于演示如何将 Python Web 应用程序部署到 OpenShift 3。实施说明此示例 Python 应用程序依赖于默认 S2I 构建器提供的支持,以便使用gunicornWSGI 服务器部署 WSGI 应用程序。要实现此功能,需要满足以下要求WSGI应用程序代码文件需要命名为wsgi.py。代码文件内的 WSGI 应用程序入口点需要命名为application。该软件包必须在文件gunicorn中列出。requirements.txtpip此外,.s2i/environment创建该文件是为了允许设置环境变量来覆盖 Python 的默认 S2I 构建器的行为。已设置环境变量APP_CONFIG来声明配置文件的名称gunicorn。部署步骤
资源推荐
资源详情
资源评论





























收起资源包目录









共 7 条
- 1
资源评论


徐浪老师
- 粉丝: 9439
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- COMSOL声子晶体建模:带隙与传输损耗计算方法及应用
- SQL-Server-2008数据库设计与管理03单元3创建与管理数据表(ppt文档).ppt
- 区域农产品电子商务运营策划方案.doc
- 2023年SEO电脑维修网站整体优化方案.doc
- 综合项目管理知识标准体系中的九大知识领域.doc
- 配拣型仓库控制系统“仓库任务操作系统”介绍-PPT课件.pptx
- 网络综合布线投标书模板.doc
- 机械故障诊断学钟秉林第章神经网络诊断原理.ppt
- 通信行业大数据项目市场需求.docx
- 嵌入式系统rteosμcosii的移植.pptx
- 哈希算法介绍(7页).doc
- 物联网与工业自动化的关系ppt课件.ppt
- 内蒙古准格尔旗高中数学第一章算法初步1.1.2程序框图与算法的基本逻辑结构例题课件新人教B版必修3.ppt
- 学生计算机学习心得体会900字5篇.docx
- 2023年软件评测师上午试题分析与解答.doc
- 建设项目管理作业参考答案.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
