1👍
Your include
tag is split over two lines:
images from other websites → <a href="javascript:{% include
"bookmarklet_launcher.js" %}" class="button">Bookmark it</a><p>
Django does not support multiple line tags. Change it to:
images from other websites → <a href="javascript:{% include "bookmarklet_launcher.js" %}" class="button">Bookmark it</a><p>
0👍
I have faced the similar error while going through the book.
The bookmark button is not functioning,when i debugged it through chrome debugger,i could able to see errors at js level.I have made two changes to resolve these errors.
1.Error message: net::ERR_ABORTED
Action step:
In the book its mentioned that to place bookmarklet.js in images application directory,but in bookmarklet_launcher.js the source is refered to below path
http://127.0.0.1:8000/static/js/bookmarklet.js?r=
So place bookmarklet.js in /static/js/
directory inside images application(if folder structure not available create it).
2.Error message: net::ERR_ABORTED
There is one more file that should be placed which is bookmarklet.css which is being refereed at below line in bookmarklet.js.
href: static_url + 'css/bookmarklet.css?r=' + Math.floor(Math.random()*99999999999999999999)
Action step:
create a file bookmarklet.css inside /static/css/
directory and place the css code.Refer below link for css code:
Git Hub link for css code reference
1.After the above steps,restart the development server.
2.Drag the bookmark it button to create a bookmark in browser.
3.Open any website that is HTTP(not https) and click on bookmark it(The one which is bookmarked in browser not bookmark it button).
4.The below pop up appears
- Enable to initialize other python module before first request (Django + mod_wsgi + apache)
- Broken plotly installation impacts Django
- Django-admin is not working Django 1.11 Python 3.6
0👍
the problem is that template doesn’t exist so try t do the following
**
1. make sure your include code in same line
2. make sure same name of the template exist on your project director /images/templates/file_name.js.
3. or go to setting and add your templates directory to templates.
4. if it load but no images views don’t forget that you only accept jpeg and jpg images only
** so you can try another sites like wikipedia **
- Django template – checkbox did not react when is select
- Django REST API connection issues
- How do I create a many to many relationship with an existing record?
0👍
I was able to solve this by making sure that the url from ngrok tunnel in the bookmarklet.js and bookmarklet_luncher.js starts with https not http
Instead of this http://127.0.0.1:8000/static/js/bookmarklet.js?r=
it should rather be
https://127.0.0.1:8000/static/js/bookmarklet.js?r=
- Extracting a nested list with Django and replacing values
- Django rq-scheduler, Issue in function execution, not executing the scheduled function
- How to prevent race condition in Django on INSERT with limiting SUM?
- Are these VirtualHost settings workable with Django?
0👍
After 4 hours of doing everything… googling, deleting code, and rewriting code…
Only had to hit Ctrl+C to stop server and re-run server .
Just take a break and come back to fix it 🙂
Mine works same as instructed in the book – no changes, no nothing.
Only restarted the server.