mod-wsgi

running django python 3.4 on mod_wsgi with apache2

荒凉一梦 提交于 2019-12-04 07:21:38
Hi I am getting the error below when going to the website url on ubuntu server 14.10 running apache 2 with mod_wsgi and python on django. My django application uses python 3.4 but it seems to be defaulting to python 2.7, I am unable to import image from PIL and AES from pycrypto. ImportError at / cannot import name _imaging Request Method: GET Request URL: Django Version: 1.7.3 Exception Type: ImportError Exception Value: cannot import name _imaging Exception Location: /usr/local/lib/python3.4/dist-packages/PIL/Image.py in , line 63 Python Executable: /usr/bin/python Python Version: 2.7.6

mod_wsgi process getting killed and django stops working

青春壹個敷衍的年華 提交于 2019-12-04 07:09:50
I have mod_wsgi running in daemon mode on a custom Linux build. I haven't included any number for processes or threads in the apache config. Here is my config: WSGIDaemonProcess django user=admin WSGIProcessGroup django WSGIScriptAlias /django_apps /django/apache/django.wsgi WSGIApplicationGroup %{GLOBAL} On the system, there is a httpd cleanup process running which kills any httpd process that exceeds a certain memory threshold. It looks like the httpd process which is running mod_wsgi is getting killed. Afterwards, the django portion of my website stops working. I get this error message:

File writing permission denied in mod_wsgi deployed app

孤人 提交于 2019-12-04 06:33:16
I'm trying to deploy a Pyramid app using mod_wsgi on Apache. I get IOError: [Errno 13] Permission denied on templates folder, where mako caches his templates, even if I grant write permissions to anybody . If I remove template caching from my ini file the site runs flawlessly. I also tried running Apache as the user owning the folder instead of www-data with no luck. Any clue? neurino It's an Apache permission issue, I had to change owner of folder to www-data user and set permissions to 775 chown -R www-data:www-data ~/data chmod -R 775 ~/data Also see here but note for Mako 664 permissions

Persistent multiprocess shared cache in Python with stdlib or minimal dependencies

我的未来我决定 提交于 2019-12-04 06:29:20
I just tried a Python shelve module as the persistent cache for data fetched from the external service. The complete example is here . I was wondering what would the best approach if I want to make this multiprocess safe? I am aware of redis, memcached and such "real solutions", but I'd like to use only the parts of Python standard library or very minimal dependencies to keep my code compact and not introduce unnecessary complexity when running the code in single process - single thread model. It's easy to come up with a single-process solution, but this does not work well current Python web

Django/Apache/mod_wsgi not using virtualenv's Python binary

谁说我不能喝 提交于 2019-12-04 06:15:55
I have a virtualenv at /opt/webapps/ff/ with its own Python installation. I have WSGIPythonHome set to /opt/webapps/ff in my Apache config file (and this is definitely getting used in some capacity, because if I set it to a slightly different existing directory and restart Apache I get a 504). But if I e.g. assert False in a view somewhere to bring up the Django debug page, I see that settings.PYTHON_BIN is /usr/bin rather than /opt/webapps/ff/bin . How do I get Apache/mod_wsgi to use my virtual environment's Python binary? I thought setting WSGIPythonHome was the way to do this, but it only

django+mod_wsgi on virtualenv not working

▼魔方 西西 提交于 2019-12-04 04:38:33
I've just finished setting up a django app on virtualenv, deployment went smoothly using a fabric script, but now the .wsgi is not working, I've tried every variation on the internet but no luck. My .wsgi file is: import os import sys import django.core.handlers.wsgi # put the Django project on sys.path root_path = os.path.abspath(os.path.dirname(__file__) + '../') sys.path.insert(0, os.path.join(root_path, 'kcdf')) sys.path.insert(0, root_path) os.environ['DJANGO_SETTINGS_MODULE'] = 'kcdf.settings' application = django.core.handlers.wsgi.WSGIHandler() I keep getting the same error: [Sun Apr

How can I rebuild my mod_wsgi to use python 2.7.3?

我与影子孤独终老i 提交于 2019-12-04 04:02:58
I'm using mod_wsgi to serve up a django website, but I've got an internal server error. Here's the apache log: [Fri May 31 10:11:25 2013] [error] python_init: Python version mismatch, expected '2.7.2+', found '2.7.3'. [Fri May 31 10:11:25 2013] [error] python_init: Python executable found '/usr/bin/python'. [Fri May 31 10:11:25 2013] [error] python_init: Python path being used '/usr/lib/python2.7/:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload'. [Fri May 31 10:11:25 2013] [warn] mod_wsgi: Compiled for Python/2.7.2+. [Fri May

Install mod_wsgi with Python 2.7 on Windows 64 bit

一笑奈何 提交于 2019-12-04 03:50:15
问题 I'm trying to deploy my Django website, which is written using Python 2.7, on a windows 64 bit machine (Windows Server 2008 R2). I installed the pre-compiled version of Apache (Apache 2.4.16 x64) from https://www.apachehaus.com/cgi-bin/download.plx (due to lack of option provided by Apache Lounge***), and have checked that Python 2.7 runs on 64 bit and compiles with VC9. I wasn't able to find a pre-built binary for mod_wsgi (for Windows 64 bit and compiled with VC9), so I downloaded the

Numpy ImportError when deploying Flask App using mod_wsgi/Apache2

两盒软妹~` 提交于 2019-12-04 03:47:39
问题 I'm trying to get a Flask app running on AWS EC2 (standard Ubuntu AMI) through an Apache2 Webserver. My app internally uses Numpy. I have tested the following: Without Numpy, the App runs through Apache2. With Numpy, it trips on the import numpy and throws a 500 Server error (See logs below). With Numpy, the app runs fine when invoked directly from the command line ( i.e. python app.py ). The numpy bits work as expected and I can query app endpoints externally. I also printed the system path

Configuration for Django, Apache and Nginx

。_饼干妹妹 提交于 2019-12-04 03:29:51
I've setup my Django application on Apache+mod_wsgi. To serve the static files I'm using Nginx, as suggested on Django's project website. http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/ Apache is running on port 8081 and nginx is on port 80. Now some people have suggested that my configuration is wrong and I should reverse the roles of Apache and Nginx. I'm not sure why that should be. And if indeed my configuration is wrong, why would django website suggest the wrong method? The django docs you linked to do not suggest you use apache as a reverse proxy. They simply suggest you