I\'m learning to deploy Django on Openshift. Right now I have a python-2.7 cartridge up and running with Django 1.6 The git repo cloned in the cartridge is,
git://github
Warnings!
Actually git push takes some time while your application will be down. If you want to shorten the time, you can follow this approach:
ssh into your app openshift server
pip install --upgrade Django==<new version>
That will upgrade django immediately. However the running web process still keeps the older version. So you need to restart python cartridge.
From you local command line:
rhc cartridge restart -a <your app> -c python
Now its running with the new django and the downtime is minimal.
Make sure to update setup.py as mentioned in the other answer in order to be aligned with the next git push.
The easiest way to achieve this is to change the setup dependencies (install_requires
parameter for setup ()
) in setup.py
. Instead of
packages = ['Django<=1.6',]
as in the cartridge default you could write
packages = ['Django>=1.7,<1.8',]
to get the latest version of Django 1.7. More details of how to specify values can be found in the Python Packaging User Guide.
With your next git push
this file will be executed and the packages get updated, if required.