Upgrading Django 1.7 to Django 1.8

Review Request #12267 — Created Dec. 21, 2017 and updated

ranade
hue
django-upgrade-1.8
hue
romain
commit 42c00dc75801cae7ca3c73ff2556f7f3259ff322
Author: Prakash Ranade <ranade@cloudera.com>
Date:   Wed Dec 13 15:13:40 2017 -0800

    Fixing Django1.8 upgrade requirements:
    
      - Django models now accept function datetime.now instead of datetime.today()
      - ForeignKey with unique=True needs to redefined as OneToOneField
      - django.db.backends has been renamed to django.db.backends.base.base
      - LaxOptionParser is no more available
      - from django.contrib.contenttypes import generic moved to from django.contrib.contenttypes.fields import GenericRelation
      - request.META.get('HTTP_X_REQUESTED_WITH') need to be replaced with request.is_ajax()
      - django.forms.util moved to django.forms.utils
      - django.template.Context moved to django.template.context.Context
      - django.core.context_processors moved to django.template.context_processors
      - django.utils.tzinfo moved to django.utils.timezone
      - TEMPLATES variable more details : https://docs.djangoproject.com/en/1.8/topics/templates/
      - adding djangomako.backends.MakoBackend
      - adding standard_context_processors into RequestContext
      - Adding Django 1.8's django.middleware.security.SecurityMiddleware middleware

:100644 100644 a0a15a4c69... a78c8fc8ce... M	apps/beeswax/src/beeswax/models.py
:100644 100644 18519f6bb4... c284874209... M	apps/filebrowser/src/filebrowser/views.py
:100644 100644 9e72d59d4b... 62ab9285b3... M	apps/oozie/src/oozie/models.py
:100644 100644 cf9129319c... b3761c70d5... M	apps/pig/src/pig/models.py
:100644 100644 b606e68a22... b0ba1e9c89... M	apps/useradmin/src/useradmin/forms.py
:100644 100644 30dbb3b428... 5ac7fb37cb... M	apps/useradmin/src/useradmin/models.py
:100644 100644 16b5613d39... cff8218bd0... M	apps/useradmin/src/useradmin/views.py
:100644 100644 af4fb8853b... 7bb0659834... M	desktop/core/ext-py/Django-1.8/django/template/context.py
:100644 100644 ef59510e0e... fcff9e8341... M	desktop/core/ext-py/djangomako-1.0.1/djangomako/backends.py
:100644 100644 b7616b3249... 6cdc50d63a... M	desktop/core/src/desktop/lib/django_forms.py
:100644 100644 bfaa420754... 6d329fde19... M	desktop/core/src/desktop/lib/django_mako.py
:100644 100644 a8182b895a... 295c377c32... M	desktop/core/src/desktop/lib/django_util.py
:100644 100644 c978471974... 916623aeb5... M	desktop/core/src/desktop/manage_entry.py
:100644 100644 bb27f0d77c... a8dff758e3... M	desktop/core/src/desktop/models.py
:100644 100644 6238581a90... 8c7c2c3533... M	desktop/core/src/desktop/settings.py
:100644 100644 556c90d6ad... e981746840... M	desktop/core/src/desktop/views.py

tested using live cluster, hue.ini pointing to nightly servers

  • 2
  • 0
  • 4
  • 0
  • 6
Description From Last Updated
Can't import as timezone? (conflicts with timezone field in models?) romain romain
Same? (cleaner to if no need to rename) romain romain
ranade
Review request changed

Description:

~  

commit 94248ba0276bd22e6bc4fcb8b0baeafecab2bc5b

  ~

commit 42c00dc75801cae7ca3c73ff2556f7f3259ff322

    Author: Prakash Ranade ranade@cloudera.com
    Date: Wed Dec 13 15:13:40 2017 -0800

   
   
Fixing Django1.8 upgrade requirements:
  +
   
  - Django models now accept function datetime.now instead of datetime.today()
   
  - ForeignKey with unique=True needs to redefined as OneToOneField
   
  - django.db.backends has been renamed to django.db.backends.base.base
   
  - LaxOptionParser is no more available
   
  - from django.contrib.contenttypes import generic moved to from django.contrib.contenttypes.fields import GenericRelation
   
  - request.META.get('HTTP_X_REQUESTED_WITH') need to be replaced with request.is_ajax()
   
  - django.forms.util moved to django.forms.utils
   
  - django.template.Context moved to django.template.context.Context
   
  - django.core.context_processors moved to django.template.context_processors
   
  - django.utils.tzinfo moved to django.utils.timezone
   
  - TEMPLATES variable more details : https://docs.djangoproject.com/en/1.8/topics/templates/
   
  - adding djangomako.backends.MakoBackend
~  
  - adding standard_context_processors into RequestContext
  ~
  - adding standard_context_processors into RequestContext
  +
  - Adding Django 1.8's django.middleware.security.SecurityMiddleware middleware
   
   

:100644 100644 a0a15a4c69... a78c8fc8ce... M apps/beeswax/src/beeswax/models.py

    :100644 100644 18519f6bb4... c284874209... M apps/filebrowser/src/filebrowser/views.py
    :100644 100644 9e72d59d4b... 62ab9285b3... M apps/oozie/src/oozie/models.py
    :100644 100644 cf9129319c... b3761c70d5... M apps/pig/src/pig/models.py
    :100644 100644 b606e68a22... b0ba1e9c89... M apps/useradmin/src/useradmin/forms.py
    :100644 100644 30dbb3b428... 5ac7fb37cb... M apps/useradmin/src/useradmin/models.py
    :100644 100644 16b5613d39... cff8218bd0... M apps/useradmin/src/useradmin/views.py
    :100644 100644 af4fb8853b... 7bb0659834... M desktop/core/ext-py/Django-1.8/django/template/context.py
    :100644 100644 ef59510e0e... fcff9e8341... M desktop/core/ext-py/djangomako-1.0.1/djangomako/backends.py
    :100644 100644 b7616b3249... 6cdc50d63a... M desktop/core/src/desktop/lib/django_forms.py
    :100644 100644 bfaa420754... 6d329fde19... M desktop/core/src/desktop/lib/django_mako.py
~   :100644 100644 a8182b895a... 727c74eb7b... M desktop/core/src/desktop/lib/django_util.py
  ~ :100644 100644 a8182b895a... 295c377c32... M desktop/core/src/desktop/lib/django_util.py
    :100644 100644 c978471974... 916623aeb5... M desktop/core/src/desktop/manage_entry.py
    :100644 100644 bb27f0d77c... a8dff758e3... M desktop/core/src/desktop/models.py
~   :100644 100644 6238581a90... dfc674bf15... M desktop/core/src/desktop/settings.py
  ~ :100644 100644 6238581a90... 8c7c2c3533... M desktop/core/src/desktop/settings.py
    :100644 100644 556c90d6ad... e981746840... M desktop/core/src/desktop/views.py

Diff:

Revision 2 (+82 -46)

Show changes

romain
  1. Nice one!

    And great to have the full tests.

  2. apps/oozie/src/oozie/models.py (Diff revision 2)
     
     

    Can't import as timezone?

    (conflicts with timezone field in models?)

  3. apps/useradmin/src/useradmin/models.py (Diff revision 2)
     
     

    Same? (cleaner to if no need to rename)

  4. For the record, could we keep the template engine hack as a separate commit?

  5. nit: space after comma

  6. desktop/core/src/desktop/models.py (Diff revision 2)
     
     

    Why the parenthesis?

  7. desktop/core/src/desktop/models.py (Diff revision 2)
     
     

    Could revert now? (should always be there if context processors work)

  8. 
      
Loading...