<pre><code>1) Step 1 install Rubygems
Ubuntu - https://rubygems.org/pages/download
Windows - https://forwardhq.com/support/installing-ruby-windows
$ gem
or
C:\Windows\System32>gem
RubyGems is a sophisticated package manager for Ruby. This is a
basic help message containing pointers to more information……..
2) Step 2:
$ gem install rhc
Or
C:\Windows\System32> gem install rhc
3) $ rhc
Or
C:\Windows\System32> rhc
Usage: rhc [--help] [--version] [--debug] <command> [<args>]
Command line interface for OpenShift.
4) $ rhc app create -a mysite -t python-2.7
Or
C:\Windows\System32> rhc app create -a mysite -t python-2.7
# Here mysite would be the sitename of your choice
#It will ask you to enter your openshift account id and password
Login to openshift.redhat.com: Enter your openshift id here
Password : **********
Application Options
---------------------
Domain: mytutorials
Cartridges: python-2.7
Gear Size: Default
Scaling: no
......
......
Your application 'mysite' is now available.
URL : http://mysite.....................
SSH to : 39394949......................
Git remote: ssh://......................
Run 'rhc show-app mysite' for more details about your app.
5) Clone your site
$ rhc git-clone mysite
Or
D:\> rhc git-clone mysite
.......................
Your application Git repository has been cloned to "D:\mysite"
6) #”D:\mysite>” is the location we cloned.
D:\mysite> git remote add upstream -m master git://github.com/rancavil/django-openshift-quickstart.git
D:\mysite> git pull -s recursive -X theirs upstream master
7) D:\mysite> git push
remote : ................
remote: Django application credentials
user: admin
xertefkefkt
remote: Git Post-Receive Result: success
.............
8) D:\mysite>virtualenv venv --no-site-packages
D:\mysite>venv\Scripts\activate.bat
<venv> D:\mysite> python setup.py install
creating .....
Searching for Django<=1.6
.............
Finished processing dependencies for mysite==1.0
9) Change admin password
<venv> D:\mysite\wsgi\openshift> python manage.py changepassword admin
password:
...
Password changed successfully for user 'admin'
<venv> D:\mysite\wsgi\openshift> python manage.py runserver
Validating models….
10) Git add
<venv> D:\mysite> git add.
<venv> D:\mysite> git commit -am"activating the app on Django / Openshift"
.......
<venv> D:\mysite> git push
#----------------------------------------------------------------------------------
#-----------Edit your setup.py in mysite with packages you want to install----------
from setuptools import setup
import os
# Put here required packages
packages = ['Django<=1.6', 'lxml', 'beautifulsoup4', 'openpyxl']
if 'REDISCLOUD_URL' in os.environ and 'REDISCLOUD_PORT' in os.environ and 'REDISCLOUD_PASSWORD' in os.environ:
packages.append('django-redis-cache')
packages.append('hiredis')
setup(name='mysite',
version='1.0',
description='OpenShift App',
author='Tanveer Alam',
author_email='xyz@gmail.com',
url='https://pypi.python.org/pypi',
install_requires=packages,
)
</code></pre>