How to ivoke update_feed() from /data_feeds/google_merchand.py/ every time when load url in saleor?

71 Views Asked by At

I need to invoke update_feed() on url - localhost:8000/feeds/google_merchand.py/. update_feed() generates and saves file in directory.

There's a function get_feed_file_url():

def get_feed_file_url():
    return default_storage.url(FILE_PATH)

, and it's invoked on localhost:8000/feeds/google/ , and I tried to add update_feed() to this function. The problem is this function seems not to be call every time. In urls.py I found this line:

urlpatterns = [
    url(r'google/$', RedirectView.as_view(
        get_redirect_url=get_feed_file_url, permanent=True), name='google-feed')]

and RedirectView redirect me directly to the generated file, but it sometimes does and doesn't invoke get_feed_file_url. get_feed_file_url is invoked for a few first times, but after a few times it stops invoke get_feed_file_url.

1

There are 1 best solutions below

0
On

It seems to look, a browser caches url. All you have to do is clear browsing history on browser.