uwsgi

uWSGI + nginx + git-http-backend

泄露秘密 提交于 2019-12-06 07:29:46
I have a problem to establish connection to git-http-backend on nginx with uwsgi. I can clone the repo but couldn't push anything because this: 17:20:58.877539 git.c:344 trace: built-in: git push -v 17:20:58.877648 run-command.c:640 trace: run_command: GIT_DIR=.git git-remote-http origin http://example.com/test.git Pushing to http://example.com/test.git * Couldn't find host example.com in the .netrc file; using defaults * Trying 192.168.0.120... * TCP_NODELAY set * Connected to example.com (192.168.0.120) port 80 (#0) > GET /test.git/info/refs?service=git-receive-pack HTTP/1.1 Host: example

Serving Django admin site on subdomain

五迷三道 提交于 2019-12-06 07:18:07
问题 I have a project running Django, uWSGI, and Nginx. Currently I use the default Django admin site, served at example.com/admin . I want to change this so that the admin site is only available at admin.example.com . What is the best way to do this? I had thought about starting a completely new Django project to be served on admin.example.com but with the same database settings as the project that runs example.com , but I'm hoping for something more elegant since this would involve duplicating a

ningx, uwsgi, python permanent mysql error after some time from starting application

佐手、 提交于 2019-12-06 06:09:30
I'm using nginx as frontend server and uwsgi for python applications. About one time a day one of my applications starts falling. In log I can see different mysql errors. For example: sqlalchemy.exc.OperationalError: (OperationalError) (2006, 'MySQL server has gone away') or sqlalchemy.exc.OperationalError: (OperationalError) (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)") None None Also there were something about can't locate row column for column ... . And maybe more interesting: --- no python application found, check your startup logs for

Django app deployment on nGINX

你。 提交于 2019-12-06 03:36:17
问题 I want to deploy Django application on nGINX server. I'm using uWSGI. I looked up in many tutorials but none worked. Django application runs perfectly as a standalone app. What is the simplest way to have the same app running on nGINX?? I'm stuck here and want a solution.. :-( my www folder is in /usr/share/nginx/www my site-enabled n conf.d and all are in /etc/nginx/ I did install uWSGI but couldn't find any folder named uwsgi which has apps-installed folder/file in it 回答1: Once you have

How to get python interpreter path in uwsgi process

Deadly 提交于 2019-12-06 02:19:44
How can I get python interpreter path in uwsgi process (if I started it with -h parameter)? I tryed to use VIRTUAL_ENV and UWSGI_PYHOME environment variables, but they are empty, I do not know why. Also i tryed to use sys.executable , but it points to uwsgi process path. uWSGI is not a python application (it only calls libpython functions) so the effective executable is the uwsgi binary. If you use virtualenvs you can assume the binary is in venv/bin/python 来源: https://stackoverflow.com/questions/18014122/how-to-get-python-interpreter-path-in-uwsgi-process

uwsgi + Django REST framework: few slow request after idle time

那年仲夏 提交于 2019-12-06 01:37:09
I'm running Django REST framework with fairly low request per minute rate during the day. I've noticed one problem that I could't explain or reproduce. Every day, during the night or early in the morning, when my RPM is close to zero I have 1 - 10 requests that are super slow. Average response time for me us between 100 and 200 ms , but this ones are from 50s to 1 minute . On this screen you can see how it happens: As my primary database I'm using MySQL and I've implemented logging for each request with something similar to DRF-tracking . In my logs I can see that it's actually two different

deploying flask app with uwsgi and flask-script Manager

只愿长相守 提交于 2019-12-05 22:49:35
问题 Traditionally, I have configured the UWSGI configuration file to call an application like below: mydirectory/uwsgi_application.ini ... #python module to import app = run_web module = %(app) callable = app ... , mydirectory/run_web.py from ersapp import app if __name__ == "__main__": app.run() , mydirectory/ersapp/__init__.py ... app = Flask('ersapp') ... But now, I am following Miguel Grinberg's Flask book and here he uses an application factory like below mydirectory/ersapp/__init__.py ...

uWSGI Emperor Permission Denied unless root

大憨熊 提交于 2019-12-05 20:41:37
I've tried using the flags on the binary itself (--uid www-data --gid www-data) and setting it in my config: uid = www-data gid = www-data but the socket is always spawned with the account I'm working with, so i'm getting a permission denied error from nginx. Anyone know why this is? Additional question: Does anyone know where nginx and uwsgi have the user set? I have another server which has been working forever, and it does not have uid or gid set in any of the config files, yet everything is using www-data as it should. ANSWER Apparently if you start the service from the terminal as I was

Upgrade to PyMongo 3.0 Resulting in ServerSelectionTimeoutError

笑着哭i 提交于 2019-12-05 20:15:24
问题 I recently upgraded a Bottle + uWSGI + Nginx application to MongoDB 3.0.2. It was working fine with PyMongo 2.8, but today I upgraded to PyMongo 3.0 by running following command: pip install --upgrade pymongo I haven't done any other changes to the code, but now I keep getting the following error. File "/pymongo/cursor.py", line 968, in __next__ if len(self.__data) or self._refresh(): File "/pymongo/cursor.py", line 905, in _refresh self.__read_preference)) File "/pymongo/cursor.py", line 812

centos8 下配置 uwsgi + Django

天涯浪子 提交于 2019-12-05 19:57:18
该过程位于centos的docker容器中进行 django版本2.1 参考链接 如何配置nginx+uwsgi+django? django文档,如何使用uwsgi进行配置 安装环境 yum -y install python36 yum -y install gcc yum -y install python36-devel 安装uwsgi pip3 install uwsgi 测试uwsgi是否安装完成 uwsgi --version 简单测试 创建test.py 文件,内容为 def application(env, start_response): start_response('200 OK', [('Content-Type','text/html')]) return [b"Hello World"] # python3 #return ["Hello World"] # python2 start_response 是wsgi中规定的header的内容 之后返回的是主体内容 安装git yum -y install git 拷贝要部署的项目 git clone [项目链接] 使用uwsgi 部署 在一个合适的地方配置uwsig.ini用作配置文件 笔者将uwsgi.ini 放在了django项目同名目录的内层 文件结构如下 + mysite ++ mysite -