You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Rodolfo Carvalho ab4b961cb5 Show server hostname 10 years ago
.sti/bin Run django migrations during deploy 10 years ago
openshift Show server hostname 10 years ago
project Show debug toolbar to all incoming requests 10 years ago
scripts Use dedicated script to pre deploy actions 10 years ago
.gitignore Add Django project 10 years ago
README.md Update README 10 years ago
application-template.json Add config to send access log to file 10 years ago
gunicorn_conf.py Add config to send access log to file 10 years ago
manage.py Add Django project 10 years ago
requirements.txt Add Django Debug Toolbar 10 years ago

README.md

Openshift Django quickstart

This project is meant to be forked and used to quickly deploy a Django web application to an OpenShift cluster. It assumes you have access to an existing OpenShift installation.

You can use this as a starting point to build your own application.

Getting started

  1. (optional) Create and activate a virtualenv (you may want to use virtualenvwrapper).

  2. Fork this repo and clone your fork:

    git clone https://github.com/rhcarvalho/openshift-django-quickstart.git

  3. Install dependencies:

    pip install -r requirements.txt

  4. If everything is alright, you should be able to start the Django development server:

    ./manage.py runserver

  5. Open your browser and go to http://127.0.0.1:8000, you will be greeted with a welcome page.

What has been done for you

This is a minimal Django 1.8 project. It was created with these steps:

  1. Create a virtualenv
  2. Manually install requirements
  3. pip freeze > requirements.txt
  4. django-admin startproject PROJECT_NAME .
  5. Manually update project/settings.py to configure SECRET_KEY, DATABASE and STATIC_ROOT entries.
  6. ./manage.py startapp openshift, to create the welcome page's app

Deploying to OpenShift

  1. osc process -f application-template.json - | osc create - deploy see it running

Next steps

Add your own code

Add your own code, commit and redeploy. hack (create app) & redeploy

Add a database

Your OpenShift administrator should provide you ... Change the configuration to point to your PostgreSQL database server.

Scaling up

osc resize dc/web ...

Web server logs

see gunicorn logs

Not covered

  • add application monitoring (newrelic)
  • add error monitoring (rollbar)