1. fanstatic
  2. fanstatic
  3. fanstatic
  4. Issues
Issue #81 resolved

Images with Fanstatic

schneems
created an issue

Hi, i'm new to the python ecosystem so forgive me if this isn't the most appropriate place to ask this question:

I got Fanstatic working well with Flask for css and js (thanks, integration was pretty easy). I need a library that generates hashes for my images like Fanstatic does for css/js So the when i update my images and deploy the browser uses the new image. While the docs mention it can serve images I couldn't find any examples of using Fanstatic with images. Is there any chance someone could point me in the right direction on how to use use Fanstatic to manage my images? If there is a better library to do this with images, could you point me in the right direction?

Thanks again for the library, and thanks for the help. Please point me in another direction if this is an inappropriate place for this question.

Comments (2)

  1. Jan-Jaap Driessen

    Thank you for choosing fanstatic. Fanstatic serves all files in the directory associated to a Library. In your code you can ask for the NeededResources object that is set up for every request. This object knows how to generate URLs to resources. You can ask the URL of a library by calling fanstatic.get_needed().library_url(x), where x is the library object.

    We did this for zope.fanstatic, the glue layer between Zope and fanstatic:

    http://svn.zope.org/zope.fanstatic/trunk/src/zope/fanstatic/zopesupport.py?rev=119711&view=markup

    I don't know whether the flask-fanstatic code supplies this functionality.

  2. Log in to comment