PacktPublishing / Django-5-By-Example

Django 5 By Example (5th Edition) published by Packt
https://djangobyexample.com/
MIT License
180 stars 81 forks source link

bookmarklet_launcher.js - TemplateDoesNotExist #15

Open rahul4200 opened 3 months ago

rahul4200 commented 3 months ago

In the dashboard.html file which is inside bookmarks/account/templates/account/dashboard.html has the below paragraph:

<p>Drag the following button to your bookmarks toolbar to bookmark images from other websites → <a href="javascript:{% include "bookmarklet_launcher.js" %}" class="button">Bookmark it</a></p>

But this bookmarklet_launcher.js file is inside another django app - bookmarks/images/templates/bookmarklet_launcher.js.

When I run my Django app, I get the below error:

TemplateDoesNotExist
django.template.exceptions.TemplateDoesNotExist: bookmarklet_launcher.js

And I understand why this is happening. As how can I refer to a template that is not even in the same application. Plus, this is a .js file and not an html template, yet we have done a include template tag.

I am confused and have no idea, how to move forward.