Git Product home page Git Product logo

openshift-django16's Introduction

Django v1.65 on OpenShift v3.2014

This git repository helps you get up and running quickly with django v1.65 and Openshift March 2014 release. ###Features

  • Ready to use for local development
  • Easy to push to Openshift
  • Configured for PostgreSQL 9.2
  • Minimal changes to default django 1.6x installation
  • Names follow the django 1.6x tutorial
  • Uses new folder layout from Openshift March 2014 release
  • Allows for debug mode on Openshift with the help of an environment variable.

###How to use this repository

sudo gem install rhc
rhc setup
  • Create a Python 2.7 application
rhc app create django python-2.7
  • Add the PostgreSQL 9.2 cartridge
rhc add-cartridge postgresql-9.2 --app django
  • Add this upstream repo
cd django
git remote add upstream -m master https://github.com/jfmatth/openshift-django16.git
git pull -s recursive -X theirs upstream master
  • Set the WSGI application to django's built in WSGI application.
rhc env set OPENSHIFT_PYTHON_WSGI_APPLICATION=mysite/wsgi.py --app django
  • Push the repo upstream
git push
  • SSH into the application to create a django superuser
python app-root/repo/manage.py createsuperuser

Configuration details

When a git push is done, the .openshift/action_hooks/deploy is executed. This script does two things:

  1. Runs python manage.py syncdb to update any changes to the Schema
  2. Runs python manage.py collectstatic to move all necessary static files into /wsgi/static

Debugging mode and Openshift

By default, debug mode is off when pushed to Openshift. However, if you'd like to turn on debugging (settings.DEBUG) while running on Openshift, you can set the environment variable DEBUG to True and then stop and start your application, and debugging will be turned on.

rhc env set DEBUG=True

openshift-django16's People

Contributors

jfmatth avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.