Project

Profile

Help

Issue #2898

closed

Django 1.10 breaks content app

Added by mhrivnak almost 7 years ago. Updated about 5 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

Also available in: Atom PDF