mod-wsgi

Flask auto-reload and long-running thread

久未见 提交于 2019-12-10 16:13:40
问题 I'm implementing a long-running thread within a Flask application. In debug mode, with the reloader activated, the long-running thread is not killed upon reload. Instead, because the code that creates and starts the thread is run after reloading, each cycle creates an additional thread. How can I prevent this, other than disabling the reloader? Will the same happen when running under mod_wsgi, with its auto-reload feature? Update : the long-running thread was actually killed by Werkzeug upon

BeautifulSoup inside Django view makes WSGI timeout

三世轮回 提交于 2019-12-10 15:59:14
问题 For a strange reason when I instantiate a BeautifulSoup object inside Django's view, the WSGI timeout. Any help is appreciated as I am banging my head against the wall for hours and cannot find the root of this problem. The view: def index(request): soup = BeautifulSoup('<b>Bold</b>') # Removing this line solve the proble return HttpResponse('Hello') The error message in Apache log: [wsgi:error] [pid 4014] [client 127.0.0.1:50892] Timeout when reading response headers from daemon process

Trying to set up flask with mod_wsgi

那年仲夏 提交于 2019-12-10 14:50:44
问题 I'm trying to set up flask with mod_wsgi but I keep getting following error (13)Permission denied: access to / denied (filesystem path '/home/ec2-user/myapp') because search permissions are missing on a component of the path test is a valid route in the flask app. This is my myapp.conf file in the /etc/httpd/conf.d folder WSGIRestrictStdout Off <VirtualHost *> ServerName somewhere.compute-1.amazonaws.com WSGIDaemonProcess flaskapp user=ec2-user group=ec2-user threads=5 WSGIScriptAlias / /home

Error loading pyodbc module while running on Apache

五迷三道 提交于 2019-12-10 14:39:57
问题 Previously I have been trying to host multiple DEMO django projects using a virtual host on apache, and have been successfully with the help of stackoverflow. Now I have been trying to host my new project using the same technique like the previous ones. My new project is connected to the sql_server database. My project runs perfectly when using djangos in-built server. When i try running using apache i get an 500 Internal Server Error and my apache error logs shows - Exception occurred

Multiple Django applications using virtualenv on Apache 2 on Ubuntu 11

我的未来我决定 提交于 2019-12-10 14:34:57
问题 I've successfully setup one Django application using virtualenv on Ubuntu and Apache 2, using the WSGIPythonHome directive pointing to my virtualenv location. Now I am in need to create a separate Django application, that is going to run on Apache on a different port on the same Ubuntu server. I am wondering if there's a way to have Apache run multiple WSGIPythonHome instances? Currently with WSGIPythonHome being set to one virtualenv root, there's a problem with imports on the second Django

mod_wsgi is compiled in one version and running in a different version even after following the given steps

白昼怎懂夜的黑 提交于 2019-12-10 14:34:04
问题 I am getting an error when I run the apache server through my client after going through the log I understood that the mod_wsgi uses python 2.6 during compiling and uses python 2.7 for running. After some research in the Internet I followed the below steps: You have to recompile mod-python and/or mod-wsgi. Remove mods apt-get remove libapache2-mod-python libapache2-mod-wsgi Get dependencies apt-get build-dep libapache2-mod-python libapache2-mod-wsgi Build mod-python mkdir /tmp/python cd /tmp

How to debug basic issues configuring django to be served with apache and mod-wsgi?

不打扰是莪最后的温柔 提交于 2019-12-10 13:33:11
问题 It is common that people have trouble setting up django to be serves by apache and mod-wsgi. The common symptom is "Import error" ... for some reason (generally slightly different in each case) settings.py or similar doesn't import (see "Related" in the right column on this page for numerous examples!). I have read through the other questions on this topic, and none appear to have a solution that works for my situation (one was a basic misconfig by the poster identified by an answerer - I don

Deploying Django on Apache and WSGI

半城伤御伤魂 提交于 2019-12-10 10:13:13
问题 Although I have found a bunch of tech support to deploy Django over Apache using WSGI but infact they all have confused me unfortunately, and I couldn't get the Django running. I hope this to be real easy job but being a new comer I am facing difficulties. I have two Django projects namely website1 and website2 inside my /home/zia/Documents/Codes/Django/website1 and ..../website2 dir, respectively. The folder containing settings.py file is root/ inside the /website1 and /website2 dir. Apache,

ProxyPass and ProxyPassReverse for Django app

心已入冬 提交于 2019-12-10 09:45:48
问题 I have a follow up question from my original Django serving question which was how to develop Django apps and serve them from the same server as my main PHP-based site (all part of a larger migration of my website from a static and PHP driven one to a series of Django apps). I couldn't quite use the name server solution I was provided with, and instead just deployed my Django applications on a different port (8000) using mod_wsgi. Now, however, I need to actually integrate the Django

Django ALLOWED_HOSTS to accept local IPs through Apache

纵然是瞬间 提交于 2019-12-10 04:13:37
问题 I'm serving a Django app with Apache. In Django's settings.py I have DEBUG = False , therefore I had to allow some hosts, like: ALLOWED_HOSTS = ['.dyndns.org', 'localhost'] . This works fine, however I would like to have the server accessible on the local network via its internal IP address as well, like: 192.168.0.x , or 127.0.0.1 , etc. How could I define 192.* or 127.* in ALLOWED_HOSTS , if I'd like to avoid opening up the access entirely by ALLOWED_HOSTS = ['*'] ? 回答1: Following the