Upgrade to Django 2.1 using pip-tools

Closes #88
This commit is contained in:
Carl van Tonder 2018-10-01 15:19:21 -04:00
parent 4c28ed5e3b
commit 1256d0f52b
13 changed files with 174 additions and 57 deletions

View File

@ -18,10 +18,4 @@ class Migration(migrations.Migration):
field=models.CharField(blank=True, default='', max_length=240, verbose_name='Image caption'),
preserve_default=False,
),
migrations.AlterField(
model_name='imagefile',
name='credit',
field=models.CharField(blank=True, default='', max_length=240, verbose_name='Image credit'),
preserve_default=False,
),
]

View File

@ -0,0 +1,19 @@
# Generated by Django 2.0.8 on 2018-09-28 13:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('files', '0005_auto_20180922_1717'),
]
operations = [
migrations.AlterField(
model_name='imagefile',
name='credit',
field=models.CharField(blank=True, default='', max_length=240, verbose_name='Image credit'),
preserve_default=False,
),
]

View File

@ -10,7 +10,7 @@ class BaseFile(models.Model):
upload_to='.',
)
user = models.ForeignKey(
User, related_name='%(class)s'
User, related_name='%(class)s', on_delete=models.PROTECT,
)
class Meta:

View File

@ -246,7 +246,7 @@ class CaseStudy(models.Model):
# User who submitted case study
author = models.ForeignKey(
User,
models.SET_NULL,
on_delete=models.SET_NULL,
blank=True,
null=True,
editable=False
@ -927,7 +927,8 @@ class CaseStudy(models.Model):
SpatialRefSys,
null=True,
blank=True,
default=4326
default=4326,
on_delete=models.PROTECT
)
# 4.3.3

View File

@ -147,6 +147,7 @@ class Drafts(LoginRequiredMixin, View):
def get(self, request):
draft = self.get_object(request)
if draft == None:
return HttpResponse(status=404) # Not Found
else:
@ -155,13 +156,14 @@ class Drafts(LoginRequiredMixin, View):
def put(self, request):
# Find an existing object is there is one
draft = self.get_object(request)
if draft == None:
# If there isn't, create a new draft...
draft = CaseStudyDraft(author=request.user, data=request.body)
draft = CaseStudyDraft(author=request.user, data=request.body.decode())
draft.save()
return HttpResponse(status=201) # Created
else:
draft.data = request.body
draft.data = request.body.decode()
draft.save()
return HttpResponse(status=200) # OK

View File

@ -2,6 +2,8 @@ from django.conf.urls import url
from . import views
app_name = 'profiles'
urlpatterns = [
url(
regex=r'^~redirect/$',

View File

@ -1,4 +1,8 @@
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from django.contrib.auth.mixins import LoginRequiredMixin

3
requirements-devel.in Normal file
View File

@ -0,0 +1,3 @@
bpython
isort
prospector

View File

@ -1,6 +1,41 @@
-r requirements.txt
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file requirements-devel.txt requirements-devel.in
#
astroid==2.0.4 # via pylint, requirements-detector
blessings==1.7 # via curtsies
bpython==0.17.1
certifi==2018.8.24 # via requests
chardet==3.0.4 # via requests
curtsies==0.3.0 # via bpython
dodgy==0.1.9 # via prospector
flake8-polyfill==1.0.2 # via pep8-naming
flake8==3.5.0 # via flake8-polyfill
greenlet==0.4.15 # via bpython
idna==2.7 # via requests
isort==4.3.4
prospector==0.12.7
selenium==3.12.0
lazy-object-proxy==1.3.1 # via astroid
mccabe==0.6.1 # via flake8, prospector, pylint
pep8-naming==0.7.0 # via prospector
prospector==1.1.2
pycodestyle==2.3.1 # via flake8, prospector
pydocstyle==2.1.1 # via prospector
pyflakes==1.6.0 # via flake8, prospector
pygments==2.2.0 # via bpython
pylint-plugin-utils==0.4 # via prospector
pylint==2.1.1 # via prospector, pylint-plugin-utils
pyyaml==3.13 # via prospector
requests==2.19.1 # via bpython
requirements-detector==0.6 # via prospector
setoptconf==0.2.0 # via prospector
six==1.11.0 # via astroid, blessings, bpython, pydocstyle
snowballstemmer==1.2.1 # via pydocstyle
typed-ast==1.1.0 # via astroid
typing==3.6.6 # via curtsies
urllib3==1.23 # via requests
wcwidth==0.1.7 # via curtsies
wrapt==1.10.11 # via astroid
>>>>>>> Upgrade to Django 2.1 using pip-tools

4
requirements-test.in Normal file
View File

@ -0,0 +1,4 @@
pytest
pytest-django
pytest-cov
django-override-storage

View File

@ -1,6 +1,18 @@
-r requirements.txt
pytest==3.5.0
pytest-django==3.1.2
pytest-cov==2.5.1
django-override-storage==0.1.4
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file requirements-test.txt requirements-test.in
#
atomicwrites==1.2.1 # via pytest
attrs==18.2.0 # via pytest
coverage==4.5.1 # via pytest-cov
django-override-storage==0.1.6
more-itertools==4.3.0 # via pytest
pluggy==0.7.1 # via pytest
py==1.6.0 # via pytest
pytest-cov==2.6.0
pytest-django==3.4.3
pytest==3.8.1
six==1.11.0 # via more-itertools, pytest
selenium==3.12.0

31
requirements.in Normal file
View File

@ -0,0 +1,31 @@
boto
boto3
django
django-autocomplete-light
django-appconf
django-anymail
django-avatar
django-bootstrap3
django-braces
django-compressor
django-countries
django-crispy-forms
django-envelope
django-extensions
django-geojson
django-leaflet
django-multiselectfield
django-multiupload
django-phonenumber-field
django-storages
django-registration-redux
djangorestframework
djangorestframework-gis
gunicorn
pip-tools
psycopg2
python-memcached
raven
rcssmin
rjsmin
whitenoise

View File

@ -1,43 +1,53 @@
appdirs==1.4.3
brotlipy==0.7.0
boto==2.48.0
boto3==1.4.7
Django==1.11.6
django-autocomplete-light==3.2.10
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file requirements.txt requirements.in
#
babel==2.6.0 # via django-phonenumber-field
boto3==1.9.12
boto==2.49.0
botocore==1.12.12 # via boto3, s3transfer
certifi==2018.8.24 # via requests
chardet==3.0.4 # via requests
click==7.0 # via pip-tools
django-anymail==4.2
django-appconf==1.0.2
django-anymail==2.0
django-avatar==4.0.1
django-bootstrap3==8.2.3
django-braces==1.11.0
#django-cas-server>0.9.0
git+git://github.com/nitmir/django-cas-server.git@4123450e9f9bdd1ca965f224f4ce41716d10654f#egg=django-cas-server
django-compressor==2.1.1
django-countries==4.5
django-crispy-forms==1.6.1
django-autocomplete-light==3.3.2
django-avatar==4.1.0
django-bootstrap3==11.0.0
django-braces==1.13.0
django-compressor==2.2
django-countries==5.3.2
django-crispy-forms==1.7.2
django-envelope==1.3
django-extensions==1.7.9
django-geojson==2.10.0
django-leaflet==0.23.0
django-extensions==2.1.2
django-geojson==2.11.0
django-leaflet==0.24.0
django-multiselectfield==0.1.8
django-multiupload==0.5.2
django-phonenumber-field==2.0.0
django-registration-redux==1.6
django-storages==1.6.5
djangorestframework==3.6.3
djangorestframework-gis==0.11.2
django-phonenumber-field==2.0.1
django-registration-redux==2.4
django-storages==1.7.1
django==2.1.1
djangorestframework-gis==0.13
djangorestframework==3.8.2
docutils==0.14 # via botocore
gunicorn==19.9.0
gevent>=0.13
olefile==0.44
packaging==16.8
Pillow==4.1.1
psycopg2==2.7.1
pyparsing==2.2.0
python-memcached==1.58
pytz==2017.2
raven==6.2.1
idna==2.7 # via requests
jmespath==0.9.3 # via boto3, botocore
phonenumbers==8.9.14 # via django-phonenumber-field
pillow==5.2.0 # via django-avatar
pip-tools==3.0.0
psycopg2==2.7.5
python-dateutil==2.7.3 # via botocore
python-memcached==1.59
pytz==2018.5 # via babel, django
raven==6.9.0
rcssmin==1.0.6
requests==2.14.2
requests-futures==0.9.7
requests==2.19.1 # via django-anymail
rjsmin==1.0.12
six==1.10.0
whitenoise==3.3.1
s3transfer==0.1.13 # via boto3
six==1.11.0 # via django-anymail, django-extensions, django-geojson, djangorestframework-gis, pip-tools, python-dateutil, python-memcached
urllib3==1.23 # via botocore, requests
whitenoise==4.1