Skip to content

Commit 100bd17

Browse files
committed
Revert "Merge pull request sclorg#150 from frenzymadness/update"
This reverts commit bd5e352, reversing changes made to 97c98a0.
1 parent bd5e352 commit 100bd17

File tree

7 files changed

+35
-63
lines changed

7 files changed

+35
-63
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
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.
44

5-
**NOTE:** The current master branch works with Django 2.2 LTS. The version for older Django 1.11 LTS is in [branch 1.11.x](https://github.com/sclorg/django-ex/tree/1.11.x).
6-
75
The steps in this document assume that you have access to an OpenShift deployment that you can deploy applications on.
86

97
## What has been done for you
@@ -54,7 +52,10 @@ To run this project in your development machine, follow these steps:
5452

5553
1. (optional) Create and activate a [virtualenv](https://virtualenv.pypa.io/) (you may want to use [virtualenvwrapper](http://virtualenvwrapper.readthedocs.org/)).
5654

57-
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.
55+
2. Ensure that the executable `pg_config` is available on your machine. You can check this using `which pg_config`. If not, install the dependency with one of the following.
56+
- macOS: `brew install postgresql` using [Homebrew](https://brew.sh/)
57+
- Ubuntu: `sudo apt-get install libpq-dev`
58+
- [Others](https://stackoverflow.com/a/12037133/8122577)
5859

5960
3. Fork this repo and clone your fork:
6061

@@ -119,8 +120,8 @@ Templates give you full control of each component of your application.
119120
Sometimes your application is simple enough and you don't want to bother with templates. In that case, you can let OpenShift inspect your source code and create the required components automatically for you:
120121

121122
```bash
122-
$ oc new-app centos/python-36-centos7~https://github.com/sclorg/django-ex
123-
imageStreams/python-36-centos7
123+
$ oc new-app centos/python-35-centos7~https://github.com/sclorg/django-ex
124+
imageStreams/python-35-centos7
124125
imageStreams/django-ex
125126
buildConfigs/django-ex
126127
deploymentConfigs/django-ex

manage.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
#!/usr/bin/env python
2-
"""Django's command-line utility for administrative tasks."""
32
import os
43
import sys
54

5+
if __name__ == "__main__":
6+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
67

7-
def main():
8-
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
9-
try:
10-
from django.core.management import execute_from_command_line
11-
except ImportError as exc:
12-
raise ImportError(
13-
"Couldn't import Django. Are you sure it's installed and "
14-
"available on your PYTHONPATH environment variable? Did you "
15-
"forget to activate a virtual environment?"
16-
) from exc
17-
execute_from_command_line(sys.argv)
18-
8+
from django.core.management import execute_from_command_line
199

20-
if __name__ == '__main__':
21-
main()
10+
execute_from_command_line(sys.argv)

project/settings.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
22
Django settings for this project.
33
4-
Generated by 'django-admin startproject' using Django 2.2.12.
4+
Generated by 'django-admin startproject' using Django 1.11.6.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/2.2/topics/settings/
7+
https://docs.djangoproject.com/en/1.11/topics/settings/
88
99
For the full list of settings and their values, see
10-
https://docs.djangoproject.com/en/2.2/ref/settings/
10+
https://docs.djangoproject.com/en/1.11/ref/settings/
1111
"""
1212

1313
import os
@@ -17,7 +17,7 @@
1717

1818

1919
# Quick-start development settings - unsuitable for production
20-
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
20+
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
2121

2222
# SECURITY WARNING: keep the secret key used in production secret!
2323
# The SECRET_KEY is provided via an environment variable in OpenShift
@@ -76,11 +76,11 @@
7676
},
7777
]
7878

79-
WSGI_APPLICATION = 'project.wsgi.application'
79+
WSGI_APPLICATION = 'wsgi.application'
8080

8181

8282
# Database
83-
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
83+
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
8484

8585
from . import database
8686

@@ -90,7 +90,7 @@
9090

9191

9292
# Password validation
93-
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
93+
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
9494

9595
AUTH_PASSWORD_VALIDATORS = [
9696
{
@@ -109,7 +109,7 @@
109109

110110

111111
# Internationalization
112-
# https://docs.djangoproject.com/en/2.2/topics/i18n/
112+
# https://docs.djangoproject.com/en/1.11/topics/i18n/
113113

114114
LANGUAGE_CODE = 'en-us'
115115

@@ -123,7 +123,7 @@
123123

124124

125125
# Static files (CSS, JavaScript, Images)
126-
# https://docs.djangoproject.com/en/2.2/howto/static-files/
126+
# https://docs.djangoproject.com/en/1.11/howto/static-files/
127127

128128
STATIC_URL = '/static/'
129129
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

project/urls.py

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,21 @@
1-
"""project URL Configuration
2-
3-
The `urlpatterns` list routes URLs to views. For more information please see:
4-
https://docs.djangoproject.com/en/2.2/topics/http/urls/
5-
Examples:
6-
Function views
7-
1. Add an import: from my_app import views
8-
2. Add a URL to urlpatterns: path('', views.home, name='home')
9-
Class-based views
10-
1. Add an import: from other_app.views import Home
11-
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12-
Including another URLconf
13-
1. Import the include() function: from django.urls import include, path
14-
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15-
"""
161
from django.conf import settings
2+
from django.conf.urls import include, url
173
from django.contrib import admin
18-
from django.urls import include, path
194

205
from welcome.views import index, health
216

227
urlpatterns = [
23-
path('', index, name='home'),
24-
path('health/', health),
25-
path('admin/', admin.site.urls),
8+
# Examples:
9+
# url(r'^$', 'project.views.home', name='home'),
10+
# url(r'^blog/', include('blog.urls')),
11+
12+
url(r'^$', index),
13+
url(r'^health$', health),
14+
url(r'^admin/', include(admin.site.urls)),
2615
]
2716

2817
if settings.DEBUG:
2918
import debug_toolbar
3019
urlpatterns = [
31-
path('__debug__/', include(debug_toolbar.urls)),
20+
url(r'^__debug__/', include(debug_toolbar.urls)),
3221
] + urlpatterns

requirements.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
Django>=2.2.12,<3.0
2-
django-debug-toolbar==2.2
3-
gunicorn==20.0.4
1+
django>=1.11,<1.12
2+
django-debug-toolbar==1.8
3+
gunicorn==19.5.0
44
psycopg2==2.8.5
5-
pytz==2020.1
6-
sqlparse==0.3.1
7-
whitenoise==5.1.0
5+
whitenoise==3.3.1

welcome/apps.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

project/wsgi.py renamed to wsgi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
"""
2-
WSGI config for this project.
2+
WSGI config for project project.
33
44
It exposes the WSGI callable as a module-level variable named ``application``.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
7+
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
88
"""
99

1010
import os
1111

1212
from django.core.wsgi import get_wsgi_application
1313

14-
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
14+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
1515

1616
application = get_wsgi_application()

0 commit comments

Comments
 (0)