Reputation: 20222
I have the following two files:
/quiz/quiz/views.py
and
/quiz/static/questions.html
I would like to import questions.html
into views.py
.
So I'm trying to do this:
from ..static import *
However, I'm getting:
ValueError: Attempted relative import beyond toplevel package
Upvotes: 0
Views: 798
Reputation: 274
As Sebastian Wozny answered, you can not import such files in python.
Try to write module that parse useful data from html file then import that module.
Upvotes: 1