Skip to content
Permalink
Browse files

Upgrade to Django 2.2

WARNING:

- [2.1] mysqlclient mysqlclient is increased from 1.3.3 to 1.3.7.
  https://docs.djangoproject.com/en/2.2/releases/2.1/#miscellaneous

- [2.1] Since migrations are now loaded from .pyc files, you might
  need to delete them if you’re working in a mixed Python 2 and Python
  3 environment.
  https://docs.djangoproject.com/en/2.2/releases/2.1/#miscellaneous

- removed south migrations

Upgrade path details:

- [1.9] on_delete for foreignkey and onetoone fields
  https://docs.djangoproject.com/en/2.2/releases/1.9/#foreignkey-and-onetoonefield-on-delete-argument

- [1.9] https://docs.djangoproject.com/en/2.2/releases/1.9/#passing-a-3-tuple-or-an-app-name-to-include

- [1.10] The django.core.urlresolvers module is removed in favor of its new
  location, django.urls.
  https://docs.djangoproject.com/en/2.2/releases/1.10/#id3

- [1.10] https://docs.djangoproject.com/en/2.2/releases/1.10/#new-style-middleware
  https://docs.djangoproject.com/en/2.2/topics/http/middleware/#upgrading-middleware

- [1.11] contrib.auth.views.login() deprecated
  https://docs.djangoproject.com/en/2.2/releases/1.11/#id2

- [2.??] urlenquote stoped accepting bytestring
  • Loading branch information...
tibonihoo committed Jun 2, 2019
1 parent 77dbbf9 commit dee041d8be30e4d3b2c888b82709115d2b6747a0
Showing with 32 additions and 937 deletions.
  1. +1 −2 requirements_base.txt
  2. +3 −4 wateronmars/settings.py
  3. +3 −3 wateronmars/urls.py
  4. +2 −2 wom_classification/models.py
  5. +0 −99 wom_classification/south_migrations/0001_initial.py
  6. 0 wom_classification/south_migrations/__init__.py
  7. +0 −52 wom_pebbles/south_migrations/0001_initial.py
  8. +0 −33 ...bles/south_migrations/0002_auto__del_field_reference_save_count__add_field_reference_pin_count.py
  9. 0 wom_pebbles/south_migrations/__init__.py
  10. +1 −1 wom_river/models.py
  11. +0 −46 wom_river/south_migrations/0001_initial.py
  12. 0 wom_river/south_migrations/__init__.py
  13. +2 −2 wom_river/tests.py
  14. +1 −1 wom_river/utils/read_opml.py
  15. +2 −2 wom_tributary/models.py
  16. +0 −67 wom_tributary/south_migrations/0001_initial.py
  17. +0 −85 ...y/south_migrations/0002_auto__add_twitteruserinfo__del_field_twittertimeline_kind__add_field_t.py
  18. +0 −58 wom_tributary/south_migrations/0003_ensure_no_twitter_timeline_has_null_user_info.py
  19. +0 −55 wom_tributary/south_migrations/0004_auto__chg_field_twittertimeline_twitter_user_access_info.py
  20. 0 wom_tributary/south_migrations/__init__.py
  21. +2 −2 wom_user/forms.py
  22. +7 −7 wom_user/models.py
  23. +0 −169 wom_user/south_migrations/0001_initial.py
  24. +0 −117 wom_user/south_migrations/0002_auto.py
  25. +0 −122 wom_user/south_migrations/0003_auto__add_field_userprofile_twitter_info.py
  26. 0 wom_user/south_migrations/__init__.py
  27. +1 −1 wom_user/test_collection.py
  28. +1 −1 wom_user/test_river.py
  29. +1 −1 wom_user/test_tributary.py
  30. +1 −1 wom_user/test_userprofile.py
  31. +4 −4 wom_user/views.py
@@ -1,5 +1,4 @@
Django>=1.11.19,<2.0
South==1.0.1
Django>=2.2,<2.3
feedparser>=5.2.1,<6.0
beautifulsoup4
granary==1.14
@@ -205,16 +205,15 @@
]


MIDDLEWARE_CLASSES = (
MIDDLEWARE = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'wateronmars.urls'

@@ -53,15 +53,15 @@
user_auth_landing_twitter,
)

from django.contrib.auth.views import login
from django.contrib.auth import views as auth_views
from django.views.static import serve as static_serve


urlpatterns = [
url(r'^robots.txt$', get_robots_txt),
url(r'^humans.txt$', get_humans_txt),
url(r'^$', home, name='home'),
url(r'^accounts/login/$', login, {'template_name': 'login.html'}, name='user_login'),
url(r'^accounts/login/$', auth_views.LoginView.as_view(template_name='login.html'), name='user_login'),
url(r'^accounts/logout/$', user_logout, name='user_logout'),
url(r'^accounts/profile/$', user_profile, name='user_profile'),
url(r'^u/(?P<owner_name>[^/]*)/$', user_root, name='user_root'),
@@ -94,7 +94,7 @@
urlpatterns += [
url(r'^accounts/new/$', user_creation),
url(r'^accounts/auth_landing/twitter/$', user_auth_landing_twitter, name='user_auth_landing_twitter'),
url(r'^admin/', include(admin.site.urls)),
url(r'^admin/', admin.site.urls),
# Uncomment the admin/doc line below to
# enable admin documentation
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
@@ -54,11 +54,11 @@ class ClassificationData(models.Model):
and its user-specific classification data ("features" in machine
learning terminology)."""

owner = models.ForeignKey(User)
owner = models.ForeignKey(User, on_delete=models.CASCADE)

tags = models.ManyToManyField(Tag)

content_type = models.ForeignKey(ContentType)
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey('content_type', 'object_id')

This file was deleted.

No changes.

This file was deleted.

This file was deleted.

No changes.
@@ -29,7 +29,7 @@ class WebFeed(models.Model):
reference to be considered as a source of news items.
"""
# Reference considered as the source
source = models.ForeignKey(Reference)
source = models.ForeignKey(Reference, on_delete=models.CASCADE)
# The URL where to get updated list of References from
xmlURL = models.CharField(max_length=URL_MAX_LENGTH)
# Date marking the last time the source was checked for an update

This file was deleted.

No changes.
@@ -208,7 +208,7 @@ def setUp(self):
</rss>
""" % ("u"*(URL_MAX_LENGTH),"u"*(URL_MAX_LENGTH))

f1 = feedparser.parse(rss_xml.encode("utf-8"))
f1 = feedparser.parse(rss_xml)
self.ref_and_tags = add_new_references_from_feedparser_entries(web_feed,
f1.entries)

@@ -315,7 +315,7 @@ def setUp(self):
</rss>
"""

f1 = feedparser.parse(rss_xml.encode("utf-8"))
f1 = feedparser.parse(rss_xml)
self.ref_and_tags = add_new_references_from_feedparser_entries(web_feed,
f1.entries)

@@ -51,7 +51,7 @@ def __init__(self):
self.tags = set()

def __str__(self):
return "Feed: %s\n- %s\n- %s\n- %s" % (self.title.encode("utf-8"),self.xmlUrl,self.htmlUrl,",".join(self.tags))
return "Feed: %s\n- %s\n- %s\n- %s" % (self.title,self.xmlUrl,self.htmlUrl,",".join(self.tags))

def warning(txt):
print("WARNING: " + txt)
@@ -47,7 +47,7 @@ class GeneratedFeed(models.Model):
)

# Reference considered as the source
source = models.ForeignKey(Reference)
source = models.ForeignKey(Reference, on_delete=models.CASCADE)

# Date marking the last time the source was checked for an update
last_update_check = models.DateTimeField('last update')
@@ -71,7 +71,7 @@ class TwitterTimeline(models.Model):
SOURCE_URL = "https://twitter.com"
SOURCE_NAME = "Twitter"

generated_feed = models.OneToOneField(GeneratedFeed)
generated_feed = models.OneToOneField(GeneratedFeed, on_delete=models.CASCADE)

# User for which these tweets should be looked up
# NOTE: in current use case this user will be requested to

0 comments on commit dee041d

Please sign in to comment.
You can’t perform that action at this time.