From 6381ce544eed284dc655e6868ff3918c72812b77 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Tue, 4 Aug 2020 12:57:06 +0200 Subject: [PATCH 01/10] Move from psycopg2 to psycopg2-binary to use manylinux wheels For more details, see https://github.com/psycopg/psycopg2/issues/674 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b85f91f7..39856618 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.8.5 pytz==2020.1 sqlparse==0.3.1 whitenoise==5.1.0 From 2df0ccae877349bc03a0894d084840bc17c2a362 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 27 Aug 2020 23:15:20 -0400 Subject: [PATCH 02/10] Move templates to RHEL/CentOS/UBI 8 and PostgreSQL 12 --- openshift/templates/django-postgresql-persistent.json | 8 ++++---- openshift/templates/django-postgresql.json | 8 ++++---- openshift/templates/django.json | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/openshift/templates/django-postgresql-persistent.json b/openshift/templates/django-postgresql-persistent.json index fa89710e..82fed854 100644 --- a/openshift/templates/django-postgresql-persistent.json +++ b/openshift/templates/django-postgresql-persistent.json @@ -440,15 +440,15 @@ { "name": "PYTHON_VERSION", "displayName": "Version of Python Image", - "description": "Version of Python image to be used (3.6 or latest).", - "value": "3.6", + "description": "Version of Python image to be used (3.6-ubi7, 3.6-ubi8, or latest).", + "value": "3.6-ubi8", "required": true }, { "name": "POSTGRESQL_VERSION", "displayName": "Version of PostgreSQL Image", - "description": "Version of PostgreSQL image to be used (10 or latest).", - "value": "10", + "description": "Version of PostgreSQL image to be used (10-el8, 12-el8, or latest).", + "value": "12-el8", "required": true }, { diff --git a/openshift/templates/django-postgresql.json b/openshift/templates/django-postgresql.json index 7b822c72..fe91fb7a 100644 --- a/openshift/templates/django-postgresql.json +++ b/openshift/templates/django-postgresql.json @@ -421,15 +421,15 @@ { "name": "PYTHON_VERSION", "displayName": "Version of Python Image", - "description": "Version of Python image to be used (3.6 or latest).", - "value": "3.6", + "description": "Version of Python image to be used (3.6-ubi7, 3.6-ubi8, or latest).", + "value": "3.6-ubi8", "required": true }, { "name": "POSTGRESQL_VERSION", "displayName": "Version of PostgreSQL Image", - "description": "Version of PostgreSQL image to be used (10 or latest).", - "value": "10", + "description": "Version of PostgreSQL image to be used (10-el8, 12-el8, or latest).", + "value": "12-el8", "required": true }, { diff --git a/openshift/templates/django.json b/openshift/templates/django.json index f2a971aa..7a9426ca 100644 --- a/openshift/templates/django.json +++ b/openshift/templates/django.json @@ -251,8 +251,8 @@ { "name": "PYTHON_VERSION", "displayName": "Version of Python Image", - "description": "Version of Python image to be used (3.6 or latest).", - "value": "3.6", + "description": "Version of Python image to be used (3.6-ubi7, 3.6-ubi8, or latest).", + "value": "3.6-ubi8", "required": true }, { From a3cc74971135b32aa968b1d51e1b60c364ee3723 Mon Sep 17 00:00:00 2001 From: Honza Horak Date: Mon, 21 Sep 2020 09:00:22 +0200 Subject: [PATCH 03/10] Update templates to 3.8 Do not include ubi7 as example because Django 2.2.x requires newer sqlite than what we have in RHEL 7 --- openshift/templates/django-postgresql-persistent.json | 4 ++-- openshift/templates/django-postgresql.json | 4 ++-- openshift/templates/django.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openshift/templates/django-postgresql-persistent.json b/openshift/templates/django-postgresql-persistent.json index 82fed854..4c217c4c 100644 --- a/openshift/templates/django-postgresql-persistent.json +++ b/openshift/templates/django-postgresql-persistent.json @@ -440,8 +440,8 @@ { "name": "PYTHON_VERSION", "displayName": "Version of Python Image", - "description": "Version of Python image to be used (3.6-ubi7, 3.6-ubi8, or latest).", - "value": "3.6-ubi8", + "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 fe91fb7a..944f3fb1 100644 --- a/openshift/templates/django-postgresql.json +++ b/openshift/templates/django-postgresql.json @@ -421,8 +421,8 @@ { "name": "PYTHON_VERSION", "displayName": "Version of Python Image", - "description": "Version of Python image to be used (3.6-ubi7, 3.6-ubi8, or latest).", - "value": "3.6-ubi8", + "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 7a9426ca..8f5b26e3 100644 --- a/openshift/templates/django.json +++ b/openshift/templates/django.json @@ -251,8 +251,8 @@ { "name": "PYTHON_VERSION", "displayName": "Version of Python Image", - "description": "Version of Python image to be used (3.6-ubi7, 3.6-ubi8, or latest).", - "value": "3.6-ubi8", + "description": "Version of Python image to be used (3.6-ubi8, 3.8-ubi8, or latest).", + "value": "3.8-ubi8", "required": true }, { From fa88380112794e91bd3ba5fd3839f4dbc85480a6 Mon Sep 17 00:00:00 2001 From: Afreed-Sharief <66790985+Afreed-Sharief@users.noreply.github.com> Date: Wed, 30 Sep 2020 17:39:09 +0530 Subject: [PATCH 04/10] Update views.py --- welcome/views.py | 2 ++ 1 file changed, 2 insertions(+) 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()) From f8f9d38b7510c4ce67480ecf1b09dc8f6192245f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lum=C3=ADr=20=27Frenzy=27=20Balhar?= Date: Fri, 5 Mar 2021 11:18:05 +0100 Subject: [PATCH 05/10] Mention Python compatibility in the readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d130c831..420bc108 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 the latest version of this example with Django 2.2 LTS which works with RHEL/Centos 8 and Python 3 only. If you are looking for the version for RHEL/Centos 7 or Python 2, it's in the [master branch](https://github.com/sclorg/django-ex/tree/master). The steps in this document assume that you have access to an OpenShift deployment that you can deploy applications on. From d409186155ca6bd6ce2123e92dd02ade9671836b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lum=C3=ADr=20=27Frenzy=27=20Balhar?= Date: Fri, 20 Aug 2021 09:16:37 +0200 Subject: [PATCH 06/10] Update pyscopg2-binary to 2.8.6 for Python 3.9 wheels For testing with Python 3.9, it!d be better to use the version which provides binary wheels for 3.9. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 39856618..d9485d69 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-binary==2.8.5 +psycopg2-binary==2.8.6 pytz==2020.1 sqlparse==0.3.1 whitenoise==5.1.0 From 439c4275828357b0af0359cd8b0cb4233c280a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lum=C3=ADr=20=27Frenzy=27=20Balhar?= Date: Fri, 20 Aug 2021 09:30:23 +0200 Subject: [PATCH 07/10] Mention the latest version in branch 2.2.x --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 420bc108..998b1ea6 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 and Python 3 only. If you are looking for the version for RHEL/Centos 7 or Python 2, it's in the [master branch](https://github.com/sclorg/django-ex/tree/master). +**NOTE:** This version of the example uses Django 2.2 LTS which works with RHEL/Centos 8 and Python 3 only. If you are looking for the version for RHEL/Centos 7 or Python 2, it's in the [master branch](https://github.com/sclorg/django-ex/tree/master). The latest version based on Django 3.2.x LTS is available in [branch 3.2.x](https://github.com/sclorg/django-ex/tree/3.2.x). The steps in this document assume that you have access to an OpenShift deployment that you can deploy applications on. From 200a5dafbeac95845e4c02f48e7af65eecc62676 Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Wed, 1 Jun 2022 12:34:53 +0200 Subject: [PATCH 08/10] Fix broken links to documentation --- welcome/templates/welcome/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.

From 46698d987ffb811baeed4c1fc20d3467a3295750 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Thu, 8 Dec 2022 13:28:55 +0100 Subject: [PATCH 09/10] New version of psycopg2-binary works fine with Python 3.11 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d9485d69..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-binary==2.8.6 +psycopg2-binary==2.9.5 pytz==2020.1 sqlparse==0.3.1 whitenoise==5.1.0 From 8f8f1048f192d019c0f4f23a3e64a0d5561c7156 Mon Sep 17 00:00:00 2001 From: BeataSolitudo <116539964+BeataSolitudo@users.noreply.github.com> Date: Mon, 29 May 2023 13:16:38 +0100 Subject: [PATCH 10/10] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 998b1ea6..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 version of the example uses Django 2.2 LTS which works with RHEL/Centos 8 and Python 3 only. If you are looking for the version for RHEL/Centos 7 or Python 2, it's in the [master branch](https://github.com/sclorg/django-ex/tree/master). The latest version based on Django 3.2.x LTS is available in [branch 3.2.x](https://github.com/sclorg/django-ex/tree/3.2.x). +**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: