ImportError: cannot import name 'render_to_response' from 'django.shortcuts'

41 views
Skip to first unread message

Justin Taylor

unread,
Oct 19, 2021, 10:56:39 AM10/19/21
to django-wiki
I'm running wiki on Python3.6, and I'm trying to upgrade to Python3.9.  Wiki fails with this import error.

Packages:
Package            Version
------------------ --------
asgiref            3.4.1
bleach             3.3.1
Django             3.2.8
django-classy-tags 2.0.0
django-iprestrict  1.7.0
django-js-asset    1.2.2
django-mptt        0.11.0
django-nyt         1.2
django-sekizai     2.0.0
gunicorn           20.1.0
html5lib           1.1
ibm-db             2.0.5.12
itoolkit           1.6.1
Markdown           3.1.1
packaging          21.0
Pillow             8.3.1
pip                21.1.3
pyodbc             4.0.31
pyparsing          2.4.7
python-dateutil    2.8.1
pytz               2021.1
setuptools         56.0.0
six                1.16.0
sorl-thumbnail     12.7.0
sqlparse           0.4.2
webencodings       0.5.1
wheel              0.36.2
wiki               0.7.7



Traceback (most recent call last):
  File "/python/wiki/operations/./manage.py", line 21, in <module>
    main()
  File "/python/wiki/operations/./manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/python/wiki/env39/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/python/wiki/env39/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/python/wiki/env39/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/python/wiki/env39/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/python/wiki/env39/lib/python3.9/site-packages/django/core/management/commands/check.py", line 63, in handle
    self.check(
  File "/python/wiki/env39/lib/python3.9/site-packages/django/core/management/base.py", line 419, in check
    all_issues = checks.run_checks(
  File "/python/wiki/env39/lib/python3.9/site-packages/django/core/checks/registry.py", line 76, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "/python/wiki/env39/lib/python3.9/site-packages/django/core/checks/urls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "/python/wiki/env39/lib/python3.9/site-packages/django/core/checks/urls.py", line 23, in check_resolver
    return check_method()
  File "/python/wiki/env39/lib/python3.9/site-packages/django/urls/resolvers.py", line 412, in check
    for pattern in self.url_patterns:
  File "/python/wiki/env39/lib/python3.9/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/python/wiki/env39/lib/python3.9/site-packages/django/urls/resolvers.py", line 598, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/python/wiki/env39/lib/python3.9/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/python/wiki/env39/lib/python3.9/site-packages/django/urls/resolvers.py", line 591, in urlconf_module
    return import_module(self.urlconf_name)
  File "/QOpenSys/pkgs/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/python/wiki/operations/operations/urls.py", line 24, in <module>
    url(r'^iprestrict/', include('iprestrict.urls', namespace='iprestrict')),
  File "/python/wiki/env39/lib/python3.9/site-packages/django/urls/conf.py", line 34, in include
    urlconf_module = import_module(urlconf_module)
  File "/QOpenSys/pkgs/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/python/wiki/env39/lib/python3.9/site-packages/iprestrict/urls.py", line 5, in <module>
    from .views import test_rules_page, test_match, reload_rules
  File "/python/wiki/env39/lib/python3.9/site-packages/iprestrict/views.py", line 9, in <module>
    from django.shortcuts import render_to_response
ImportError: cannot import name 'render_to_response' from 'django.shortcuts' (/python/wiki/env39/lib/python3.9/site-packages/django/shortcuts.py)

Benjamin Balder Bach

unread,
Oct 19, 2021, 11:36:51 AM10/19/21
to djang...@googlegroups.com

Hi Justin

In your traceback, you can see that the error is from "iprestrict", it's not related to django-wiki

render_to_response was removed in Django 3.0


B

--
You received this message because you are subscribed to the Google Groups "django-wiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-wiki...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-wiki/784f4170-361e-4ca8-a5bc-d08be5b90183n%40googlegroups.com.

Justin Taylor

unread,
Oct 19, 2021, 3:16:54 PM10/19/21
to django-wiki
Thank you

--
You received this message because you are subscribed to a topic in the Google Groups "django-wiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-wiki/lRCSxicSPmo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-wiki...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages