Giter Club home page Giter Club logo

finna-be-octo-bugfixes's Introduction

Python 2.7.4 + Nginx + uWSGI + Django on Openshift

Setting up Openshift

Create the Openshift application with a DIY and Postgresql 8.4 cartridge (also works on MySQL and SQLite out-of-the-box):

$ rhc app create <exampleapp> diy-0.1 postgresql-8.4
$ cd <exampleapp>
$ git remote add upstream -m master git://github.com/seedofjoy/openshift-diy-nginx-uwsgi-django.git
$ git pull -s recursive -X theirs upstream master
$ git push

Configuration

  • uWSGI and Nginx configs are located in configs/ dir. Environments variables in this configs will substitute on deploy stage.
  • If you want change the name of the Django project, please change it in the file .appname too.
  • Django project is configured to work with PostgreSQL, MySQL or SQLite (in this priority order).
  • Also this Django project will work on local machine: it will use SQLite, static and media folders will located in project folder.

Pre build stage

The 'pre_build' hook script performs the following actions:

  • Installs Python 2.7.4
  • Installs Virtualenv 1.9.1 and creates virtualenv in $OPENSHIFT_DATA_DIR/virtualenv
  • Installs Nginx 1.4.0

You can install any version as you want, just change versions variables in this script

Build stage

  • Installs a pip packages from 'requirements.txt' (Django>=1.5, psycopg2, uwsgi, Pillow)

Feel free to edit this file, but leave uWSGI and Django.

Deploy stage

  • Creates static and media dirs ($OPENSHIFT_DATA_DIR/static/static and $OPENSHIFT_DATA_DIR/static/media) for Django
  • Substitute environments variables to Nginx and uWSGI configs and copy its to $OPENSHIFT_DATA_DIR

finna-be-octo-bugfixes's People

Contributors

kazunekit avatar seedofjoy 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.