On 23/10/2014, at 1:36 AM, Yikang Mao <[email protected]> wrote:
> HI,
>
> I am working on a project which have three parts
>
> 1: Website to make user configure something which is handled by a django app,
> config.wsgi
> 2: Serve the segment files for MPEG Dash which is handled by another django
> app, mpegdash.wsgi
> 3: Static resources.
>
> I use the following configuration
> ------------------------------------------------------------
> DocumentRoot "C:/xampp/htdocs"
>
> Alias /mat_static/ "E:/Work/MAT/static_web_files/"
>
> WSGIScriptAlias /mth "E:/Work/mat/config.wsgi"
> WSGIScriptAliasMatch
> ^/testsuite/tests/a-z0-9][a-z0-9\-]*(\.[a-z0-9][a-z0-9\-]*)+_[A-Z0-9][A-Z0-9_\-]*)/(.*\.fmp4)/(.*)$
> "E:/Work/MAT/mpegdash.wsgi"
> ----------------------------------------------------
Your pattern doesn't appear to be valid. I don't know if you simply cut and
paste it wrong. There is a missing opening '[' on the first character class
match 'a-z0-9'.
In general you have to be very careful in using WSGIScriptAliasMatch and I
would always recommend against it if you can.
Why can't you just have:
WSGIScriptAlias / testsuite/tests "E:/Work/MAT/mpegdash.wsgi"
and have the script internally do pattern match on PATH_INFO and reject with a
404 if not matching.
> Now the problem is that only one instance of django can work, e.g. if I
> firstly perform the request for config.wsgi and it works, then any requests
> matching the second one will fail. If I perform a request e.g.
> http://mat.test/testsuite/test/mat.test_1050/720x576i_1000Kbps_3secseg_MP30_169/media.fmp4/video/1/init.mp4
> matching the rules for mpegdash.wsgi and it works, but any requests other
> than the request even it match the rule for config.wsgi or mpegdash.wsgi will
> fail. All the error is the same " File
> "C:\Python27\lib\site-packages\win32\lib\pywintypes.py", line 114, in
> __import_pywin32_system_module__
> assert sys.modules[modname] is old_mod, AssertionError"
> I was thinking that using WSGIDaemonProcess and soon found it is not
> supported on windows
> Could someone tell what is the real problem for this? any suggestion for
> apache configuration?
Anyway, for a start, have a read of:
http://blog.dscpl.com.au/2012/10/requests-running-in-wrong-django.html
For multiple Django instances in same process, you need to make sure your
Django wsgi.py is using:
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
and not:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
else the wrong config will be used.
The other possibility is that this win32 module you are using can only be used
in one Python sub interpreter of a process at a time. Since you are using
Django though, you cannot force the two to run together in one sub interpreter
and you don't have daemon mode available.
Lets check how those Django settings modules are setup first though.
Graham
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.