Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'django.core.urlresolvers' #69

Open
neutralboy opened this issue Jun 18, 2018 · 4 comments
Open

ModuleNotFoundError: No module named 'django.core.urlresolvers' #69

neutralboy opened this issue Jun 18, 2018 · 4 comments

Comments

@neutralboy
Copy link

Traceback (most recent call last):
  File "/home/pc/.local/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 44, in get_internal_wsgi_application
    return import_string(app_path)
  File "/home/pc/.local/lib/python3.6/site-packages/django/utils/module_loading.py", line 17, in import_string
    module = import_module(module_path)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/pc/Django_Projects/femi/femi/wsgi.py", line 16, in <module>
    application = get_wsgi_application()
  File "/home/pc/.local/lib/python3.6/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
    return WSGIHandler()
  File "/home/pc/.local/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 140, in __init__
    self.load_middleware()
  File "/home/pc/.local/lib/python3.6/site-packages/django/core/handlers/base.py", line 37, in load_middleware
    middleware = import_string(middleware_path)
  File "/home/pc/.local/lib/python3.6/site-packages/django/utils/module_loading.py", line 17, in import_string
    module = import_module(module_path)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.6/dist-packages/subdomains/middleware.py", line 8, in <module>
    from subdomains.utils import get_domain
  File "/usr/local/lib/python3.6/dist-packages/subdomains/utils.py", line 8, in <module>
    from django.core.urlresolvers import reverse as simple_reverse
ModuleNotFoundError: No module named 'django.core.urlresolvers'

Please remove the dependency of django.core.urlresolvers and change it to django.urls to make it compatible with Django 2.0

@GauravJain98
Copy link

This PR will fix this issue
#67

@jasonhoward64
Copy link

jasonhoward64 commented Aug 27, 2018

GuaravJain98, I can confirm that the code in the PR that you've linked to doesn't work.

Unhandled exception in thread started by <function check_errors..wrapper at 0x000002803214F6A8>
Traceback (most recent call last):
File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\commands\runserver.py", line 140, in inner_run
handler = self.get_handler(*args, **options)
File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\django\contrib\staticfiles\management\commands\runserver.py", line 27, in get_handler
handler = super().get_handler(*args, **options)
File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\commands\runserver.py", line 65, in get_handler
return get_internal_wsgi_application()
File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\servers\basehttp.py", line 44, in get_internal_wsgi_application
return import_string(app_path)
File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\django\utils\module_loading.py", line 17, in import_string
module = import_module(module_path)
File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "C:\Users\jason\Desktop\jasonold2\jasonsproject\wsgi.py", line 16, in
application = get_wsgi_application()
File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\wsgi.py", line 13, in get_wsgi_application
return WSGIHandler()
File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\handlers\wsgi.py", line 140, in init
self.load_middleware()
File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\handlers\base.py", line 39, in load_middleware
mw_instance = middleware(handler)
TypeError: object() takes no parameters

@annenies
Copy link

annenies commented Nov 9, 2018

I am also having the same issue. I'm running Python 3.6, Django 2.1. I tried from django.urls import reverse_lazy as simple_reverse and it also gives the same error as above.

@bartmika
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants