No description
Find a file
Rodolfo Carvalho d9ed34f5f2 Update README
2015-05-29 17:19:22 +02:00
.sti/bin Run django migrations during deploy 2015-05-22 14:03:13 +02:00
openshift Rename application template JSON 2015-05-29 13:26:15 +02:00
project Automatically plug database via env vars 2015-05-29 15:52:28 +02:00
scripts Add script to run command in container 2015-05-24 14:32:06 +02:00
welcome Improve database info 2015-05-29 17:14:34 +02:00
.gitignore Add Django project 2015-05-19 12:19:44 +02:00
gunicorn_conf.py Add config to send access log to file 2015-05-22 17:10:19 +02:00
manage.py Add Django project 2015-05-19 12:19:44 +02:00
README.md Update README 2015-05-29 17:19:22 +02:00
requirements.txt Add Django Debug Toolbar 2015-05-24 13:09:31 +02:00

Openshift quickstart: Django

This is a Django project that you can use as the starting point to develop your own and deploy it on an OpenShift cluster.

It assumes you have access to an existing OpenShift installation.

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 Django and other dependencies
  3. pip freeze > requirements.txt
  4. django-admin startproject project .
  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

Local development

To run this project in your development machine, follow these steps:

  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/openshift/django-ex.git

  3. Install dependencies:

    pip install -r requirements.txt

  4. Create a development database:

    ./manage.py migrate

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

    ./manage.py runserver

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

Special files in this repository

[TODO]

.sti/                 - scripts used by source-to-image
openshift/            - application templates

Deploying to OpenShift

The file application-template.json contains an OpenShift application template that you can add you your OpenShift project with:

  • osc create -f application-template.json

Now you can browse to your OpenShift web console and create a new app from the 'django-quickstart' template. After adjusting your preferences (or accepting the defaults), your application will be built and deployed.

You will probably want to set the GIT_REPOSITORY parameter to point to your fork.

Data persistence

[TODO]