-2

strong textenter image description here I am trying to run my django server using the python manage.py runservercommand. Keep getting this error in my shell. The development server is refusing to load. The image is the error message I'm getting enter image description here

This is the error gotten after running the stated command above

`Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    main()
  File "manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\core\management\__init__.py", line 440, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\core\management\base.py", line 414, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\core\management\base.py", line 460, in execute
    output = self.handle(*args, **options)
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\core\management\commands\check.py", line 76, in handle
    self.check(
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\core\management\base.py", line 487, in check
    all_issues = checks.run_checks(
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\core\checks\registry.py", line 88, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\core\checks\urls.py", line 14, in check_url_config
    return check_resolver(resolver)
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\core\checks\urls.py", line 24, in check_resolver
    return check_method()
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\urls\resolvers.py", line 480, in check
    for pattern in self.url_patterns:
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\utils\functional.py", line 49, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\urls\resolvers.py", line 696, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\utils\functional.py", line 49, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\urls\resolvers.py", line 689, in urlconf_module
    return import_module(self.urlconf_name)
  File "c:\users\my pc\anaconda3\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\MY PC\desktop\django_exp\src\django_novice\django_novice\urls.py", line 22, in <module>
    path('polls/', include('polls.urls')),
  File "C:\Users\MY PC\desktop\django_exp\lib\site-packages\django\urls\conf.py", line 38, in include
    urlconf_module = import_module(urlconf_module)
  File "c:\users\my pc\anaconda3\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\MY PC\desktop\django_exp\src\django_novice\polls\urls.py", line 19, in <module>
    from . import views
  File "C:\Users\MY PC\desktop\django_exp\src\django_novice\polls\views.py", line 1, in <module>
    from curses.ascii import HT
  File "c:\users\my pc\anaconda3\lib\curses\__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses'`
4
  • tbh doesn't seems related to django server at all but just an error in your code that is not allowing the application to run properly. too bad can't read the last line of the error log.
    – Carlo
    Commented Jul 9, 2022 at 14:44
  • @Carlo Oh, really? I added a new screenshot to the question. You can check it for the lines that didn't appear in the initial screenshot Commented Jul 9, 2022 at 15:46
  • Please add the full stacktrace as code to your question.
    – JanMalte
    Commented Jul 9, 2022 at 15:47
  • Please check if you're in the correct (virtual) environment and if the module is installed. You can also check if you have any typos.
    – Sindbaad
    Commented Jul 9, 2022 at 17:20

1 Answer 1

0

The import of curses.ascii import HT in your polls/views.py can not be loaded. This seems be an issue with your current python environment setup.

Please see this questions for more dtails: ImportError: No module named '_curses' when trying to import blessings

1
  • I have installed the windows-curses library as advised in the directed post. The problem isn't going away Commented Jul 9, 2022 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.