swapi-python
swapi-python copied to clipboard
ModuleNotFoundError: No module named 'settings'
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
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