uwsgi

Error importing psycopg2._psycopg when using uWSGI

大兔子大兔子 提交于 2019-12-11 16:51:53
问题 I'm getting the following import error when I try to run uwsgi --ini <my uwsi ini file> : Traceback (most recent call last): File "/var/www/mysite/venv/lib/python3.5/site-packages/django/db/backends/postgresql/base.py", line 20, in <module> import psycopg2 as Database File "/var/www/mysite/venv/lib/python3.5/site-packages/psycopg2/__init__.py", line 50, in <module> from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID ImportError: No module named 'psycopg2._psycopg' However,

UWSGI can't change log file path

风流意气都作罢 提交于 2019-12-11 13:05:35
问题 I have a Debian 7 + uwsgi 1.2.3-debian I want to change UWSGI log file path, I tried [uwsgi] plugins = python27 chdir = /home/example.com/apps/ pythonpath = /home/example.com/apps/ env = DJANGO_SETTINGS_MODULE=settings module = django.core.handlers.wsgi:WSGIHandler() touch-reload = /home/example.com/README.md logto = /home/example.com/logs/uwsgi.logto.log; daemonize = /home/example.com/logs/uwsgi.daemonize.log; logdate = true max-requests = 5000 buffer-size = 32768 But /home/example.com/logs/

nginx - uWSGI HTTP + websocket config

女生的网名这么多〃 提交于 2019-12-11 12:41:29
问题 I'm trying to configure uWSGI for an application (Django) that uses http & websocket queries. Here is the uWSGI ini file that I did to achieve this [uwsgi] ini = :runserver ini = :wsserver [default] userhome = /home/myuser virtualenv = %(userhome)/.virtualenvs/myapp chdir = %(userhome)/Documents/myapp master = true no-orphans = true uid = www-data gid = www-data threads = 1 env = DJANGO_SETTINGS_MODULE=myapp.settings vacuum = true [runserver] ini = :default socket = /tmp/myapp.sock module =

Docker run cannot find executable “uwsgi”

試著忘記壹切 提交于 2019-12-11 12:22:44
问题 I am trying to deploy a falcon app with Docker. Here is my Dockerfile: FROM python:2-onbuild # Set the working directory to /app WORKDIR /app # Copy the current directory contents into the container at /app ADD . /app RUN pip install -r ./requirements.txt RUN pip install uwsgi EXPOSE 8000 CMD ["uwsgi", "--http”, " :8000" , "—wsgi-file”, "falconapp.wsgi"] However I keep getting error saying: /bin/sh: 1: [uwsgi,: not found I've tried running uwsgi in the local directory and it works well with

Sqlalchemy returns different results of the SELECT command (query.all)

断了今生、忘了曾经 提交于 2019-12-11 11:13:07
问题 I have web server (512 RAM) with: FLASK + SQLAlchemy (SQLite) -> uWSGI -> Nginx PROBLEM: Sqlalchemy returns different results of the SELECT command (query.all). Example: Added a few records in the database. I reload the page: new records have not returned (but old returned). Reload the page: all the records returned. Excellent. Reload the page: again new records have not returned. (But old returned). This happens as long as I do not restart Flask app. The code below: DECLARATIVE_BASE =

Linux 安装Nginx

两盒软妹~` 提交于 2019-12-11 10:36:30
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 安装Nginx 去 官网http://nginx.org/ 下载对应的nginx包,推荐使用稳定版本 上传nginx到linux系统 安装依赖环境 (1)安装gcc环境 yum install gcc-c++ (2)安装PCRE库,用于解析正则表达式 yum install -y pcre pcre-devel (3)zlib压缩和解压缩依赖, yum install -y zlib zlib-devel (4)SSL 安全的加密的套接字协议层,用于HTTP安全传输,也就是https yum install -y openssl openssl-devel 解压,需要注意,解压后得到的是源码,源码需要编译后才能安装 tar -zxvf nginx-1.16.1.tar.gz 编译之前,先创建nginx临时目录,如果不创建,在启动nginx的过程中会报错 mkdir /var/temp/nginx -p cd 在nginx目录,输入如下命令进行配置,目的是为了创建makefile文件 执行以下 ./configure \ --prefix=/usr/local/nginx \ --pid-path=/var/run/nginx/nginx.pid \ --lock-path=/var/lock/nginx

Issue using supervisor and uwsgi in conda env

一曲冷凌霜 提交于 2019-12-11 10:08:53
问题 I'm trying to run a Flask app with uwsgi + supervisor + nginx. uwsgi is installed in a conda env, and I can run my app with no issue without supervisor, i.e. if I run (with my conda env activated): uwsgi --ini /home/me/Development/flask/myflaskapp/myflaskapp.ini with the following config: /home/me/Development/flask/myflaskapp/myflaskapp.ini [uwsgi] chmod-socket = 666 socket = /home/me/Development/flask/myflaskapp/run/myflaskapp.sock module = wsgi callable = app vim /etc/nginx/sites-available

UWSGI logrotation

自闭症网瘾萝莉.ら 提交于 2019-12-11 08:56:47
问题 I have running uwsgi server. i need log rotation for daily and file size based log rotation. uwsgi configuration: # file: /etc/init/uwsgi.conf description "uWSGI starter" start on (local-filesystems and runlevel [2345]) stop on runlevel [016] respawn # home - is the path to our virtualenv directory # pythonpath - the path to our django application # module - the wsgi handler python script exec /home/testuser/virtual_environments/teatapp/bin/uwsgi \ --uid testuser \ --home /home/testuser

What's the advantage of running multiple threads per UWSGI process?

馋奶兔 提交于 2019-12-11 08:43:15
问题 If I'm performing blocking operations like querying a database, then what is the advantage? How does this add extra worthwhile capacity? 回答1: Python's native multithreading is affected by GIL limitations. Simply put, only one Python thread at a time is physically executed. An exception to this are blocking IO calls (e. g. DB query) that let other Python threads take over, which may increase performance of IO-bound operations. So the real performance gain would only be possible if your

Super basic uwsgi configuration

非 Y 不嫁゛ 提交于 2019-12-11 07:08:38
问题 I've tried some uwsgi tutorials but can't get a simple python script to run in my browser. Ive read through this (http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html) and this (https://www.digitalocean.com/community/articles/how-to-deploy-python-wsgi-applications-using-uwsgi-web-server-with-nginx) and others, but for some reason can't get a simple uwsgi app running. I am currently not going through a web server, just uwsgi by itself. I have the following wsgi.py: def application