mod-wsgi

How to host Django website using cPanel?

旧时模样 提交于 2019-11-30 16:08:30
问题 I am new to the world of website hosting, especially in cPanel platform. I have a website which is developed using Python language, which makes use of Django also. I have hosted this website in cPanel. But it doesn't seems to be working. When I browse my website domain (www.def.com), now it displays site.wsgi (wsgi file) file as such. I could know that by default, CPanel doesn't support Django. Using SSH, I have installed Django. But I am not sure how to configure the same. Would be good if I

Python's working directory when running with WSGI and Apache

血红的双手。 提交于 2019-11-30 13:03:28
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 know what Python's working directory is when running in Apache/WSGI. Is there a way, maybe in the WSGI

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

那年仲夏 提交于 2019-11-30 11:32:28
问题 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? 回答1: 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

Installing mod_wsgi module for apache

巧了我就是萌 提交于 2019-11-30 10:38:02
WHEN I WAS INSTALLING WSGI MODULE FOR APACHE i Downloaded module from http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32-ap22py27-3.3.so Rename to mod_wsgi.so Copy to C:\Program Files\Apache Software Foundation\Apache2.2\modules edit 'httpd.conf' in C:\Program Files\Apache Software Foundation\Apache2.2\conf Add line 'LoadModule wsgi_module modules/mod_wsgi.so' in the module loading section of httpd.conf restart Apache Apache cannot be restarted The error in errorlog is: Syntax error on line 129 of C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot

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

早过忘川 提交于 2019-11-30 10:22:18
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/pyramidtest.dev/pyramid/load.wsgi </VirtualHost> Here's my load.wsgi : import site site.addsitedir('/opt

Django + mod_wsgi + Apache = 403 Forbidden

房东的猫 提交于 2019-11-30 09:51:27
问题 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 <

django print information on production server

青春壹個敷衍的年華 提交于 2019-11-30 09:43:32
I have some prints on my application for debug purpose. On the production server where these printed information goes? on apache log? I am using apache/mod_wsgi . Thanks. grantk use logging I like to log to file at times so I use the following in my settings.py import logging logging.basicConfig( level = logging.INFO, format = '%(asctime)s %(levelname)s %(message)s', filename = '/tmp/djangoLog.log',) and where I want logging: import logging logging.info("Making the alpha-ldap connection"); then in /tmp/djangoLog.log I would see the line "Making the alpha-ldap connection"e arie Check this

Django Webfaction 'Timeout when reading response headers from daemon process'

佐手、 提交于 2019-11-30 08:28:20
My Django app on my production server hosted on Webfaction was working fine until I just tried to restart it after pushing a change to the settings.py file. I ran apache2/bin/restart as usual. Then I tried to access my app on my browser, and I got a 504 Gateway timeout. I looked into the mod_wsgi logs and saw this: [Thu Nov 03 23:46:53.605625 2016] [wsgi:error] [pid 8027:tid 139641332168448] [client 127.0.0.1:34570] Timeout when reading response headers from daemon process 'myapp' : /home/<me>/webapps/<myapp>/<ProjectName>/<myapp>/wsgi.py What does this mean and how do I fix it? The only thing

How can I activate a pyvenv vitrualenv from within python? (activate_this.py was removed?)

人盡茶涼 提交于 2019-11-30 07:52:48
问题 I'm using Python 3.4, and having created a pyvenv, I'm looking to activate it from within a python process. With virtualenv, I used to use activate_this.py , but that appears to be gone in pyvenv. Is there now an easy way to effectively change the current interpreter to the virtualenv interpreter? I could probably mess around with the PATH (which is what activate_this.py did), but I'd like a simpler and stabler way. This is for use in a wsgi.py. 回答1: pyvenv and the venv module don't support

Django + apache & mod_wsgi: having to restart apache after changes

梦想的初衷 提交于 2019-11-30 06:29:57
问题 I configured my development server this way: Ubuntu, Apache, mod_wsgi, Python 2.6 I work on the server from another computer connected to it. Most of the times the changes don't affect the application unless I restart Apache. In some cases the changes take effect without restarting the webserver, but after let's say 3 or 4 page loads the application might behave like it used to behave previous to the changes. Until now I just reloaded everytime apache as I have the development server here