mod-wsgi

How to reload new update in Django project with Apache, mod_wsgi?

天大地大妈咪最大 提交于 2019-11-28 03:20:57
问题 I am making a project using the Django framework. I have hosted a test server with Apache+mod_wsgi. When I change some lines of code, I upload the file and test it in a browser. But the new changes are not shown unless I reload/restart ( /etc/init.d/apache2 reload ). Is there any other way to reload/refresh new changes besides reloading Apache? 回答1: Yes, touch your wsgi configuration file. For me, my server restart script is as simple as touch /srv/grove_project/conf/apache/django.wsgi .

In production, Apache + mod_wsgi or Nginx + mod_wsgi?

走远了吗. 提交于 2019-11-28 03:05:46
What to use for a medium to large python WSGI application, Apache + mod_wsgi or Nginx + mod_wsgi? Which combination will need more memory and CPU time? Which one is faster? Which is known for being more stable than the other? I am also thinking to use CherryPy's WSGI server but I hear it's not very suitable for a very high-load application, what do you know about this? Note : I didn't use any Python Web Framework, I just wrote the whole thing from scratch. Note' : Other suggestions are also welcome. For nginx/mod_wsgi, ensure you read: http://blog.dscpl.com.au/2009/05/blocking-requests-and

How to install mod_wsgi for apache 2.4 and python 3.4 on windows?

╄→尐↘猪︶ㄣ 提交于 2019-11-27 23:20:48
I had apache 2.4 already installed with xampp.I tried adding mod_wsgi using the steps mentioned here But when I add the line LoadModule wsgi_module modules/mod_wsgi-py34-vc10.so Apache does not start. Graham Dumpleton It is better to build mod_wsgi yourself from code rather than use an arbitrary binary off the net. The steps are as follows. Ensure you have a decent Apache installation which includes header files, e.g. Apache 2.4.37 Win64 from Apache Lounge . Preferably installed at location of C:/Apache24 . Ensure your Python installation is set up so that you can pip install modules. This

mod_wsgi: ImportError: No module named 'encodings'

限于喜欢 提交于 2019-11-27 22:54:22
I'm using Apache 2.2.15 on CentOS 6.5. I'm trying to set up a Django app using mod_wsgi. I'm using a virtual environment, and mod_wsgi was configured with --with-python=/path/to/virtualenv/bin/python3.4 . I've added this to my httpd.conf : WSGIPythonPath /srv/myproject:/path/to/virtualenv/lib/python3.4/site-packages WSGIPythonHome /path/to/virtualenv <VirtualHost *:80> WSGIScriptAlias / /srv/myproject/myproject/wsgi.py ... </VirtualHost> In wsgi.py , I added sys.path.insert(1, "/path/to/virtualenv/lib/python3.4/site-packages") The problem is that when I try to open the app in my browser, it

mod_wsgi isn't honoring WSGIPythonHome

徘徊边缘 提交于 2019-11-27 22:53:40
I'm trying to get WSGI to run with a virtualenv setup. I have the virtualenv all working right: (virtualenv)dev:/var/www/app$ which python /var/www/virtualenv/bin/python (virtualenv)dev:/var/www/app$ python Python 2.6.1 (r261:67515, Dec 5 2008, 22:09:34) [GCC 4.1.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import importlib >>> And in my httpd.conf, I have the following, as described here : WSGIPythonHome /var/www/virtualenv WSGIPythonPath /var/www/virtualenv/lib/python2.6/site-packages But when I try to load the app via apache, i get the following

mod_wsgi and multiple installations of python

和自甴很熟 提交于 2019-11-27 22:50:02
This is kind of a continuation of this question, but it has deviated so I started a new one. I'd like to use Python 2.5 instead of OS X's default 2.6. I've set this up for my terminal and whatnot, but whenever apache runs it gives me the following error output: [Thu Jun 23 00:01:42 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache] [Thu Jun 23 00:01:42 2011] [warn] mod_wsgi: Compiled for Python/2.5.4. [Thu Jun 23 00:01:42 2011] [warn] mod_wsgi: Runtime using Python/2.6.1. [Thu Jun 23 00:01:42 2011] [notice] Digest: generating secret for digest authentication ... [Thu

403 Forbidden error with Django and mod_wsgi

半城伤御伤魂 提交于 2019-11-27 21:04:15
I created Django project in home directory so it is in home directory. Setup Django Verison : 1.5.1 Python Version : 2.7.5 mod_wsgi Version: 3.4 Home Directory : /home/aettool Contents of /home/aettool/aet/apache/django.wsgi import os import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'aet.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() Contect of httpd.conf WSGIScriptAlias / /home/aettool/aet/apache/django.wsgi <Directory /home/aettool/aet/apache> Order deny,allow Allow from all </Directory> Error in error_log [Sun Jul 21 02:01:30.923364 2013]

Configure SSL Certificate on Apache for Django Application (mod_wsgi)

自闭症网瘾萝莉.ら 提交于 2019-11-27 20:48:08
问题 I've purchased a SSL certificate from namecheap.com and placed the required files on my Ubuntu server (key & crt's). I'm using mod_wsgi to serve my Django application with Apache. I'm having issues installing the SSL certificate. Current Configuration (/etc/apache2/sites-available/000-default.conf) <VirtualHost *:80> ServerAdmin admin@example.com #DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined #Django Application Alias /static

Getting Flask to use Python3 (Apache/mod_wsgi)

≯℡__Kan透↙ 提交于 2019-11-27 19:53:19
I've got a basic "hello world" Flask app running. I'm on Ubuntu 14.04, using Apache 2.4. I've installed mod_wsgi. I've created a ~/web/piFlask/venv/ to hold a virtualenv-created Python2 with flask installed. However, I wish to have my flaskapp import a Python3.x module I have written. What do I need to do to make this happen? I tried creating a ~/web/piFlask/venv3/ and modifying ~/web/piFlask/piFlask.wsgi : import os, sys PROJECT_DIR = '/home/pi/web/piFlask' activate_this = os.path.join(PROJECT_DIR, 'venv3/bin', 'activate_this.py') execfile(activate_this, dict(__file__=activate_this)) sys.path

Django long running asynchronous tasks with threads/processing

杀马特。学长 韩版系。学妹 提交于 2019-11-27 19:20:30
Disclaimer : I do know that there are several similar questions on SO. I think I've read most if not all of them, but did not find an answer to my real question (see later). I also do know that using celery or other asynchronous queue systems is the best way to achieve long running tasks - or at least use a cron-managed script. There's also mod_wsgi doc about processes and threads but I'm not sure I got it all correct. The question is: what are the exact risks/issues involved with using the solutions listed down there? Is any of them viable for long running tasks (ok, even though celery is