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 'settings' #19

Open
Acutapugione opened this issue Sep 10, 2023 · 0 comments
Open

ModuleNotFoundError: No module named 'settings' #19

Acutapugione opened this issue Sep 10, 2023 · 0 comments

Comments

@Acutapugione
Copy link

from django.shortcuts import render

Create your views here.

def index(request):
import swapi

films = swapi.get_all("films")
context = {
    'list': films
}
return render( request, 'index.html', context)

Internal Server Error: /films/
Traceback (most recent call last):
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/swapi/swapi.py", line 3, in
from swapi.utils import query, all_resource_urls
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/swapi/utils.py", line 1, in
import requests
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/requests/init.py", line 58, in
from . import utils
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/requests/utils.py", line 26, in
from .compat import parse_http_list as _parse_list_header
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/requests/compat.py", line 7, in
from .packages import chardet
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/requests/packages/init.py", line 3, in
from . import urllib3
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/requests/packages/urllib3/init.py", line 10, in
from .connectionpool import (
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/requests/packages/urllib3/connectionpool.py", line 38, in
from .response import HTTPResponse
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/requests/packages/urllib3/response.py", line 5, in
from ._collections import HTTPHeaderDict
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/requests/packages/urllib3/_collections.py", line 1, in
from collections import Mapping, MutableMapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/init.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/acuta/Документи/Python/django/part_10/starwars/films/views.py", line 6, in index
import swapi
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/swapi/init.py", line 7, in
from .swapi import (
File "/home/acuta/Документи/Python/django/part_10/.venv/lib/python3.10/site-packages/swapi/swapi.py", line 19, in
import settings
ModuleNotFoundError: No module named 'settings'
[10/Sep/2023 10:53:55] "GET /films/ HTTP/1.1" 500 222569

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

1 participant