pythad pythad - 1 year ago 80
Python Question

What is the right place to initialize third-party API in Django project for later Celery use

I have a twitter API used in my Django project.

Right now I keep initialization in my
and in
I just import API from
. I am not sure if it's a good practice as I've never seen it. Do I need to create API instance somewhere in
or even in the task function?

Answer Source

With Celery better in the task function

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download