diff --git a/README.md b/README.md index d130c831..92ce0d75 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This is a [Django](http://www.djangoproject.com) project that you can use as the starting point to develop your own and deploy it on an [OpenShift](https://github.com/openshift/origin) cluster. -**NOTE:** This is the latest version of this example with Django 2.2 LTS which works with RHEL/Centos 8 only. If you are looking for the version for RHEL/Centos 7, it's in the [master branch](https://github.com/sclorg/django-ex/tree/master). +**NOTE:** This is an example Django application for specific Django LTS version. If you want an older or newer version, check the alternative branches. The steps in this document assume that you have access to an OpenShift deployment that you can deploy applications on. @@ -56,9 +56,9 @@ To run this project in your development machine, follow these steps: 2. Ensure that the executable `pg_config` is available on your machine. You can check this using `which pg_config`. Otherwise, sqlite will be used. -3. Fork this repo and clone your fork: +**Note:** pg_config is not needed. You can use sqlite instead. - `git clone https://github.com/sclorg/django-ex.git` +3. Fork this repo and clone your fork. Make sure that you are in the right branch. 4. Install dependencies: diff --git a/openshift/templates/django-postgresql-persistent.json b/openshift/templates/django-postgresql-persistent.json index e3d43bfd..3280b2d4 100644 --- a/openshift/templates/django-postgresql-persistent.json +++ b/openshift/templates/django-postgresql-persistent.json @@ -440,7 +440,7 @@ { "name": "PYTHON_VERSION", "displayName": "Version of Python Image", - "description": "Version of Python image to be used (3.6-ubi8, 3.8-ubi7, 3.8-ubi8, or latest).", + "description": "Version of Python image to be used (3.6-ubi8, 3.8-ubi8, or latest).", "value": "3.8-ubi8", "required": true }, diff --git a/openshift/templates/django-postgresql.json b/openshift/templates/django-postgresql.json index 6a1c21c8..9aa96cd6 100644 --- a/openshift/templates/django-postgresql.json +++ b/openshift/templates/django-postgresql.json @@ -421,7 +421,7 @@ { "name": "PYTHON_VERSION", "displayName": "Version of Python Image", - "description": "Version of Python image to be used (3.6-ubi8, 3.8-ubi7, 3.8-ubi8, or latest).", + "description": "Version of Python image to be used (3.6-ubi8, 3.8-ubi8, or latest).", "value": "3.8-ubi8", "required": true }, diff --git a/openshift/templates/django.json b/openshift/templates/django.json index 72c4a3d4..af562294 100644 --- a/openshift/templates/django.json +++ b/openshift/templates/django.json @@ -251,7 +251,7 @@ { "name": "PYTHON_VERSION", "displayName": "Version of Python Image", - "description": "Version of Python image to be used (3.6-ubi8, 3.8-ubi7, 3.8-ubi8, or latest).", + "description": "Version of Python image to be used (3.6-ubi8, 3.8-ubi8, or latest).", "value": "3.8-ubi8", "required": true }, diff --git a/requirements.txt b/requirements.txt index b85f91f7..389e7d22 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ Django>=2.2.12,<3.0 django-debug-toolbar==2.2 gunicorn==20.0.4 -psycopg2==2.8.5 +psycopg2-binary==2.9.5 pytz==2020.1 sqlparse==0.3.1 whitenoise==5.1.0 diff --git a/welcome/templates/welcome/index.html b/welcome/templates/welcome/index.html index 1643f5de..da14e9d4 100644 --- a/welcome/templates/welcome/index.html +++ b/welcome/templates/welcome/index.html @@ -220,7 +220,7 @@ pre {

How to use this example application

-

For instructions on how to use this application with OpenShift, start by reading the Developer Guide.

+

For instructions on how to use this application with OpenShift, start by reading the Developer Guide.

Deploying code changes

@@ -282,7 +282,7 @@ $ git push

Managing your application

-

Documentation on how to manage your application from the Web Console or Command Line is available at the Developer Guide.

+

Documentation on how to manage your application from the Web Console or Command Line is available at the OKD Documentation.

Web Console

You can use the Web Console to view the state of your application components and launch new builds.

diff --git a/welcome/views.py b/welcome/views.py index 5ab821b1..2b82a10c 100644 --- a/welcome/views.py +++ b/welcome/views.py @@ -9,6 +9,7 @@ from .models import PageView # Create your views here. def index(request): + """Takes an request object as a parameter and creates an pageview object then responds by rendering the index view.""" hostname = os.getenv('HOSTNAME', 'unknown') PageView.objects.create(hostname=hostname) @@ -19,4 +20,5 @@ def index(request): }) def health(request): + """Takes an request as a parameter and gives the count of pageview objects as reponse""" return HttpResponse(PageView.objects.count())