FAQ Database Discussion Community


NGINX with uwsgi and django connection refused

django,nginx,wsgi,uwsgi
Welcome stackoverflowers. I`ve been fighting with setting up nginx with uwsgi with django app... There has to be a small mistake somewhere but I cant find it. Here is my file from pastebin, containing files directly related to my issue and also a console log. I would be very greateful...

How to create one uwsgi log file per day?

logging,uwsgi,log-rotation
I use uwsgi with the parameter --daemonize /logs/uwsgi.log This file is however becoming large and I would like to split it into smaller pieces. One per day would be preferable. I have done that for nginx where it was easy to specify the log file name using date variables. Is...

uwsgi cannot work on a cloud server

python,uwsgi
I have install uwsgi on a cloud server, with test I write a python script to test it, which is as follow: # test.py def application(env, start_response): start_response('200 OK', [('Content-Type','text/html')]) return [b"Hello World"] # python3 Then I run it as follows: uwsgi --http :8001 --wsgi-file test.py and I get some...

uWSGI and Django segmentation fault

django,segmentation-fault,zip,uwsgi
I've been dealing with a strange error that is intermittent and hard to trace. One of the pages on my django-powered site allows users to download music they have purchased. The problem: Some users are reporting a 502 error upon downloading. A further investigation of the problem shows that there...

Uwsgi running in foreground though it shouldn't

uwsgi
This is my UWSGI config: [uwsgi] uid = $APPUSER gid = $APPGROUP socket = $SOCK processes = 4 chdir = $APPDIR virtualenv = $APPVENV pythonpath = $APPVENV/bin/python module = run callable = app emperor-pidfile = $APPDIR/emperor.pid daemonize = /var/log/emperor.log When emperor runs it does create the emperor log file but...

Nginx/Uwsgi log showing duplicate requests

python,flask,uwsgi
I'm running a flask application using nginx and uwsgi and I noticed when I tail the logs for uwsgi it looks like its just constantly polling my app when I'm doing nothing. It also seems like it's cycling through the cores on my machine with each request so I see...

nginx uwsgi websockets 502 Bad Gateway upstream prematurely closed connection while reading response header from upstream

django,nginx,websocket,redis,uwsgi
I've been banging my head on this issue for days now and have finally reached a brick wall. I've been trying to get my stack to run: http://django-websocket-redis.readthedocs.org/en/latest/running.html#django-with-websockets-for-redis-behind-nginx-using-uwsgi I've been looking at some other SO articles like this one: nginx - uWSGI HTTP + websocket config They seem to have...

wsgi nginx error: permission denied while connecting to upstream

sockets,ubuntu,nginx,wsgi,uwsgi
There seem to be many questions on StackOverflow about this but unfortunately nothing has worked for me. I'm getting a 502 bad gateway on nginx, and the following on the logs: connect() to ...myproject.sock failed (13: Permission denied) while connecting to upstream I'm running wsgi and nginx on ubuntu, and...

Deployment of Python API

django,api,nginx,deployment,uwsgi
I'm trying to understand the simplest way to deploy a Django application in production. Many recommend nginx or Apache along with uwsgi or gunicorn. I think that is more than my situation requires, and I would like know if my thinking is correct. This application is nothing more than an...

Populate cache before app is fully available

uwsgi
Is there a uWSGI option/hook/subsystem to fill a cache before an app is ready to process requests? The static load-file-in-cache is not an option. I need to call a function or program which populates a uWSGI cache.

Cannot use manage.py because of uwsgi import in settings.py

python,django,uwsgi,manage.py
I use django 1.8 + uwsgi + nginx on my production server. uwsgi is in emperor mode. I import the uwsgi python module in myapp/settings.py to enable autoreload upon code modification. As I understood, this python module is available for import only when the python thread is spawn by a...

Django model class is None in manager

python,django,django-models,uwsgi
I'm getting a very weird error on my server running a django app. The error is not reproducable on my local development server. I have this model and it's manager: class CardManager(models.Manager): def get_by_identifier(self, card_identifier): ... for possible_suit in Card.SUITS: ... class Card(models.Model): objects = CardManager() SUITS = ((1, 'Clubs'),...

ImportError: No module when running uwsgi

python,uwsgi
I can run the server in flask development mode correctly. I think I missing some params to run the uwsgi server so that got the error message. run uwsgi command uwsgi --socket 127.0.0.1:4245 --module web --callable app --processes 4 --threads 2 Error log *** Operational MODE: preforking+threaded *** Traceback (most...

Does UWSGI influence LDAPS Requests from an underlying Django app?

python,django,active-directory,uwsgi,python-ldap
I have plugged in this class as an authentication backend in django class ActiveDirectoryBackend(object): logger = Messenger.infrastructure @classmethod def authenticate(cls, username=None, password=None): try: bind_dn = "%[email protected]%s" % (username, settings.AD_DNS_NAME) try: cls.logger.debug('Initializing: %s' % settings.AD_LDAP_URL) l = ldap.initialize(settings.AD_LDAP_URL) l.protocol_version = ldap.VERSION3 l.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER) cls.logger.debug('Binding user %s' % bind_dn) l.simple_bind_s(bind_dn,...

Django App Improperly Configured - The app module has multiple filesystem locations

django,uwsgi
I think I've really screwed something up. On my django app (the production one) I pushed a major update and am get an "Internal Server Error" whenever I try to go to my domain. I am getting an error in my uwsgi logs: *** Starting uWSGI 2.0.8 (64bit) on [Thu...

Django, uwsgi and nginx - Internal Server Error

python,django,nginx,uwsgi
I am quite new to python and am working on my first django project. I followed this tutorial. I managed to configure all the things but django app itself. It works if I run django server alone, however it does not work when started by uwsgi. This is my uwsgi...

Starting uWSGI service fails silently

django,ubuntu,uwsgi,upstart
I'm having a problem which is driving me nuts. I'm trying to create an Ubuntu 15.04 Upstart job, which would start uWSGI server (uWSGI version 2.0.7-debian) running a Django application. I've configured the service as a follows and try to start the job by issuing command $ sudo service uwsgi...

uwsgi socket file not created

django,nginx,uwsgi
I am having trouble setting up server using uwsgi and nginx. This is my uwsgi ini file (and symlink in vassals): # ebook_uwsgi.ini file [uwsgi] #emperor = /etc/uwsgi/vassals #plugins = python #if uwsgi installed with pip, dont have to use this line # Django-related settings # the base directory (full...

python virtualenv(wrapper) + uwsgi + nginx (YET AGAIN)

python,virtualenv,uwsgi,virtualenvwrapper
Ok, I know there are loads of virtualenv + uwsgi + nginx articles out there, I've read about 50 of them (I have not fully read the uWSGI documentation). My question: Why do none of these options actually activate the virtualenv I am asking it to do? [uwsgi] home =...

Error in UWSGI(with nginx)

ubuntu,nginx,uwsgi
Error: Wed Mar 11 11:06:20 2015 - mounting main:application on / Error opening file for reading: Permission denied log: Wed Mar 11 11:06:19 2015 - goodbye to uWSGI. [uWSGI] getting INI configuration from /usr/share/uwsgi/conf/default.ini [uWSGI] getting INI configuration from /etc/uwsgi/apps-enabled/tiles.ini Wed Mar 11 11:06:20 2015 - *** Starting uWSGI 1.0.3-debian...

Nginx map client certificate to REMOTE_USER for uWSGI with fallback to basic auth?

ssl,nginx,mercurial,cgi,uwsgi
I'm using Nginx with uWSGI to serve Mercurial; it does basic auth over SSL (Nginx is the SSL terminator; it doesn't get passed on to Hg), but due to the limited security of basic auth even over SSL, as discussed at various places including this site, I want to allow...

How to start uwsgi with flask and nginx

nginx,flask,uwsgi
I guess my main problem is that i don't know, how file hierarchy should look like ? So far i was following Grinberg's tutorial in his "Flask development" book. So i have like: --manage.py ( Flask's Script extension script) --app/ ( application folder as a package) --virtual_env and not sure...

Have created a docker that installs nginx, python, uwsgi and django. How do I test it within a VM?

django,nginx,docker,uwsgi
I have created the following project using docker. Here is the Dockerfile ############################################################ # Purpose : Dockerize Django App to be used in AWS EC2 # Django : 1.8.1 # OS : Ubuntu 14.04 # WebServer : nginx # Database : Postgres inside RDS # Python : 2.7 # VERSION...

flask + nginx + uwsgi_response_sendfile_do() TIMEOUT

python,nginx,flask,download,uwsgi
I'm having problem with my flask + uwsgi + nginx app, simply i cant download file bigger then ~1GiB (size is differend each time by few bytes) I have plenty of free RAM on server I have plenty of free HDD space on server I tested it in 3 different...

unable to load configuration from app:app

flask,uwsgi
I am trying to run flask app server with uwsgi from supervisor and i getting error [program:tmanalytics] directory = /srv/www/tmapi/ command = uwsgi --socket /tmp/tmuwsgi.sock app:app --chmod-socket 777 --touch-reload /srv/www/tmapi/deployment.log watch=/srv/www/tmapi/app/ stdout_logfile=/srv/www/tmapi/tmapi-analytics.log autostart=true autorestart=true redirect_stderr=true stopsignal=QUIT ...

Flask sub.domain.com overrides session on domain.com

session,nginx,flask,subdomain,uwsgi
I have two seperate server one for domain.com and another for sub.domain.com, and I store sessions using flask-session and following configuration: SERVER_NAME = 'domain.com' SESSION_COOKIE_DOMAIN = ".domain.com" # Flask-Session SESSION_TYPE = 'redis' SESSION_REDIS = Redis(host='192.168.10.10', port=6379, db=0) further more I am using reverse proxy using nginx and: proxy_set_header Host $host;...

How can I avoid uwsgi_modifier1 30 and keep WSGI my application location-independent?

nginx,uwsgi,cherrypy
I have a WSGI application using CherryPy hosted using uWSGI behind a ngnix server. I would like for the application itself to be "portable". That is, the application should not know or care what URL it is mapped to, and should even work if mapped to multiple different URLs. I...

sqlite3 cannot open database file, running Centos, flask uwsgi nginx

nginx,sqlite3,flask,centos,uwsgi
I have a fairly simple flask app which runs fine on my local machine. The app uses sqlite3. I am trying to deploy to a CentOS machine running nginx and uwsgi. The app starts but when I try to access the site through chrome, it raises an exception: sqlite3.OperationalError: unable...