Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8300211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:28:01+00:00 2026-06-08T16:28:01+00:00

I recently tried to export a Django project on OpenShift, but fruitlessly. The only

  • 0

I recently tried to export a Django project on OpenShift, but fruitlessly. The only solutions I found were “prebuilt” ones (such as https://github.com/openshift/django-example).

I spent some hours trying to adapt it to my project but I always got an Internal Server Error.

So, how to setup django on openshift?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T16:28:02+00:00Added an answer on June 8, 2026 at 4:28 pm

    I finally figured it out. The first thing to do is to start an openshift app and edit the setup.py file :

    rhc app create -a APPNAME -t python-2.6
    cd APPNAME
    vim setup.py
    

    You need to uncomment “install_requires=[‘Django>=1.3’]”

    Then you can commit to the server :

    git commit -a -m "Initialization"
    git push
    

    By default, it installs django 1.4 but I think you can choose another version with the correct install requirement in setup.py. Anyway, you’ll have to run the same django version on your computer and the server for the following.

    Create your django project :

    cd wsgi
    django-admin.py startproject PROJECTNAME
    

    Then you’ll have to edit the file application, replace the whole content by :

    #!/usr/bin/python
    import os, sys
    
    os.environ['DJANGO_SETTINGS_MODULE'] = 'PROJECTNAME.settings'
    sys.path.append(os.path.join(os.environ['OPENSHIFT_REPO_DIR'], 'wsgi',
        'PROJECTNAME'))
    
    virtenv = os.environ['APPDIR'] + '/virtenv/'
    os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 'lib/python2.6/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
    # 
    from django.core.handlers import wsgi
    application = wsgi.WSGIHandler()
    

    Finally, you can commit the modifications :

    cd ..
    git add .
    git commit -a -m "Project Creation"
    git push
    

    You should see the django welcome page.
    Now you can edit the settings and import your django apps without unwanted content

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently tried extending django's registration form with the following but i can only
I recently tried to combine SEAM and GWT in a project - but failed
Recently I tried to explain some poorly designed code to my project manager. All
I recently tried to compile an older Xcode project (which used to compile just
I've recently tried using branches in git but while they work allright whatever I
I recently tried to upgrade a .net 2.0 project which had its DAL generated
I recently tried applying a gradient background to a webpage using only CSS3. while
I have recently tried using the Silverlight NUnit Project template (the one from Jamie
I have recently tried sharpening my rails skills with this tool: http://github.com/edgecase/ruby_koans but I
I recently tried to figure out how to use freeglut with NetBeans 7. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.