mod-wsgi

Does Django or mod_wsgi modify sys.path when it's running?

守給你的承諾、 提交于 2019-12-06 11:51:23
I setup mod_wsgi, and checked it works fine. I also came up with simple django project, and also checked it works fine with the following command django-admin.py runserver --settings=mysite.settings However, when I run the following wsgi, import os import sys mysite = '/Users/smcho/Desktop/django/mysite' if mysite not in sys.path: sys.path.insert(0,'/Users/smcho/Desktop/django/mysite') django = '/Users/smcho/Desktop/django' if django not in sys.path: sys.path.insert(0,'/Users/smcho/Desktop/django') os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' import django.core.handlers.wsgi

Baffled: Django “could not import app.views” but can import app, in WSGI?

帅比萌擦擦* 提交于 2019-12-06 11:49:43
问题 I'm having an odd Django problem, running Django with mod_wsgi. Django is finding urls.py , and then saying: ViewDoesNotExist: Could not import app.views. Error was: No module named views Bizarrely, if I have import app in the import statements in urls.py I don't get an error (until it hits app.views as above), but if I have from app import views in my import statements, I get an error. My python path, as shown in the Django debug info, has both the containing folder and the app folder on it.

Running Tornado in apache

旧街凉风 提交于 2019-12-06 11:24:51
My end goal is to implement a WebSocket server using python. I'm accomplishing this by importing tornado in my python scripts. I've also installed mod_wsgi in apache, and their script outputs Hello World!, so WSGI seems to be working fine. Tornado is also working fine as far as I can tell. The issue comes when I use tornado's wsgi "Hello, world" script : import tornado.web import tornado.wsgi import wsgiref.simple_server class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, world") if __name__ == "__main__": application = tornado.wsgi.WSGIApplication([ (r"/",

Setting Python Path in Windows XAMPP using WSGI

时间秒杀一切 提交于 2019-12-06 11:17:09
问题 I'm setting up a development version of a live server on Webfaction, running Django apps in a virtual Apache server environment (running without any errors) on my local machine - XP, running XAMPP Lite with Python 2.6 - which I can commit changes from via Git. XAMPP is up and running OK with Python, and the server starts perfectly with WSGI module loaded. The problem is when I set my Python paths, they are set half in 'nix format (with /), and half in Windows (with backslashes). Here's the

Django/mod_wsgi and PHP as Virtual Hosts on same Apache Server using MAMP

微笑、不失礼 提交于 2019-12-06 08:51:22
问题 UPDATE: My original question is below, but the code I posted with the question has been edited to the final working solution. I am trying to run multiple sites on my MAMP development server. Some of the sites are wordpress sites that live in the htdocs in MAMP and some of the sites are django apps that live in a folder titled djangoprojects. I have been trying to implement the solutions from these stack questions: multiple django sites with apache & mod_wsgi How do I run Django and PHP

What's wrong with my Beaker, WSGI, Apache2, Python?

时光怂恿深爱的人放手 提交于 2019-12-06 08:45:50
Okay so my code is below. I'm working with apache2, mod_wsgi, beaker, python def application(environ, start_response): session = environ['beaker.session'] if not session.has_key('value'): session['value'] = 0 session.save() try: s = session['value'] except: s = "value not found" start_response('200 OK', [('Content-type', 'text/html')]) #response = "<br />".join(environ) beaker = "<br />".join(session) try: cookie = "".join(environ['HTTP_COOKIE']) except: cookie = "" return [cookie,'<br />', str(s), '<br />', beaker, '<br /> accessed:', str(session['_accessed_time']), '<br /> creation:', str

500 internal server error when importing a python module in wsgi

≯℡__Kan透↙ 提交于 2019-12-06 08:42:47
I've got a Python script that is executing functions asynchronously by using PEST wsgi library. However, when I try to import another module it simply results in a 500 error. The way I try to reference it is: from foo import * from foo import Foo where foo is a file .py in which I have the object that I want to reference to. Tried to monitor the calls through Chrome's Inspect Element Control but couldn't find a thing. Also tried to debug using Apache's error log, but nothing there. Any hints appreciated. Update: I've tried the following which resulted in the same 500 error: --make use of

No module named deploy when trying to start pyramid app with mod_wsgi

纵饮孤独 提交于 2019-12-06 05:50:18
问题 trying to use mod_wsgi for the first time for my pyramid app, but I keep getting an ImportError: No module named deploy when I try to access the site in my /etc/apache2/sites-available/domain.com <VirtualHost *:80> ServerName domain.com ServerAlias www.domain.com ServerAdmin admin@domain.com DocumentRoot /data/app ErrorLog /data/app/apache_error.log WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On WSGIDaemonProcess pyramid user=www-data group=www-data \ processes=2 threads=4 \ python

Apache mod_wsgi django enable multi-thread multi-process

会有一股神秘感。 提交于 2019-12-06 05:48:35
Question : how can i know if my apache server has already run in multi-process & multi-thread mode ? because when i load tested it, it giving me same result time with different threads count. i run test with 25 threads and 50 threads. Is there any adjustment that i have to do in the Django code for the multi-thread / multi-process work? Am I have to change the MPM config (/conf/extra/httpd-mpm.conf) ? below is my server detail and configuration : Server redhat enterprise 6.9 Apache server 2.4.33 Postgre 9.6.6 Python 3.6 Virtualbox RAM 8Gb, 2 Core (4 vCpu). my httpd.conf : Listen 8000

apache prefork/mod_wsgi spawned process count seemingly past configuration [closed]

蹲街弑〆低调 提交于 2019-12-06 04:46:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . in a production environment running nginx reversing back to apache mpm-prefork/mod_wsgi, im seeing 90 apache child processes, when i would expect that 40 would be the maximum, as configured below. the configuration/setup is nothing exciting: nginx is reverse proxying to apache via proxy_pass , and serving static