python - How to configue apache and mode_wsgi for local django development on windows -
the team work has outgrown django development server running django applications within our local development environments. environment (server 2008 vm) mix of .net applications backed off of iis7 coupled several django applications.
we have need being able have our local development environments run applications concurrently ease of development , testing. have decided move towards full instance of apache running alongside iis more closely resemble our production , testing environments (the difference of course being linux / windows host of apache).
we have configured mod_wsgi , apache run locally seems not quite have either python or django path configured correctly @ runtime our applications complaining views not exist error's like:
could not import reporting.views. error was: dll load failed: specified module not found.
the django exception location showing:
exception location: c:\python27\lib\site-packages\django\core\urlresolvers.py in _get_callback, line 132
therefore assume sort of path problem of yet have not been able figure out going wrong.
thanks all.
loadmodule wsgi_module modules/mod_wsgi.so wsgipythonhome x:\pathtoapplication\venv\scripts <virtualhost *:8000> servername applicationdomain serveralias applicationapidomain setenv django_env local wsgiscriptalias / x:/pathtoapplication/apache/django.wsgi <directory x:/pathtoapplication/ > order allow,deny allow </directory> </virtualhost> <virtualhost *:8001> servername applicationdomain setenv django_env local sslengine on sslprotocol -sslv2 sslciphersuite all:!adh:!export:!sslv2:rc4+rsa:+high:+medium:+low sslcertificatefile "c:\program files (x86)\apache software foundation\apache2.2\conf\wildcard.crt" sslcertificatekeyfile "c:\program files (x86)\apache software foundation\apache2.2\conf\wildcard.key" wsgiscriptalias / x:/pathtoapplication/apache/django.wsgi <directory x:/pathtoapplication/ > order allow,deny allow </directory> </virtualhost>
your problem has compiled modules , mod_wsgi.
python python.org has embedded manifest allows load dll files. when compiling c modules python used embed manifest in compiled modules, since has started stripping them out default. issue here mod_wsgi includes it's own python interpreter not have manifest file included.
i think in order work need either compile mingw, embed manifest apache, or change python embed manifest modules compiling.
http://www.mail-archive.com/modwsgi@googlegroups.com/msg06255.html has response embedding manifest apache2.
if memory serves somewhere around line 680ish of python27/lib/distutils/msvc9compiler.py there should bit of code looks like
try: # remove references visual c runtime, # fall through visual c dependency of python.exe. # way, when installed restricted user (e.g. # runtimes not in winsxs folder, in python's own # folder), runtimes not need in every folder # .pyd's. manifest_f = open(manifest_file) try: manifest_buf = manifest_f.read() finally: manifest_f.close() pattern = re.compile( r"""<assemblyidentity.*?name=("|')microsoft\.""" \ r"""vc\d{2}\.crt("|').*?(/>|</assemblyidentity>)""", re.dotall) manifest_buf = re.sub(pattern, "", manifest_buf) pattern = "<dependentassembly>\s*</dependentassembly>" manifest_buf = re.sub(pattern, "", manifest_buf) manifest_f = open(manifest_file, 'w') try: manifest_f.write(manifest_buf) finally: manifest_f.close() except ioerror: pass
removing or commenting out should stop python stripping out manifest file.
Comments
Post a Comment