Project

Profile

Help

Issue #2898

Django 1.10 breaks content app

Added by mhrivnak over 4 years ago. Updated almost 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
2.12.2
Platform Release:
2.13.3
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 22
Quarter:

Description

This breaks Pulp running on Fedora 26, which ships with django 1.10. I observed the bug on Pulp 2.12.2, but it appears to affect master.

According to django's warning message, "django.conf.urls.patterns() is deprecated and will be removed in Django 1.10."

https://github.com/django/django/blob/1.9.13/django/conf/urls/__init__.py#L81-L83

We fixed that in one place:

https://github.com/pulp/pulp/commit/fcee56f18f7af067403d657b6a2e5bd0fab67dcf#diff-27ce5c9f148a18511cb5629a5adf8152R1

But not this one (the above commit just forgot the import statement in the file below):

https://github.com/pulp/pulp/blob/2.13-release/server/pulp/server/content/web/urls.py#L1

The result is a traceback when trying to access the content app.

[Thu Jul 13 00:28:52.190844 2017] [wsgi:error] [pid 7] [remote 172.17.0.1:53180] ImportError: cannot import name patterns
[Thu Jul 13 00:46:11.863951 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642] mod_wsgi (pid=10): Exception occurred processing WSGI script '/usr/share/pulp/wsgi/content.wsgi'.
[Thu Jul 13 00:46:11.863992 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642] Traceback (most recent call last):
[Thu Jul 13 00:46:11.864004 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]   File "/usr/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 170, in __call__
[Thu Jul 13 00:46:11.864292 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]     response = self.get_response(request)
[Thu Jul 13 00:46:11.864302 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]   File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 124, in get_response
[Thu Jul 13 00:46:11.864318 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]     response = self._middleware_chain(request)
[Thu Jul 13 00:46:11.864323 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]   File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py", line 44, in inner
[Thu Jul 13 00:46:11.864333 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]     response = response_for_exception(request, exc)
[Thu Jul 13 00:46:11.864337 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]   File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py", line 94, in response_for_exception
[Thu Jul 13 00:46:11.864346 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
[Thu Jul 13 00:46:11.864350 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]   File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py", line 139, in handle_uncaught_exception
[Thu Jul 13 00:46:11.864358 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]     if resolver.urlconf_module is None:
[Thu Jul 13 00:46:11.864362 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]   File "/usr/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
[Thu Jul 13 00:46:11.864370 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]     res = instance.__dict__[self.name] = self.func(instance)
[Thu Jul 13 00:46:11.864374 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]   File "/usr/lib/python2.7/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
[Thu Jul 13 00:46:11.864383 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]     return import_module(self.urlconf_name)
[Thu Jul 13 00:46:11.864387 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
[Thu Jul 13 00:46:11.864396 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]     __import__(name)
[Thu Jul 13 00:46:11.864418 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]   File "/usr/lib/python2.7/site-packages/pulp/server/content/web/urls.py", line 1, in <module>
[Thu Jul 13 00:46:11.864430 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642]     from django.conf.urls import patterns, url
[Thu Jul 13 00:46:11.864441 2017] [wsgi:error] [pid 10] [remote 172.17.0.1:53642] ImportError: cannot import name patterns

Associated revisions

Revision cbfb0c51 View on GitHub
Added by mhrivnak over 4 years ago

Removes a stray import that was incompatible with django >= 1.10

https://pulp.plan.io/issues/2898 fixes #2898

History

#1 Updated by mhrivnak over 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to mhrivnak
  • Sprint/Milestone set to 41
  • Version set to 2.12.2

#2 Updated by mhrivnak over 4 years ago

  • Status changed from ASSIGNED to POST

#3 Updated by mhrivnak over 4 years ago

  • Status changed from POST to MODIFIED

#4 Updated by pcreech over 4 years ago

  • Platform Release set to 2.13.3

#5 Updated by pcreech over 4 years ago

  • Status changed from MODIFIED to 5

#6 Updated by pcreech over 4 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#7 Updated by bmbouter almost 4 years ago

  • Sprint set to Sprint 22

#8 Updated by bmbouter almost 4 years ago

  • Sprint/Milestone deleted (41)

#9 Updated by bmbouter almost 3 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF