dimanche 1 mai 2016

long runner to regularly update Django DB with web harvested data -?

My Django project has a user facing site, which infrequently inserts new objects into the user-DB-table (later there will be hundreds, perhaps thousands).

Additionally, a few times per day, I need to query an external webservice, for all my objects - but slowly, so not to violate their "1 request per 10 seconds" rule. So this 2nd task is a long runner, I cannot route it through an urls.py request.

Thus, besides the (uWSGI) server process ... I will have a 2nd process running in the background; it needs to work with the same database (using the default sqlite3).

  • can I run into concurrency issues when accessing the same DB? (How) can Django protect me from that? (If not) How to solve?
  • importing my models.py - is that all I need to do to access the django DB?
  • any other hints that might help me?

Thanks a million!
Stackoverflow rocks!

:-)

Aucun commentaire:

Enregistrer un commentaire