Cannot import PyObjC CoreData module when using mod_wsgi with Apache

I just ported the webapp from TurboGears to Django and went through the process of getting the proper server (i.e. not runserver). I tried using the recommended Apache + mod_wsgi route, which docs talk about in Django, but for some reason the thread stops without an error message or something else as soon as you try import CoreDataanywhere on the module loaded by Apache.

In particular, the point at which it is located is in the file CoreData/__init__.pyhere:

__bundle__ = _objc.initFrameworkWrapper("CoreData",
  frameworkIdentifier="com.apple.CoreData",
  frameworkPath=_objc.pathForFramework(
    "/System/Library/Frameworks/CoreData.framework"),
  globals=globals())

I'm not sure if this concerns CoreData, which makes it crash because it import Foundationworks fine (i.e. it seems that all PyObjC files are not split under Apache, but only CoreData).

I am looking into the future for the lighttpd route now, but if anyone can shed some light on how to make mod_wsgi work well, I would prefer to stick with the most approximate method of simple deployment as possible.

Thanks in advance for any ideas.

Also: I'm on OSX 10.6.4 with any latest version of PyObjC and Apache with this, as well as the latest mod_wsgi that I grabbed from the Google Code website.

+3
source share
1 answer

Try to get the WSGI application to work in the main interpreter. It seems that PyObjC is incorrectly implemented to be used in sub-interpreters. Cm:

http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Python_Simplified_GIL_State_API

+1

Source: https://habr.com/ru/post/1762167/


All Articles