So I'm trying to get the template path in my view. Is there a dynamic way of doing this because at the moment I am hard-coding the path.
html = 'C:/Users/user/Desktop/project/src/templates/project.html'
Templates Path
TEMPLATES = [
'DIRS': [os.path.join(BASE_DIR, "templates")],
]
View
html = 'C:/Users/user/Desktop/project/src/templates/project.html'
open_html = open(html, 'r')
soup = BeautifulSoup(open_html, "html5lib")
image = soup.find('img', {'name':'image_url'})
img_url = image.get('src')
open_html.close()