views:

163

answers:

3

I need to develop an app that runs side by side with a django-app. This will be the first time i develop a multithreaded app that runs next to a django-app so are there any 'gotchas' and 'traps' i should be aware of?

A: 

What do you mean side by side with a django-app? Could you please elaborate a bit on what you are you planning to achieve? Then helping out/answering should be easier.


Answer on OP's 1st edit


Ah. Okey. I have encountered such an application which does exactly the thing you want. It's called feedjack and you can found it http://www.feedjack.org . I had tried to do something similar. Generally, I think you would be okey with such a case (separate process using Django's ORM to populate the DB with data). At least, I had not such problems when I was using their script along with a similar django app of mine.

Andrew Brown
the app is a routine that checks whether multiple rss-feeds have new entries. if so it should update the database with the new content. the problem is that it takes really long to check all the feeds and the user shouldnt notice this.
self.name
Please see the edit of my answer above. I hope taking a look at a similar application will help you understand better what you are trying to achieve.
Andrew Brown
@self.name, this use case has absolutely nothing to do with threading.
Daniel Roseman
@self.name: Do not add useful information in a comment on an answer. Please UPDATE your question with your additional information.
S.Lott
+2  A: 

Generally, your Django app already is multi-threaded. That's the way most of the standard Django servers operate -- they can tolerate multiple WSGI threads sending requests to them.

Further, you'll almost always have Django running under Apache, which is also multi-threaded.

If you use mod_wsgi, then Django may be part of the Apache process or a separate process.

Anything that is running "side-by-side" (Whatever that means) will be outside Apache, outside Django, and in a separate process.

So any multi-threading considerations don't apply between your Apache process (which contains Django) and your other process.

S.Lott
A: 

If you want to expose your django-app to some external software, you need to create an API for your application.

You should look at REST http://code.google.com/p/django-rest-interface/ and XMLRPC http://code.google.com/p/django-xmlrpc/

The multi-threaded nature of the external app is not a problem for django served by a production webserver (Apache for example) because by design django is able to serve many requests in parrallel

I hope it helps

luc