Skip to content

Commit

Permalink
Upgrade the stack from Django 2.2 to 3.2 (#233)
Browse files Browse the repository at this point in the history
* Upgrade the stack from Django 2.2 to 3.2

* Upgrade pip as well when installing

Co-authored-by: Dimas Ciputra <[email protected]>
  • Loading branch information
Gustry and dimasciput authored Aug 21, 2022
1 parent ac26d15 commit f7a37c6
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 28 deletions.
18 changes: 12 additions & 6 deletions REQUIREMENTS.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
Django==2.2.25
Django==3.2.11

# Currently broken with 'no module named defaults' error
#Feedjack==0.9.18
# So use George's fork rather
# git+https://github.com/Erve1879/feedjack.git
# George's is also broken: use my fork (django 1.8 ready)
git+https://github.com/elpaso/feedjack.git
# George's is also broken: use elpaso fork (django 1.8 ready)
# git+https://github.com/elpaso/feedjack.git
# His is also broken, use dimasciput (django 3.2 ready)
git+https://github.com/dimasciput/feedjack.git

Markdown==2.3.1
#PIL==1.1.7
Pillow
Expand All @@ -16,17 +20,19 @@ argparse==1.2.1
django-annoying==0.7.7
django-auth-ldap==1.2.6
django-autoslug==1.7.1
django-debug-toolbar==1.11.1
django-debug-toolbar==3.2.4
django-endless-pagination==2.0
django-extensions==1.2.0
django-generic-aggregation==0.3.2
django-haystack==2.4.0
#django-olwidget==0.61.0 unmaintained, use this fork
git+https://github.com/Christophe31/olwidget.git
django-pagination==1.0.7

# Unmaintained!
#django-ratings==0.3.7
git+https://github.com/enikesha/django-ratings.git
git+https://github.com/gelo-zhukov/django-ratings.git

django-simple-ratings==0.3.2
# SIMPLEMENU
git+https://github.com/elpaso/django-simplemenu.git
Expand Down Expand Up @@ -54,4 +60,4 @@ django-sortable-listview==0.43
django-user-map
djangorestframework==3.12.2
django-rest-auth==0.9.5
drf-yasg
drf-yasg
2 changes: 1 addition & 1 deletion dockerize/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MAINTAINER Dimas Ciputra<[email protected]>
RUN apt-get clean all
RUN apt-get update && apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev
ADD REQUIREMENTS.txt /REQUIREMENTS.txt
RUN pip install -r /REQUIREMENTS.txt
RUN pip install --upgrade pip && pip install -r /REQUIREMENTS.txt
RUN pip install uwsgi

# https://docs.docker.com/examples/running_ssh_service/
Expand Down
13 changes: 8 additions & 5 deletions dockerize/docker/REQUIREMENTS.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
django==2.2.25
django==3.2.11
django-auth-ldap
python-ldap
django-taggit
django-tinymce==3.4.0
psycopg2
# Updates for Django 2
git+https://github.com/metamatik/django-templatetag-sugar.git
# Updates for Django 2
git+https://github.com/elpaso/django-ratings.git@modernize

# Updates for Django 3
git+https://github.com/gelo-zhukov/django-ratings.git

django-taggit-autosuggest
django-annoying
# Updates for Django 2
Expand All @@ -20,7 +22,7 @@ django-bootstrap-pagination
django-sortable-listview
sorl-thumbnail
django-extensions
django-debug-toolbar==1.11.1
django-debug-toolbar==3.2.4
whoosh
django-haystack

Expand All @@ -29,8 +31,9 @@ django-haystack
# git+https://github.com/Erve1879/feedjack.git
# George's is also broken: use my fork (django 1.8 ready)
# git+https://github.com/elpaso/feedjack.git
# His is also broken, use mine (django 2.2 ready)
# His is also broken, use dimasciput (django 3.2 ready)
git+https://github.com/dimasciput/feedjack.git

feedparser==5.2.1
celery==4.3.1
requests==2.23.0
Expand Down
1 change: 1 addition & 0 deletions dockerize/production/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN mkdir -p /usr/src; mkdir -p /home/web && \
ln -s /usr/src/plugins/qgis-app /home/web/django_project

RUN cd /usr/src/plugins/dockerize/docker && \
pip install --upgrade pip && \
pip install -r REQUIREMENTS.txt && \
pip install uwsgi && \
rm -rf /uwsgi.conf && \
Expand Down
12 changes: 7 additions & 5 deletions qgis-app/REQUIREMENTS_plugins.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
django==2.2.25
django==3.2.11
django-auth-ldap
python-ldap
django-taggit
django-tinymce==3.4.0
psycopg2
# Updates for Django 2
git+https://github.com/metamatik/django-templatetag-sugar.git
# Updates for Django 2
git+https://github.com/elpaso/django-ratings.git@modernize

# Updates for Django 3
git+https://github.com/gelo-zhukov/django-ratings.git

django-taggit-autosuggest
django-annoying
# Updates for Django 2
Expand All @@ -20,6 +22,6 @@ django-bootstrap-pagination
django-sortable-listview
sorl-thumbnail
django-extensions
django-debug-toolbar==1.11.1
django-debug-toolbar==3.2.4
whoosh
django-haystack
django-haystack
21 changes: 10 additions & 11 deletions qgis-app/users/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import render_to_response, get_object_or_404
from django.shortcuts import render, get_object_or_404
from annoying.functions import get_object_or_None
from django.template import RequestContext
from django.utils.translation import ugettext_lazy as _
Expand Down Expand Up @@ -31,7 +31,9 @@ def usersMap(theRequest):

myMap = InfoMap(users)

return render_to_response("view_users.html",
return render(
theRequest,
"view_users.html",
{
'myMap' : myMap,
'myUserCount' : myUserCount,
Expand All @@ -48,11 +50,11 @@ def createUser(theRequest):
myForm.save()
return HttpResponseRedirect("/community-map/view_users.html")
else:
return render_to_response("create_user_form.html", {'myForm' : myForm, 'myUserCount' : myUserCount },
return render(theRequest, "create_user_form.html", {'myForm' : myForm, 'myUserCount' : myUserCount },
context_instance=RequestContext(theRequest))
else:
myForm = QgisUserForm()
return render_to_response("create_user_form.html", {'myForm' : myForm, 'myUserCount' : myUserCount },
return render(theRequest, "create_user_form.html", {'myForm' : myForm, 'myUserCount' : myUserCount },
context_instance=RequestContext(theRequest))


Expand All @@ -64,12 +66,12 @@ def updateUser(theRequest, theId):
if myForm.is_valid():
myForm.save()
return HttpResponseRedirect("/community-map/view_users.html")
return render_to_response("update_user_form.html", {
return render(theRequest, "update_user_form.html", {
'myUser': myUser, 'myForm': myForm, 'myUserCount' : myUserCount
}, context_instance=RequestContext(theRequest))
else:
myForm = QgisUserForm(instance=myUser)
return render_to_response("update_user_form.html", {'myForm' : myForm, 'myUserCount' : myUserCount},
return render(theRequest, "update_user_form.html", {'myForm' : myForm, 'myUserCount' : myUserCount},
context_instance=RequestContext(theRequest))

def emailEditAddress(theRequest):
Expand Down Expand Up @@ -101,14 +103,11 @@ def emailEditAddress(theRequest):
msg = _("User is NOT valid.")
messages.warning(theRequest, msg, fail_silently=True)
logging.info("User or form is NOT valid")
return render_to_response("update_user.html", {'myForm' : myForm, 'myUserCount' : myUserCount},
return render(theRequest, "update_user.html", {'myForm' : myForm, 'myUserCount' : myUserCount},
context_instance=RequestContext(theRequest))

else:
myUserCount = QgisUser.objects.all().count()
myForm = EmailForm()
return render_to_response("update_user.html", {'myForm' : myForm},
return render(theRequest, "update_user.html", {'myForm' : myForm},
context_instance=RequestContext(theRequest))



0 comments on commit f7a37c6

Please sign in to comment.