mod-wsgi

using scipy in django with apache and mod_wsgi

余生长醉 提交于 2019-12-10 03:57:59
问题 I have defined a django view that uses scipy.optimize.curve_fit . This works without problems using the django development server, but when I deploy the Django application with Apache and mod_wsgi the view function gets stuck importing curve_fit: from scipy.optimize import curve_fit When this line is removed the rest of the app works well on the Apache server. Why does this line not work with Apache and mod_wsgi? 回答1: In your WSGI file you will have something that looks like this:

How can I rebuild my mod_wsgi to use python 2.7.3?

江枫思渺然 提交于 2019-12-09 17:17:55
问题 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

How to Disable Django / mod_WSGI Page Caching

半世苍凉 提交于 2019-12-09 05:30:42
问题 I have Django running in Apache via mod_wsgi. I believe Django is caching my pages server-side, which is causing some of the functionality to not work correctly. I have a countdown timer that works by getting the current server time, determining the remaining countdown time, and outputting that number to the HTML template. A javascript countdown timer then takes over and runs the countdown for the user. The problem arises when the user refreshes the page, or navigates to a different page with

How does one deploy a django application on OS X Server?

折月煮酒 提交于 2019-12-09 04:51:40
问题 How would one deploy a Django application on OS X Server 2.0 without using homebrew or a different flavor of python than the one shipped with OS X 10.8.1? I'm using the cocoa bindings in a Django application and had trouble getting it to work with homebrew on my desktop machine (running OS X 10.8.1); hence the request to deploy the application on the system installed version of Python. I have the following OS X Server environment, with the following already installed: OS X 10.8.1 OS X Server

Webserver to serve Python script

大兔子大兔子 提交于 2019-12-09 03:21:30
I have a Python script that I'd like to be run from the browser, it seem mod_wsgi is the way to go but the method feels too heavy-weight and would require modifications to the script for the output. I guess I'd like a php approach ideally. The scripts doesn't take any input and will only be accessible on an internal network. I'm running apache on Linux with mod_wsgi already set up, what are the options here? I would go the micro-framework approach just in case your requirements change - and you never know, it may end up being an app rather just a basic dump... Perhaps the simplest (and old

running subprocess.Popen under apache+mod_wsgi is always returning an error with a returncode of -6

ぃ、小莉子 提交于 2019-12-09 03:08:58
问题 I'm hoping someone's seen this - I'm running django-compressor, taking advantage of the lessc setup to render/compress the less into CSS on the file. It works perfectly when invoked from the development server, but when run underneath apache+mod_wsgi it is consistently returning an error. To debug this, I have run the exact command that the filter is invoking as the www-data user (which is defined as the wsgi user in the WSGIDaemonProcess directive) and verified that it works correctly,

Script timed out before returning headers: wsgi.py on elastic beanstalk

﹥>﹥吖頭↗ 提交于 2019-12-08 23:08:31
问题 I'm trying to deploy a Django application to Elastic Beanstalk. When I visit the page it never loads. The logs say: Script timed out before returning headers: wsgi.py I can ssh into the server and run manage.py runserver and then curl 127.0.0.1:8000 from another terminal, which will return the page successfully. So I'm assuming it must be an issue with the Apache configuration that is set up as a part of Elastic Beanstalk. Here is more of the logs: [pid 15880] AH01232: suEXEC mechanism

How to return in-memory PIL image from WSGI application

旧城冷巷雨未停 提交于 2019-12-08 20:24:31
问题 I've read a lot of posts like this one that detail how to dynamically return an image using WSGI. However, all the examples I've seen are opening an image in binary format, reading it and then returning that data (this works for me fine). I'm stuck trying to achieve the same thing using an in-memory PIL image object. I don't want to save the image to a file since I already have an image in-memory. Given this: fd = open( aPath2Png, 'rb') base = Image.open(fd) ... lots more image processing on

Ubuntu , Apache2 , Django ) Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings'

醉酒当歌 提交于 2019-12-08 16:55:29
问题 I'm trying to set up my django(1.8) application with AWS EC2 having Ubuntu 14.04 , Apache2 , python 3.4. When I run 'sudo service apache2 start' , the page keeps re-loading and the same error message is stacking at '/var/log/apache2/error.log'. The error message is [Fri Aug 26 2016] [mpm_event:notice] [pid n:tid m] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/4.5.5 Python/3.4.3 configured -- resuming normal operations [Fri Aug 26 2016] [core:notice] [pid n:tid m] AH00094: Command line: '/usr/sbin

Django with mod_wsgi on apache - 500 error: Authtype not set?

ぃ、小莉子 提交于 2019-12-08 16:45:39
问题 Trying to deploy my first django site on Dreamhost...I had this working and then I'm not sure what I did to make it stop working. This is the error message: [crit] [client 74.72.99.26] configuration error: couldn't perform authentication. AuthType not set!: /internal_error.html <VirtualHost :80> WSGIScriptAlias / /home/username/mysite.com/dir/project/wsgi.py <Directory /home/username/mysite.com/dir/project> <Files wsgi.py> Order deny,allow Require all granted </Files> </Directory> <