I am working in Django 1.8 and Python 3.5 I have 3 apps -> mainpage,login,signup and the directory is given in the picture
I am trying to import mainpage/models.py in login/forms.py But when I do it it give If there is anything else you people want me to post tell me what do I do in the comments ?
and yes
Please I have read this already but not working.Thanks in advance
TRACEBACK
Environment:
Request Method: GET
Request URL: http://localhost:8000/login
Django Version: 1.8
Python Version: 3.5.4
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mainpage',
'signup',
'login',
'rest_framework',
'corsheaders')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware')
Traceback:
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\handlers\base.py" in get_response
108. response = middleware_method(request)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\middleware\common.py" in process_request
74. if (not urlresolvers.is_valid_path(request.path_info, urlconf) and
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\urlresolvers.py" in is_valid_path
647. resolve(path, urlconf)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\urlresolvers.py" in resolve
522. return get_resolver(urlconf).resolve(path)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\urlresolvers.py" in resolve
368. sub_match = pattern.resolve(new_path)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\urlresolvers.py" in resolve
240. return ResolverMatch(self.callback, args, kwargs, self.name)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\urlresolvers.py" in callback
247. self._callback = get_callable(self._callback_str)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\urlresolvers.py" in get_callable
106. mod = import_module(mod_name)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\importlib\__init__.py" in import_module
126. return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\vaibhav2\PycharmProjects\MajorProject\src\login\views.py" in <module>
2. from .forms import UserLoginForm
File "C:\Users\vaibhav2\PycharmProjects\MajorProject\src\login\forms.py" in <module>
2. from MajorProject.src.signup.models import allusers1
Exception Type: ImportError at /login
Exception Value: No module named 'MajorProject'
EDIT
According to @Alasdair's answer the error that is coming is this
ImportError at /login
No module named 'src.signup'
Environment:
Request Method: GET
Request URL: http://localhost:8000/login
Django Version: 1.8
Python Version: 3.5.4
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mainpage',
'signup',
'login',
'rest_framework',
'corsheaders')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware')
Traceback:
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\handlers\base.py" in get_response
108. response = middleware_method(request)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\middleware\common.py" in process_request
74. if (not urlresolvers.is_valid_path(request.path_info, urlconf) and
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\urlresolvers.py" in is_valid_path
647. resolve(path, urlconf)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\urlresolvers.py" in resolve
522. return get_resolver(urlconf).resolve(path)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\urlresolvers.py" in resolve
368. sub_match = pattern.resolve(new_path)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\urlresolvers.py" in resolve
240. return ResolverMatch(self.callback, args, kwargs, self.name)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\urlresolvers.py" in callback
247. self._callback = get_callable(self._callback_str)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\urlresolvers.py" in get_callable
106. mod = import_module(mod_name)
File "C:\Users\vaibhav2\AppData\Local\Programs\Python\Python35\lib\importlib\__init__.py" in import_module
126. return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\vaibhav2\PycharmProjects\MajorProject\src\login\views.py" in <module>
2. from .forms import UserLoginForm
File "C:\Users\vaibhav2\PycharmProjects\MajorProject\src\login\forms.py" in <module>
3. from src.signup.models import allusers1
Exception Type: ImportError at /login
Exception Value: No module named 'src.signup'