mod-wsgi

Django Apache MsSQL connection timeout

江枫思渺然 提交于 2019-12-11 16:56:05
问题 I am trying to Django with MS SQL Server on CentOS 7 using Apache mod_wsgi. I'm able to run the Django app using python manage.py runserver 0.0.0.0:8000 and navigate to my grappeli admin page. However, when I run using Apache, the home site loads up just fine but then I get OperationalError: ('HYT00', u'[HYT00] [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)') when I attempt to navigate to the admin page. It's strange that runserver would work

WSGI: ImportError: No module named hello (module in the same directory of the main .py file)

别来无恙 提交于 2019-12-11 16:28:13
问题 This is not a duplicate of Apache with virtualenv and mod_wsgi : ImportError : No module named 'django' since here I'm not using any virtualenv, and also I'm not trying to import another framework's module (such as django), but just a module in the same directory . Here is my setup: /var/www/test/app.py : import os, time, sys from bottle import route, run, template, default_app os.chdir(os.path.dirname(os.path.abspath(__file__))) import hello @route('/') def index(): return 'Hello world

Who set the Transfer-Encoding: chunked header?

淺唱寂寞╮ 提交于 2019-12-11 15:55:12
问题 I am using Django, mod_wsgi and Apache. When I make a response as StreamingHttpResponse and return, Transfer-Encoding: chunked header is set in the response. But when I add the Content-Length header to the resposne, Transfer-Encoding header is removed and only the Content-Length header exists. Who set and remove the Transfer-Encoding header? 回答1: Apache will set Transfer-Encoding: chunked when you don't specify a content length. You should not attempt to set that header yourself. The WSGI

“ Errno 13 Permission denied 'bnr_code.csv'”?

拥有回忆 提交于 2019-12-11 15:37:27
问题 I have deployed a Django project on server using apache2 and wsgi, Its showing an error which I probably know that why its coming. Error: IOError at / [Errno 13] Permission denied: 'bnr_code.csv' Request Method: GET Request URL: http://93.188.167.63:8080/pep_learn/ Django Version: 1.10.8 Exception Type: IOError Exception Value: [Errno 13] Permission denied: 'bnr_code.csv' Exception Location: /home/pep_web/binaryDs/views.py in <module>, line 6 Python Executable: /usr/bin/python Python Version:

How to do graceful application shutdown from mod_wsgi

偶尔善良 提交于 2019-12-11 15:22:53
问题 So I have a Flask application which I've been running on Flask's built-in server, and am ready to move it to production. This application manages several child processes. To this point, I've been handling graceful shutdown using signals. In particular, one shutdown mode I've used is to have sending a SIGHUP to the flask server cause the application to propagate that signal to its children (so they can gracefully shutdown), and then let the application process shutdown. In production, we're

LimitRequestBody doesn't respond with 413 for large file(25MB)

眉间皱痕 提交于 2019-12-11 14:55:39
问题 I put inside my virtual host file: LimitRequestBody 1024 to limit the upload size. When i upload files of 100kB up to 7MB i get a 413 Response, but when i try a 25MB file I get "The connection was reset. The connection to the server was reset while the page was loading" instead of 413 Does anyone know why this would happen? btw, i'm using mod_wsgi with apache 回答1: Most likely because the larger size meant HTTP client exceeded socket buffer sizes and so was blocked on writing and detected a

Error using mod_wsgi, Django and MongoEngine

╄→гoц情女王★ 提交于 2019-12-11 14:46:59
问题 I have set up a Django site with MongoEngine and I am trying to run it using Apache and mod_wsgi with a virtualenv. It runs fine in development, but under Apache (on ubuntu 14.04.2) I get the following errors in the apache log: mod_wsgi (pid=16130): Exception occurred processing WSGI script '/data/.../.../wsgi.py'. Traceback (most recent call last): File "/data/.../.../wsgi.py", line 22, in application return get_wsgi_application()(environ, start_response) File "/data/venv/lib/python3.4/site

django apache ImportError: No module named

此生再无相见时 提交于 2019-12-11 14:41:46
问题 So this is driving me crazy I have python3 and modwsgi and apache and a virtual host, that work great, as I have several other wsgi scripts that work fine on the server. I also have a django app that works great when I run the dev server. I have checked that "ldd mod_wsgi.so" is linked correctly against python3.5 Whenever I try to access my site, I get an error and the apache log states: ImportError: No module named 'protectionprofiles' protection profiles is mysite name the following is my

Python WSGI handler directly in Apache .htaccess, not in VirtualHost

不问归期 提交于 2019-12-11 14:29:05
问题 I know how to have a Python Bottle server: import os from bottle import route, template, default_app os.chdir(os.path.dirname(__file__)) @route('/hello') def hello(): return template('Hello world') application = default_app() run with WSGI, configured like this with Apache: <VirtualHost *:80> ServerName example.com <Directory /> AllowOverride All Require all granted </Directory> WSGIScriptAlias / /var/www/wsgi_test/app.wsgi </VirtualHost> Is it possible to do the WSGI configuration directly

Slow page loading on apache when using Flask

吃可爱长大的小学妹 提交于 2019-12-11 14:23:50
问题 The Issue I am using my laptop with Apache to act as a server for a local project involving tensorflow and python which uses an API written in Flask to service GET and POST requests coming from an app and maybe another user on the local network.The problem is that the initial page keeps loading when I specifically import tensorflow or the object detection folder within the research folder in the tensorflow github folder, and it never seems to finish doing so, effectively getting it stuck. I