uwsgi

Internal Server Error with Django and uWSGI

蹲街弑〆低调 提交于 2019-12-20 09:15:17
问题 I am trying to follow the steps in this guide: http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html Before I even get to the nginx part I am trying to make sure that uWSGI works correctly my folder structure is srv/www/domain/projectdatabank/ the project databank folder contains my manage.py file my wsgi.py file looks like this: import os import sys from django.core.wsgi import get_wsgi_application application = get_wsgi_application() do you need to see my settings.py?

Nginx timeouts when uWSGI takes long to process request

两盒软妹~` 提交于 2019-12-20 09:09:37
问题 I have Nginx + uWSGI for Python Django app. I have the following in my nginx.conf : location / { include uwsgi_params; uwsgi_pass 127.0.0.1:9001; uwsgi_read_timeout 1800; uwsgi_send_timeout 300; client_header_timeout 300; proxy_read_timeout 300; index index.html index.htm; } but for long running requests on uWSGI which takes about 1 minute to complete I get a timeout error in Nginx error log as below: 2013/04/22 12:35:56 [error] 2709#0: *1 upstream timed out (110: Connection timed out) while

Django memory leak: possible causes?

百般思念 提交于 2019-12-20 09:09:03
问题 I've a Django application that every so often is getting into memory leak. I am not using large data that could overload the memory, in fact the application 'eats' memory incrementally (in a week the memory goes from ~ 70 MB to 4GB), that is why I suspect the garbage collector is missing something, I am not sure though. Also, it seems as this increment is not dependant of the number of requests. Obvious things like DEBUG=True , leaving open files, etc... no apply here. I'm using uWSGI 2.0.3 (

django nginx uwsgi ubuntu server deploying fail

安稳与你 提交于 2019-12-20 07:07:05
问题 I am trying to set up my little Django project (Django 1.8) with nginx and uwsgi, but it just fails when running: uwsgi --socket :8001 --wsgi-file test.py which follows documentation. I do not know why? I just step by step but when I run above command and check my serverip:8000 it shows nothing. However when I run: uwsgi --http :8000 --wsgi-file test.py it works and shows Hello World web site. Running command: uwsgi --http :8000 --module myproject.wsgi it works and shows myproject web site.

Nginx/Django caching site even when caching explicitly disabled

心已入冬 提交于 2019-12-20 05:53:15
问题 I am working on a development site built in Django in a virtualenv on an Nginx server using uwsgi . In the uwsgi config file I have: py-autoreload = 1 Most of the time caching is enabled in settings.py : CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', 'LOCATION': '/var/www/example.com/cache', } } but when I am working on the site, I replace the BACKEND and LOCATION lines above with: CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy

flask program giving module not found

一笑奈何 提交于 2019-12-20 05:45:39
问题 Im building a python web application with flask and uWSGI following this lovely guide https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-centos-7 and it worked marvels. I wan to say I have installed every single module and dependency in the project file. Im trying now to build on the working script and I now my init .py file looks like this: from flask import Flask import pylab as pl import numpy as np import pandas as pd from sklearn

Django error when send emails thrue google apps

谁说胖子不能爱 提交于 2019-12-20 05:23:20
问题 I have a Django application that connect to google apps to send emails. However, few days ago I started to get "Connection reset by peer" error. Sometimes it works, sometimes not... I couldn't find any reason to justify when not works... I am using nginx and uwsgi. Can anybody help me to understand whats going on and how to resolve it? This same application is running more than 1 month and just now started to give this error. Here is the log: Traceback (most recent call last): File "/usr

MongoClient opened before fork. Create MongoClient only Flask

拥有回忆 提交于 2019-12-20 05:12:59
问题 I am running Flask with uwsgi threaded mode with processes 4 and using pymongo also flask_mongoengine and uwsgi says "MongoClient opened before fork. Create MongoClient only " I tried connect with connect=False but the result is same lazy-apps = true problem is fixed but it seems that uwsgi needs more time to load what can be done for best performance ? 回答1: app.config['MONGODB_SETTINGS'] = {'DB': 'somedb', "USERNAME": "dbadmin", "PASSWORD":"somepass",'connect': False} And client =

MongoClient opened before fork. Create MongoClient only Flask

半世苍凉 提交于 2019-12-20 05:12:45
问题 I am running Flask with uwsgi threaded mode with processes 4 and using pymongo also flask_mongoengine and uwsgi says "MongoClient opened before fork. Create MongoClient only " I tried connect with connect=False but the result is same lazy-apps = true problem is fixed but it seems that uwsgi needs more time to load what can be done for best performance ? 回答1: app.config['MONGODB_SETTINGS'] = {'DB': 'somedb', "USERNAME": "dbadmin", "PASSWORD":"somepass",'connect': False} And client =

Flask-WTF CSRF validation fails when app moved to docker production environment

独自空忆成欢 提交于 2019-12-20 03:52:47
问题 I just set up my production environment for the Flask app I've been developing. This stack is: Windows Server 2012 R2 Hyper-V VM - Running Ubuntu 14.04 Docker 1.5 - Running Containers: mysql 5.6 nginx 1.6.3 uwsgi 2.0.10 So basically I have a static IP set up in Ubuntu, port 80 getting forwarded to the nginx container, a data volume shared between the nginx and uwsgi containers for a socket file, and finally a link between the mysql container and the uwsgi container for database communication.