Book Image

OpenShift Cookbook

By : Shekhar Gulati
Book Image

OpenShift Cookbook

By: Shekhar Gulati

Overview of this book

Table of Contents (19 chapters)
OpenShift Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Running OpenShift on a Virtual Machine
Index

Creating your first Python application


In this recipe, you will learn how to create an OpenShift Python application using the rhc command-line tool. We will create a Python 3.3 application and then understand the template application created by OpenShift.

Getting ready

To walk through this recipe, you will need the rhc command-line client installed on your machine. Please refer to the Installing the OpenShift rhc command-line client recipe in Chapter 1, Getting Started with OpenShift, for details.

How to do it…

Perform the following steps to create your first Python application:

  1. Open a new command-line terminal, and change the directory to a convenient location where you want to create the application.

  2. To create a new Python 3.3 application, run the following command:

    $ rhc create-app myapp python-3.3
    
  3. You can replace Python 3.3 with Python 2.6 or Python 2.7 to create applications that use the respective Python versions.

  4. Open your favorite web browser, and go to http://myapp-{domain-name}.rhcloud...