1

I have created a Django 1.3 application on Openshift. I wanted to upgrade to Django 1.5. So I updated setup.py to install Django 1.5

#!/usr/bin/env python

from setuptools import setup

setup(
    name='<Application name>',
    version='1.0',
    description='',
    author='',
    author_email='',
    url='http://www.python.org/sigs/distutils-sig/',
    install_requires=['Django>=1.5'],
)

The server returns http 500.

If setup.py has install_requires=['Django<=1.4'] it works fine.

How can I install Django 1.5 on Openshift?

Update: I can see a github commit where in the install_requires for Django is changed from >=1.3 to <=1.4 for the handling this same issue. But I still cannot figure out what caused that server 500 and how can we install Django 1.5 on openshift

Souvik Basu
  • 3,069
  • 4
  • 28
  • 42
  • 1
    Have you tried `install_requires=['Django<=1.5']`? – dan-klasson Apr 21 '13 at 08:14
  • if i specify install_requires=['Django<=1.5'], the setup script installs Django 1.4.3 – Souvik Basu Apr 21 '13 at 09:26
  • Have you tried this fork? https://github.com/ramr/DjangoShift – dan-klasson Apr 21 '13 at 13:29
  • Let us know what errors you're seeing in your logs: https://www.openshift.com/faq/how-to-troubleshoot-application-issues-using-logs Particularly useful are any errors you see in your git push logs/output as that's where it logs build/deploy hook output (e.g., building installing Django 1.5 on virtenv via pip). – Nam Duong Apr 22 '13 at 16:34
  • I had the same problem and this worked for me: http://stackoverflow.com/questions/15128135/django-setting-debug-false-causes-500-error – Charles L. Sep 14 '13 at 17:09

3 Answers3

1

It might come from your code, did you check the backwards incompatibilities mentioned in the release notes (mainly ALLOWED_HOSTS required in your settings.py)

It could also come from the {% url %} tag syntax change, see here.

Community
  • 1
  • 1
Simon K.
  • 11
  • 1
  • the code works correctly on my dev machine with django 1.5. So I guess the code is compatible with the django version – Souvik Basu May 10 '13 at 03:07
0

When i installed Django app on OpenShift, Django version was 1.5.1. I think OpenShift install last version Django, because the condition Django >= 1.4, that is no lower this version.

That is screenshot, when i installed app enter image description here

Victor Sand
  • 2,270
  • 1
  • 14
  • 32
eirenikos
  • 2,296
  • 25
  • 25
0

I had the same issue : from your screenshot you're using python2.6 ?

Try to use python2.7 with this configurations put on the application file:

#!/usr/bin/env python

import os
import sys

sys.path.append(os.path.join(os.environ['OPENSHIFT_REPO_DIR']))

os.environ['DJANGO_SETTINGS_MODULE'] = 'mywebsite.settings'

virtenv = os.environ['OPENSHIFT_HOMEDIR'] + 'python/virtenv/'
os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 'lib/python2.7/site-packages')

virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
try:
    execfile(virtualenv, dict(__file__=virtualenv))
except IOError:
    pass
#
# IMPORTANT: Put any additional includes below this line.  If placed above this
# line, it's possible required libraries won't be in your searchable path
#

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

And as refered by @Charles L try to set the settings using allowed host

Community
  • 1
  • 1
iMitwe
  • 1,218
  • 16
  • 35