mod-wsgi

Apache Django Mod_Wsgi - auto reload

无人久伴 提交于 2019-11-30 05:29:01
I am trying to auto reload my django app which uses apache + mod_wsgi on my local windows machine. I'd like to know where do I add this code that's referenced in the following article: http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode def _restart(path): _queue.put(True) prefix = 'monitor (pid=%d):' % os.getpid() print >> sys.stderr, '%s Change detected to \'%s\'.' % (prefix, path) print >> sys.stderr, '%s Triggering Apache restart.' % prefix import ctypes ctypes.windll.libhttpd.ap_signal_parent(1) Read: http://blog.dscpl.com.au/2008/12/using-modwsgi-when-developing-django.html It

static file with mod_wsgi in django

江枫思渺然 提交于 2019-11-30 05:23:48
I've searched a lot but I still have a problem with the static files (css, image,...) with my django website. I'm using mod_wsgi with apache on archlinux 64bits I've added it in my http.conf : LoadModule wsgi_module modules/mod_wsgi.so <VirtualHost *:80> WSGIDaemonProcess mart.localhost user=mart group=users processes=2 threads=25 WSGIProcessGroup mart.localhost LogLevel debug Alias /media /home/mart/programmation/python/django/martfiles/media/ <Directory /home/mart/programmation/python/django/martfiles/> Order allow,deny Allow from all </Directory> WSGIScriptAlias / /srv/http/wsgi-scripts

Python - why can I import modules without __init__.py at all?

ε祈祈猫儿з 提交于 2019-11-30 04:46:33
I'm new to Python and I still can't get my head around why we need a __init__.py file to import modules. I have gone through other questions and answers, such as this . What confuses me is that I can import my modules without __init__py , so why do I need it at all ? My example, index.py modules/ hello/ hello.py HelloWorld.py index.py, import os import sys root = os.path.dirname(__file__) sys.path.append(root + "/modules/hello") # IMPORTS MODULES from hello import hello from HelloWorld import HelloWorld def application(environ, start_response): results = [] results.append(hello()) helloWorld =

What is the purpose of the sub-interpreter API in CPython?

会有一股神秘感。 提交于 2019-11-30 00:22:32
I'm unclear on why the sub-interpreter API exists and why it's used in modules such as the mod_wsgi apache module. Is it mainly used for creating a security sandbox for different applications running within the same process, or is it a way to allow concurrency with multiple threads? Maybe both? Are there other purposes? I imagine the purpose is to create separate python execution environments. For instance, mod_wsgi (Apache Python module) hosts a single python interpreter and then hosts multiple applications within sub-interpreters (in the default configuration). Some key points from the

Deploying Django (fastcgi, apache mod_wsgi, uwsgi, gunicorn)

流过昼夜 提交于 2019-11-29 23:11:15
Can someone explain the difference between apache mod_wsgi in daemon mode and django fastcgi in threaded mode. They both use threads for concurrency I think. Supposing that I'm using nginx as front end to apache mod_wsgi. UPDATE: I'm comparing django built in fastcgi(./manage.py method=threaded maxchildren=15) and mod_wsgi in 'daemon' mode(WSGIDaemonProcess example threads=15). They both use threads and acquire GIL, am I right? UPDATAE 2: So if they both are similar, is there any benefits of apache mod_wsgi against fastcgi. I see such pros of fastcgi: we don't need apache we consume less RAM I

Python & XAMPP on Windows: how to?

孤街醉人 提交于 2019-11-29 21:08:10
I have installed on my Win7x64 Xampp and Python 2.7. Now I'm trying to get the "power" of Python language... how can I do it? I've tried with mod_python and mod_wsgi but the first one does not exist for my version of Python, and when I try to start Apache after installing wsgi it gives me an error < Directory "\x93C:/wsgi_app\x94"> path is invalid I added a space between < and 'directory' to make the string visible here. So... Anyone knows if there is a little tutorial to install these features? Or is anyone is kind enough to explain me step by step what shall I do? Thanks and sorry if i'm not

Python's working directory when running with WSGI and Apache

时光怂恿深爱的人放手 提交于 2019-11-29 18:36:10
问题 I have a web application that, among other things, will query a database and create an Excel spreadsheet with the data. I need to save the spreadsheet to the server's disk before sending the file to the client machine. I'm using the Flask framework and openpyxl to generate the spreadsheet. Everything works fine when running on Flask's dev server, but the real server is Apache2 with WSGI. When I run it there, a "Permission Denied" error is raised when it tries to save the spreadsheet. I don't

Django + mod_wsgi + Apache = 403 Forbidden

泪湿孤枕 提交于 2019-11-29 18:02:00
I'm getting this error on Debian all the time. No matter where I put my code. I've already gone through all other questions on here and have't found anything useful in my case. Here is the default site config: WSGIScriptAlias / /home/user/Code/mysite/core/ WSGIPythonPath /home/user/Code/mysite/core/ <VirtualHost *:80> ServerAdmin user@site.com ServerName http://example.org Options -Indexes DocumentRoot /var/www/ <Directory /> # Options FollowSymLinks AllowOverride None Allow from all </Directory> <Directory /home/user/Code/site/core/> <Files wsgi.py> Require all granted </Files> </Directory>

Issue with imports when using WSGI in EC2 Instance to Host Flask App

喜欢而已 提交于 2019-11-29 16:20:32
I am trying to run a very simple Flask app off an EC2 instance using mod_wsgi. My apache error log keeps showing "ImportError: No module named pandas, referer: http://xxxxx " Despite the fact that I have pandas installed. For reference, pip freeze yields me click==6.7 Flask==0.12 itsdangerous==0.24 Jinja2==2.9.5 MarkupSafe==0.23 numpy==1.12.0 pandas==0.19.2 python-dateutil==2.6.0 pytz==2016.10 scikit-learn==0.18.1 scipy==0.18.1 six==1.10.0 sklearn==0.0 virtualenv==15.1.0 Werkzeug==0.11.15 Previously, I tried using virtualenv (pip freeze of my venv is very similar to what I posed above) and

Trying to get Pyramid running under Apache + mod_wsgi but it's failing

笑着哭i 提交于 2019-11-29 16:00:47
问题 I've got Apache2 running with mod_wsgi installed. I've confirmed that mod_wsgi actually works by following this. The problem comes when I try to get Pyramid running. I get an Internal Server Error and my Apache error log contains the exception: AssertionError: The EvalException middleware is not usable in a multi-process environment Here's my VHost: <VirtualHost *:80> ServerName pyramidtest.dev DocumentRoot /srv/pyramidtest.dev/www/ AssignUserID pyramidtest nogroup WSGIScriptAlias / /srv