Reputation: 19
I am new to Django I get an error file not found when trying to read a json file that is in the same directory as views.py
# Load books from JSON file
with open('/books.json') as file:
books = json.load(file)
def index(request):
return render(request, 'books/index.html', books)
Upvotes: 0
Views: 9564