Thank!

On Mon, Jul 13, 2020 at 10:24 AM Kasper Laudrup <laud...@stacktrace.dk>
wrote:

> Hi Carlos,
>
> On 13/07/2020 17.58, carlos wrote:
> > Hi, i need cache a function in Django
> > example
> >
> > def function1(request):
> >      some code ...
> >      return dict
> >
> > i know cache_page(50 * 10) but this functions in not a page is only a
> > function
> > return a dictionary.
> >
>
> What you most likely mean, is that you're looking for how to cache a
> function in Python. Have a look at the cached_property or lru_cache
> decorators.
>
> https://docs.python.org/3/library/functools.html
>
> Just remember caching can be tricky.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f21fe357-a409-81d1-ef08-f587a9e17c1f%40stacktrace.dk
> .
>


-- 
att.
Carlos Rocha

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO2icSDDgAnF4R7SV1iM_DvAwtLYJBw94Hize-G1Ni5kxA%40mail.gmail.com.

Reply via email to