Hi!, exists some solution for this issue? or alternate solution? In my enviroment i have (pip freeze):
Django==1.7.10
django-braces==1.8.1
django-filter==0.11.0
django-mssql==1.7
django-oauth-toolkit==0.9.0
djangorestframework==3.3.1
Markdown==2.6.5
oauthlib==1.0.1
pythonnet==2.0.0
pywin32==219
requests==2.8.1
six==1.10.0
virtualenv==13.1.2
And run with mod_wsgi 4.4.12, python 2.7.11, apache 2.4 on windows server 2012. I think maybe if i use other connector or other web server can function well, because if i remove 'import clr' from my code in Django, Apache+WSGI are well and all function correct, but if i add 'import clr' webserver doesn't anything, logs are empty and server is without errors. And if using django runserver, all function well.
Thank you @mikofski but that not is my better solution.
Because i use DLL and i require keep open connection with other program on Windows, if i use EXE like function on subprocess (hi.exe args...) imply for each operation send will open and close connection with that program; so will be really slow.
I will search other solution, but 'subprocess' will be my plan b.
So, thanks. Best regards.
PD. The DLL what i use is related with SAP BO, SAP SDK DI API.
I needed to use a particular .NET assembly that communicated with an ASP.NET framework to get some data from a MSSQL server. I did not have access to the database directly, nor could I use the ASP.NET framework from Python. It was a black box, and all I was given was the DLL with exposed methods like GetWeatherDataHeader() etc. I used subprocess in the interim and we eventually replaced the entire framework with all Django and PostgreSQL on Linux. So no more need for Python.NET on this project. But there are always others.
I found that this suggestion from Graham Dumpleton solved my problem with server hanging at import clr when using mod-wsgi==4.6.4+ap24vc14 on Python 3.6.5. https://stackoverflow.com/a/4236503
Set:
WSGIApplicationGroup %{GLOBAL}
See the application issues document on mod_wsgi wiki.
Most likely you have an extension module not designed to work in sub interpreter. The above forces it to run in main interpreter.
Activity
eisenheimjelid commented on Dec 16, 2015
Hi!, exists some solution for this issue? or alternate solution? In my enviroment i have (pip freeze):
Django==1.7.10
django-braces==1.8.1
django-filter==0.11.0
django-mssql==1.7
django-oauth-toolkit==0.9.0
djangorestframework==3.3.1
Markdown==2.6.5
oauthlib==1.0.1
pythonnet==2.0.0
pywin32==219
requests==2.8.1
six==1.10.0
virtualenv==13.1.2
And run with mod_wsgi 4.4.12, python 2.7.11, apache 2.4 on windows server 2012. I think maybe if i use other connector or other web server can function well, because if i remove 'import clr' from my code in Django, Apache+WSGI are well and all function correct, but if i add 'import clr' webserver doesn't anything, logs are empty and server is without errors. And if using django runserver, all function well.
Any idea?
mikofski commented on Dec 16, 2015
@eisenheimjelid I had to use IronPython with subprocess
a little slow depending on your machine, but works fine.
For Windows you will need .NET and for Linux/Darwin you will need Mono
on Ubuntu:
eisenheimjelid commented on Dec 16, 2015
Thank you @mikofski but that not is my better solution.
Because i use DLL and i require keep open connection with other program on Windows, if i use EXE like function on subprocess (hi.exe args...) imply for each operation send will open and close connection with that program; so will be really slow.
I will search other solution, but 'subprocess' will be my plan b.
So, thanks. Best regards.
PD. The DLL what i use is related with SAP BO, SAP SDK DI API.
mikofski commented on Mar 15, 2016
related to #180 and #181
den-run-ai commented on Feb 20, 2017
@mikofski @eisenheimjelid why would you use .NET from Flask/Django app?
mikofski commented on Feb 20, 2017
I needed to use a particular .NET assembly that communicated with an ASP.NET framework to get some data from a MSSQL server. I did not have access to the database directly, nor could I use the ASP.NET framework from Python. It was a black box, and all I was given was the DLL with exposed methods like GetWeatherDataHeader() etc. I used subprocess in the interim and we eventually replaced the entire framework with all Django and PostgreSQL on Linux. So no more need for Python.NET on this project. But there are always others.
GregoryKimball commented on Feb 12, 2019
I found that this suggestion from Graham Dumpleton solved my problem with server hanging at import clr when using mod-wsgi==4.6.4+ap24vc14 on Python 3.6.5.
https://stackoverflow.com/a/4236503
Set:
WSGIApplicationGroup %{GLOBAL}
See the application issues document on mod_wsgi wiki.
Most likely you have an extension module not designed to work in sub interpreter. The above forces it to run in main interpreter.