1

I am new to Django and I have been working on a Stripe based application and I found out that my class based views are quiet slow and I need to make them run as fast as possible. I discovered that in Django there is Asynchronous Support available but I am unable to figure how can I use it in class based views everywhere I find there are functional based example just.

Django documentation that I was looking into was: Django Asynchronous Support

I want to make my Stripe call faster. Any help will be appreciated I am new and learning Django.

1 Answer 1

1

Whenever you need to improve performance, start with a profiler. The slow part might not be what you expect.

I suspect, in particular, that calling the Stripe API as part of a routine JSON conversion could be slow. You may want to cache a copy of the Stripe API data in a Subscription model, so you don't have to hit an external API on every request. However ... again ... make sure you profile first.

Sign up to request clarification or add additional context in comments.

3 Comments

I know the reason is because of stripe. I don't want to put load on my model as this is just for displaying purpose only. There's no need to store it that's why I am not storing it in my model.
OK. I think that using async Django is only going to give you a tiny performance boost if any, compared to the Stripe API call time.
Can you guide me how can I use async for stripe calls? I am a little stuck

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.