gunicorn

What is the disadvantage of using Django's fastcgi server

落爺英雄遲暮 提交于 2019-11-28 16:49:09
问题 I'm using nginx + fastcgi ( manage.py runfcgi ...) on production for some of my Django projects. A lot of people suggests to use nginx + gunicorn . What is advantage of using gunicorn instead of using Django's fastcgi server? 回答1: I'm just tell why you need to use WSGI-like servers :) but if you feel comfortable with using fcgi - just use it Short answer: WSGI (as protocol) is cool because its native Or if "You need to go deeper"(c) Next question "FastCGI vs WSGI-like servers?" Some answers

Running a flask app with nginx and gunicorn

会有一股神秘感。 提交于 2019-11-28 16:15:23
I'm new at this and have only been using nginx to serve static files. I have now installed flask and gunicorn. If I run gunicorn -b 127.0.0.2:8000 hello:app and then wget it from the server it works well. If I try to access it from a browser, however, it returns a 404 error (I am running this on a server that hosts a wordpress site which is locatet at root). The flask app: from flask import Flask from werkzeug.contrib.fixers import ProxyFix app = Flask(__name__) @app.route('/') def hello(): return "Hello world!" app.wsgi_app = ProxyFix(app.wsgi_app) if __name__ == '__main__': app.run() And the

Deploying Django with gunicorn and nginx

巧了我就是萌 提交于 2019-11-28 14:57:12
This is a broad question but I'd like to get a canonical answer. I have been trying to deploy a site using gunicorn and nginx in Django . After reading tons of tutorials I have been successful but I can't be sure that the steps I followed are good enough to run a site without problems or maybe there are better ways to do it. That uncertainty is annoying. That's why I'm looking for a very detailed and well explained answer for newbies. I don't want to explain too much what I know and what I don't know since this could skew the answers a bit and other people could benefit to a lesser degree from

Errno 13 Permission denied using Gunicorn

你说的曾经没有我的故事 提交于 2019-11-28 12:24:04
I'm running django on Digital Ocean with gunicorn and nginx . Gunicorn for serving the django and nginx for static files. Upon uploading a file via website, I cant save to a folder in /home directory. I get [Errno 13] Permission denied. Please, how do I make the web server to be able have read write access to any arbitrary folder anywhere under /home? This all depends on the user that your application is running as. If you check ps aux | grep gunicorn which user the Gunicorn server is running your app as then you can change the chmod or chown permissions accordingly. ls -lash will show you

Django Gunicorn not load static files

[亡魂溺海] 提交于 2019-11-28 12:07:23
i'm trying to deploy my django project with gunicorn and nginx, but i need some help. when i code gunicorn myproject.wsgi:application I manage to see my website in the localhost page but without any css. Why gunicorn does not load my css files that are into the static folder of my project? Guinicorn_start script: https://dpaste.de/TAc4 Gunicorn output: https://dpaste.de/C6YX aldo_vw Gunicorn will only serve the dynamic content, i.e. the Django files. So you need to setup a proxy server such as nginx to handle the static content (your CSS files). I assume you are starting Gunicorn the right way

'Invalid input syntax for type inet' db error in Django app with postgres and Gunicorn+Nginx as reverse proxy

空扰寡人 提交于 2019-11-28 11:21:28
问题 Can you help me decipher this rather esoteric error? Everything's fine when I fire up the application, but crashes the moment I try to login . DatabaseError at /login/ invalid input syntax for type inet: "" LINE 1: ...00101 Firefox/41.0', '2015-12-12 09:39:55.590036+00:00', '') Exception Location: /home/mhb11/.virtualenvs/redditpk/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py in execute, line 54 I know for a fact that the inet data type accepts IPv4 and IPv6

ERROR: Invalid HTTP_HOST header: '/webapps/../gunicorn.sock'

◇◆丶佛笑我妖孽 提交于 2019-11-28 09:53:26
After I deployed my Django App last night I got tons of strange Emails saying: ERROR: Invalid HTTP_HOST header: '/webapps/example_com/run/gunicorn.sock I'm sure this is somehow related to the following nginx config: upstream example_app_server { server unix:/webapps/example_com/run/gunicorn.sock fail_timeout=0; } server { listen 80; server_name example.com; client_max_body_size 4G; access_log /webapps/example_com/logs/nginx-access.log; error_log /webapps/example_com/logs/nginx-error.log; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host;

How to get coverage data from a django app when running in gunicorn

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 09:12:49
How do I get code coverage out of a Django project's view code (and code called by view code)? coverage gunicorn <params> does not show any lines being hit. coverage gunicorn <params> does not work, because gunicorn creates worker processes, and the coverage module can't work across forks (basically, creation of new processes). You can use the coverage API , though, for example in the python module that contains your WSGI application: # wsgi_with_coverage.py import atexit import sys import coverage cov = coverage.coverage() cov.start() from wsgi import application # adjust to python module

Gunicorn, no module named 'myproject

时间秒杀一切 提交于 2019-11-28 07:13:24
I'm installing a previously built website on a new server. I'm not the original developer. I've used Gunicorn + nginx in the past to keep the app alive (basically following this tutorial ), but am having problems with it here. I source venv/bin/activate , then ./manage.py runserver 0.0.0.0:8000 works well and everything is running as expected. I shut it down and run gunicorn --bind 0.0.0.0:8000 myproject.wsgi:application , and get the following: [2016-09-13 01:11:47 +0000] [15259] [INFO] Starting gunicorn 19.6.0 [2016-09-13 01:11:47 +0000] [15259] [INFO] Listening at: http://0.0.0.0:8000

Heroku + gunicorn not working (bash: gunicorn: command not found )

谁说胖子不能爱 提交于 2019-11-28 05:42:35
I successfully install gunicorn: remote: -----> Removing .DS_Store files remote: -----> Python app detected remote: -----> Installing dependencies with pip remote: Collecting gunicorn==19.0.0 (from -r requirements.txt (line 1)) remote: Downloading gunicorn-19.0.0.tar.gz (382kB) remote: Installing collected packages: gunicorn remote: Running setup.py install for gunicorn remote: Successfully installed gunicorn-19.0.0 My Procfile: web: gunicorn myapp:app --log-file=- But the app crashes when deployed: bash: gunicorn: command not found I tried adding the heroku python buildpack, but no luck. If I