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

Bug Report: Failed to Implement the Example on Django 4.0 #25

Open
NoguchiShigeki opened this issue Dec 29, 2021 · 4 comments
Open

Bug Report: Failed to Implement the Example on Django 4.0 #25

NoguchiShigeki opened this issue Dec 29, 2021 · 4 comments

Comments

@NoguchiShigeki
Copy link

  • django_private_chat2 version: 1.0.1
  • Django version: 4.0
  • Python version: 3.9.7
  • Operating System: Windows10 (Microsoft Windows [Version 10.0.19042.1415])

You may know this problem but I report this just in case.

I was trying to implement the example, I followed the instructions of "django_private_chat2/example/README.md5". In step5, I tried to apply migrations but an exception occurred.
Here's an error message:
ImportError: cannot import name 'url' from 'django.conf.urls'
I tried Django Version 3.2.10, it went well. All worked.

What I Did

Applied migrations on Django 4.0 (Failed)
Applied migrations on Django 3.2.10 (Success)

Traceback (most recent call last):
(venv) C:\Programming\Codes\Django Project\OCoWa_PoC\django_private_chat2-master_debug>python manage.py migrate
Traceback (most recent call last):
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\django_private_chat2-master_debug\manage.py", line 12, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\core\management\__init__.py", line 425, in execute_from_command_line
    utility.execute()
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\core\management\__init__.py", line 419, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\core\management\base.py", line 373, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\core\management\base.py", line 417, in execute
    output = self.handle(*args, **options)
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\core\management\base.py", line 90, in wrapped
    res = handle_func(*args, **kwargs)
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\core\management\commands\migrate.py", line 75, in handle
    self.check(databases=[database])
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\core\management\base.py", line 438, in check
    all_issues = checks.run_checks(
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\core\checks\registry.py", line 77, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
    return check_method()
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\urls\resolvers.py", line 446, in check
    for pattern in self.url_patterns:
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\utils\functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\urls\resolvers.py", line 632, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\utils\functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\urls\resolvers.py", line 625, in urlconf_module
    return import_module(self.urlconf_name)
  File "C:\Users\n1312\AppData\Local\Programs\Python\Python39\lib\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 "C:\Programming\Codes\Django Project\OCoWa_PoC\django_private_chat2-master_debug\example\urls.py", line 4, in <module>
    from django.conf.urls import url, include
ImportError: cannot import name 'url' from 'django.conf.urls' (C:\Programming\Codes\Django Project\OCoWa_PoC\chat\venv\lib\site-packages\django\conf\urls\__init__.py)

I'm very new to Programming and OSS Dev so I don't know this will help or not but I just report this.
This is what I was looking for! You guys doing a great job. Big thanks from the far east.

@delneg
Copy link
Collaborator

delneg commented Dec 29, 2021

Hello, this might be the issue with the example because it wasn't updated to support Django 4.0 (as opposed to the package itself)
I hope to have the time to fix it soon

@delneg
Copy link
Collaborator

delneg commented Dec 30, 2021

Please try the latest update from the repo, I've pushed some changes for django 4.0

@NoguchiShigeki
Copy link
Author

Thanks for your quick response

@delneg
Copy link
Collaborator

delneg commented Jan 10, 2022

Has the issue been resolved ? @NoguchiShigeki

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

2 participants