Quantcast

need advice/tips on storing favicon in my django bookmark app

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

need advice/tips on storing favicon in my django bookmark app

Stephen Fox
I've developed a bookmark manager app in django. Things are working well. It's pretty cool, has a js bookmarklet and such. In my model I have fields such as link title, link category, link url, etc... I'd like to have an image as well.

So I was thinking of grabbing the favicon for the links and storing that as base64 in a CharField. Then pass that to the template and show an image along with the other link info.

I've had some issues however, I've tried messing with pyfav and just grabbing /favicon.ico and trying to encode to base64. I suppose I could also just point to {{ link.url }}/favicon.ico but not every site offers the favicon that way.

Just curious to see what other ideas someone has for offering an image to go along with my saved links.

Thanks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/705681e0-7050-44f7-ba8b-cc1ed66de7db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: need advice/tips on storing favicon in my django bookmark app

Antonis Christofides-2

The favicon is pointed to inside the web page by an element such as this: <link rel="shortcut icon" href="...">. This is inside the <head>. To find the favicon you need to parse the HTML and locate the element. If you choose to download it and store it, the canonical way would be to use an ImageField.

Regards,

A.

Antonis Christofides
http://djangodeployment.com

On 03/16/2017 11:15 PM, Stephen Fox wrote:
I've developed a bookmark manager app in django. Things are working well. It's pretty cool, has a js bookmarklet and such. In my model I have fields such as link title, link category, link url, etc... I'd like to have an image as well.

So I was thinking of grabbing the favicon for the links and storing that as base64 in a CharField. Then pass that to the template and show an image along with the other link info.

I've had some issues however, I've tried messing with pyfav and just grabbing /favicon.ico and trying to encode to base64. I suppose I could also just point to {{ link.url }}/favicon.ico but not every site offers the favicon that way.

Just curious to see what other ideas someone has for offering an image to go along with my saved links.

Thanks
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/705681e0-7050-44f7-ba8b-cc1ed66de7db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/43895337-e7ca-8ab5-cf1f-46d6b5089fb1%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.
Loading...