I understand that I asked this question an hour or so ago, but it was closed as a duplicate. I have however tried the solutions suggested in the other question, including upgrading my django, making changes to models and utils.py
#from
from django.core import urlresolvers
#to
from django.urls import reverse
but still getting 'cannot import name urlresolvers' as an error when I try run manage.py runserver.
This is the full error
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inne
r
self.run()
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py",
line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\comman
ds\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py",
line 77, in raise_last_exception
raise _exception[1]
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init
__.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py",
line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\__init__.py", line 24,
in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\apps\registry.py", lin
e 114, in populate
app_config.import_models()
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\apps\config.py", line
211, in import_models
self.models_module = import_module(models_module_name)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import
_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\allauth\account\models.py", l
ine 17, in <module>
from .utils import user_email
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\allauth\account\utils.py", li
ne 30, in <module>
from ..utils import (import_callable, valid_email_or_none,
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\allauth\utils.py", line 8, in
<module>
from django.core import urlresolvers
ImportError: cannot import name 'urlresolvers' from 'django.core' (C:\Users\User\AppData\Local\Programs\Pyth
on\Python37\lib\site-packages\django\core\__init__.py)
Just to reiterate- I have tried the solutions suggested here -> ImportError: No module named 'django.core.urlresolvers'
Related
When running a project via pipenv, I get the following stacktrace. As I typically do not work with pipenv and cookiecutter projects, I have been struggling to fix it. Any help is appreciated. In case it matters, it is this project that I am trying to build and launch.
➜ project-shop git:(master) ✗ pipenv run ./manage.py runserver
[2022-11-04 13:08:19,329 autoreload] INFO: Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/user/miniconda3/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/home/user/miniconda3/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/utils/autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/home/user/miniconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django_elasticsearch_dsl/__init__.py", line 5, in <module>
from .documents import Document # noqa
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/django_elasticsearch_dsl/documents.py", line 8, in <module>
from elasticsearch.helpers import bulk, parallel_bulk
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/elasticsearch/__init__.py", line 36, in <module>
from .client import Elasticsearch
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/elasticsearch/client/__init__.py", line 23, in <module>
from ..transport import Transport, TransportError
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/elasticsearch/transport.py", line 26, in <module>
from .connection import Urllib3HttpConnection
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/elasticsearch/connection/__init__.py", line 20, in <module>
from .http_urllib3 import Urllib3HttpConnection, create_ssl_context
File "/home/user/.local/share/virtualenvs/project-shop-d1PiLiCc/lib/python3.7/site-packages/elasticsearch/connection/http_urllib3.py", line 18, in <module>
import ssl
File "/home/user/miniconda3/lib/python3.7/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: libssl.so.1.0.0: cannot open shared object file: No such file or directory
add :
deb http://security.ubuntu.com/ubuntu xenial-security main
in /etc/apt/source.list
then ==> apt-get update ,
apt install libssl1.0.0
when I install the package sweetify, I get the following error
Does anyone know what the reason is?
I went through all the steps that were in the main dock
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Program Files\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\core\management\__init__.py", line 398, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\apps\config.py", line 228, in create
import_module(entry)
File "C:\Program Files\Python38\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 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\sweetify\__init__.py", line 1, in <module>
from .sweetify import *
File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\sweetify\sweetify.py", line 5, in <module>
from .encoder import LazyEncoder
File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\sweetify\encoder.py", line 2, in <module>
from django.utils.encoding import force_text
ImportError: cannot import name 'force_text' from 'django.utils.encoding' (C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\utils\encoding.py)
Looks like sweetify is not compatible with Django 4.0. See the changelog: https://docs.djangoproject.com/en/4.0/releases/4.0/#features-removed-in-4-0
django.utils.encoding.force_text() and smart_text() are removed.
Try with older version of django, I recommend 3.2.13 :)
this error is coming from django v4 . according to django documentation django.utils.encoding.force_text() and smart_text() are removed.
possible solution :
1 - using Django version 4> add in settings.py :
import django
from django.utils.encoding import force_str
django.utils.encoding.force_text = force_str
Downgrade your django version to django<=3
I am getting the error while trying to run a project in django.
The error is :
Watching for file changes with StatReloader Exception in thread
django-main-thread: Traceback (most recent call last):
I have installed it in the virtual environment.
The detailed error included below
(venv) D:\djEnv\t2>python3 manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "c:\programdata\anaconda3\Lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "c:\programdata\anaconda3\Lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "D:\djEnv\venv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "D:\djEnv\venv\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "D:\djEnv\venv\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "D:\djEnv\venv\lib\site-packages\django\core\management\__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "D:\djEnv\venv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "D:\djEnv\venv\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "D:\djEnv\venv\lib\site-packages\django\apps\registry.py", line 114, in populate
app_config.import_models()
File "D:\djEnv\venv\lib\site-packages\django\apps\config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "D:\djEnv\venv\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\djEnv\venv\lib\site-packages\django\contrib\auth\models.py", line 2, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "D:\djEnv\venv\lib\site-packages\django\contrib\auth\base_user.py", line 47, in <module>
class AbstractBaseUser(models.Model):
File "D:\djEnv\venv\lib\site-packages\django\db\models\base.py", line 121, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "D:\djEnv\venv\lib\site-packages\django\db\models\base.py", line 325, in add_to_class
value.contribute_to_class(cls, name)
File "D:\djEnv\venv\lib\site-packages\django\db\models\options.py", line 208, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "D:\djEnv\venv\lib\site-packages\django\db\__init__.py", line 28, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "D:\djEnv\venv\lib\site-packages\django\db\utils.py", line 207, in __getitem__
backend = load_backend(db['ENGINE'])
File "D:\djEnv\venv\lib\site-packages\django\db\utils.py", line 111, in load_backend
return import_module('%s.base' % backend_name)
File "D:\djEnv\venv\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "D:\djEnv\venv\lib\site-packages\django\db\backends\sqlite3\base.py", line 14, in <module>
from sqlite3 import dbapi2 as Database
File "c:\programdata\anaconda3\Lib\sqlite3\__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "c:\programdata\anaconda3\Lib\sqlite3\dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: DLL load failed: The specified module could not be found.
The terminal keeps on buffering after this
Following the answer linked by #bmons, I updated my %PATH% to include
C:\ProgramData\Anaconda3\envs\py36\Lib\site-packages\pythonwin
C:\ProgramData\Anaconda3\envs\py36\Lib\sqlite3
Directions for updating the %PATH% variables on windows10: https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/
I just began with Django, I'm following the steps of a youtube tutorial, but when I want to run this command:
python manage.py runserver
This is the error message:
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x03E82780>
Traceback (most recent call last):
File "D:\Personal\Dev\cfehome\lib\site-packages\django\utils\autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "D:\Personal\Dev\cfehome\lib\site-packages\django\core\management\commands\runserver.py", line 117, in inner_run
autoreload.raise_last_exception()
File "D:\Personal\Dev\cfehome\lib\site-packages\django\utils\autoreload.py", line 251, in raise_last_exception
six.reraise(*_exception)
File "D:\Personal\Dev\cfehome\lib\site-packages\django\utils\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "D:\Personal\Dev\cfehome\lib\site-packages\django\utils\autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "D:\Personal\Dev\cfehome\lib\site-packages\django\__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "D:\Personal\Dev\cfehome\lib\site-packages\django\apps\registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "D:\Personal\Dev\cfehome\lib\site-packages\django\apps\config.py", line 94, in create
module = import_module(entry)
File "D:\Personal\Dev\cfehome\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\Personal\Dev\cfehome\lib\site-packages\django\contrib\admin\__init__.py", line 4, in <module>
from django.contrib.admin.filters import (
File "D:\Personal\Dev\cfehome\lib\site-packages\django\contrib\admin\filters.py", line 10, in <module>
from django.contrib.admin.options import IncorrectLookupParameters
File "D:\Personal\Dev\cfehome\lib\site-packages\django\contrib\admin\options.py", line 12, in <module>
from django.contrib.admin import helpers, widgets
File "D:\Personal\Dev\cfehome\lib\site-packages\django\contrib\admin\widgets.py", line 151
'%s=%s' % (k, v) for k, v in params.items(),
^
SyntaxError: Generator expression must be parenthesized
Do someone know how can I solve this error?
Follow the path in Your Django App
D:\Personal\Dev\cfehome\lib\site-packages\django\contrib\admin\widgets.py
Next step in line no.151 :
('%s=%s' % (k, v) for k, v in params.items())
You must have to parenthesize this.
i am new in python, I have created new app as crud, i am using django, app is created, but when i run the server it gives me below error, not getting what exactl error in that, In mysite/settings.py i have added in INSTALLED_APPS added crud.apps.CrudConfig still getting this error
C:\Users\Nikul\PycharmProjects\mysite>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 77, in raise_last_exception
raise _exception[0](_exception[1]).with_traceback(_exception[2])
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\apps\config.py", line 134, in create
% (mod_path, cls_name, ', '.join(candidates))
django.core.exceptions.ImproperlyConfigured: 'crud.apps' does not contain a class 'CrudConfig'. Choices are: 'PollsConfig'.
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 579, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 564, in start_django
reloader.run(django_main_thread)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 272, in run
get_resolver().urlconf_module
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\functional.py", line 80, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\resolvers.py", line 564, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\Nikul\PycharmProjects\mysite\mysite\urls.py", line 22, in <module>
path('crud/', include('crud.urls')),
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\Nikul\PycharmProjects\mysite\crud\urls.py", line 3, in <module>
from . import views
File "C:\Users\Nikul\PycharmProjects\mysite\crud\views.py", line 8, in <module>
from .models import Choice, Question
File "C:\Users\Nikul\PycharmProjects\mysite\crud\models.py", line 8, in <module>
class Question(models.Model):
File "C:\Users\Nikul\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\base.py", line 111, in __new__
"INSTALLED_APPS." % (module, name)
RuntimeError: Model class crud.models.Question doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
Can anyone please help me what we need to do to resolve that error ?