Hi,

I know, that ./manage.py runserver is not considered being secure.
In my context this doesn't matter.
What matters in my context is following:
- start a python process
- start at any time later on demand a web server
- this server shall serve django contents and shall have full read
  / write  access to main processes variables

I'd like to start one python process (an existing program I wrote quite some time ago and which I can't refactor easily. At the moment it just uses some Django ORMs, but serves no http requests).

For debugging reasons I'd like it to be able to start an embedded, unsecure web server on demand (can be single threaded. performance is not an issue), which has read / write access to the variables of my program (so it must not be started in a subprocess)

My first naive approach was starting the "runserver" command of the Django management commands.
This doesn't really work though.

Runserver seems to try to reexecute the entire python executable in another process. This causes problems as my code tries to access mutually exclusive resources (files, listening on sockets, . . . )

Does anyone have a suggestion of how to serve django contents from within one executable?

Would twisted be a solution? (serve django wsgi contents for http clients in a thread parallel to the main thread)? If yes does anyone have an example (only threads serving contents)

Do you have any other ideas / suggestions?

The solution should work for Linux and Windows and not require too many excotic packages / binaries to be installed. (However if somebody knows a solution working only for one of the platforms I'd still be interested)

Thanks in advance for your ideas.



--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ln4okr%24nh7%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to