sudo apt-get install uwsgi-plugin-python
plugin = python3
plugins-dir = /usr/lib/uwsgi/plugins
sudo uwsgi --emperor /etc/uwsgi/vassals --uid anton --gid anton
(com_env) anton@anton-X451CA:~/Django-u/company_base$ sudo uwsgi --emperor /etc/uwsgi/vassals --uid anton --gid anton
*** Starting uWSGI 2.0.12-debian (64bit) on [Thu Sep 14 15:40:06 2017] ***
compiled with version: 5.4.0 20160609 on 31 August 2017 21:02:04
os: Linux-4.10.0-33-generic #37~16.04.1-Ubuntu SMP Fri Aug 11 14:07:24 UTC 2017
nodename: anton-X451CA
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /home/anton/Django-u/company_base
detected binary path: /usr/bin/uwsgi-core
setgid() to 1000
set additional group 4 (adm)
set additional group 24 (cdrom)
set additional group 27 (sudo)
set additional group 30 (dip)
set additional group 46 (plugdev)
set additional group 113 (lpadmin)
set additional group 128 (sambashare)
setuid() to 1000
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 15083
your memory page size is 4096 bytes
detected max file descriptor number: 1024
*** starting uWSGI Emperor ***
*** has_emperor mode detected (fd: 6) ***
[uWSGI] getting INI configuration from company_uwsgi.ini
open("/usr/lib/uwsgi/plugins/python3_plugin.so"): No such file or directory [core/utils.c line 3684]
!!! UNABLE to load uWSGI plugin: /usr/lib/uwsgi/plugins/python3_plugin.so: cannot open shared object file: No such file or directory !!!
*** Starting uWSGI 2.0.12-debian (64bit) on [Thu Sep 14 15:40:06 2017] ***
compiled with version: 5.4.0 20160609 on 31 August 2017 21:02:04
os: Linux-4.10.0-33-generic #37~16.04.1-Ubuntu SMP Fri Aug 11 14:07:24 UTC 2017
nodename: anton-X451CA
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /etc/uwsgi/vassals
detected binary path: /usr/bin/uwsgi-core
chdir() to /home/anton/Django-u/company_base/
your processes number limit is 15083
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /home/anton/Django-u/company_base/company.sock fd 3
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 800448 bytes (781 KB) for 10 cores
*** Operational MODE: preforking ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
no request plugin is loaded, you will not be able to manage requests.
you may need to install the package for your language of choice, or simply load it with --plugin.
!!!!!!!!!!! END OF WARNING !!!!!!!!!!
spawned uWSGI master process (pid: 7399)
Thu Sep 14 15:40:06 2017 - [emperor] vassal company_uwsgi.ini has been spawned
spawned uWSGI worker 1 (pid: 7400, cores: 1)
spawned uWSGI worker 2 (pid: 7401, cores: 1)
Thu Sep 14 15:40:06 2017 - [emperor] vassal company_uwsgi.ini is ready to accept requests
spawned uWSGI worker 3 (pid: 7402, cores: 1)
spawned uWSGI worker 4 (pid: 7403, cores: 1)
spawned uWSGI worker 5 (pid: 7404, cores: 1)
spawned uWSGI worker 6 (pid: 7405, cores: 1)
spawned uWSGI worker 7 (pid: 7406, cores: 1)
spawned uWSGI worker 8 (pid: 7407, cores: 1)
spawned uWSGI worker 9 (pid: 7408, cores: 1)
spawned uWSGI worker 10 (pid: 7409, cores: 1)
[uwsgi]
plugin = python3
plugins-dir = /usr/lib/uwsgi/plugins
chdir = /home/anton/Django-u/company_base/
module = company_base.wsgi
home = /home/anton/virtenvs/com_env/
master = true
processes = 10
socket = /home/anton/Django-u/company_base/company.sock
chmod-socket = 666
vacuum = true
class ProfileFilterForm(forms.Form):
def __init__(self, *args, **kwargs):
choices = [('all', 'Все отделы')]
sectors = Sector.objects.all()
for i in sectors:
choices.append((i.pk, i.name))
self.fields['sector'].choices=choices
available = forms.BooleanField(label = 'Работают в компании', required=False, \
widget=forms.CheckboxInput(attrs={'name':'available', 'value':'1','style':'selector_element',}))
sector = forms.ChoiceField(label='Отдел', required=False, \
widget=forms.Select(attrs={'name':'sector', 'style':'selector_element',}))
class ProfileFilterForm(forms.Form):
available = forms.BooleanField(label = 'Работают в компании', required=False, widget=forms.CheckboxInput(attrs={'name':'available', 'value':'1','style':'selector_element',}))
sector = forms.ChoiceField(label='Отдел', required=False, choices=build_sectors_list(), widget=forms.Select(attrs={'name':'sector', 'style':'selector_element',}))
def build_sectors_list():
choices = [('all', 'Все отделы')]
if 'makemigrations' not in sys.argv and 'migrate' not in sys.argv:
sectors = Sector.objects.all()
for i in sectors:
choices.append((i.pk, i.name))
return choices
[Unit]
Description=Celery Service
After=network.target
[Service]
Type=forking
User=celery
Group=celery
EnvironmentFile=-/etc/conf.d/celery
WorkingDirectory=/opt/celery
ExecStart=/bin/sh -c '${CELERY_BIN} multi start ${CELERYD_NODES} \
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
ExecStop=/bin/sh -c '${CELERY_BIN} multi stopwait ${CELERYD_NODES} \
--pidfile=${CELERYD_PID_FILE}'
ExecReload=/bin/sh -c '${CELERY_BIN} multi restart ${CELERYD_NODES} \
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
[Install]
WantedBy=multi-user.target
CELERYD_NODES="xxx_apart"
CELERY_BIN="/home/ubuntu/virtenvs/env_apart/bin/celery"
CELERY_APP="xxx_apart.celery:app"
CELERYD_MULTI="multi"
CELERYD_OPTS="--time-limit=300 --concurrency=8"
CELERYD_LOG_FILE="/var/log/celery/%n%I.log"
CELERYD_PID_FILE="/var/run/celery/%n.pid"
CELERYD_LOG_LEVEL="INFO"
Job for celery.service failed because the control process exited with error code. See "systemctl status celery.service" and "journalctl -xe" for details.
ubuntu@cloud-netzbarkeit-03:~$ systemctl status celery.service
● celery.service - Celery Service
Loaded: loaded (/etc/systemd/system/celery.service; disabled; vendor preset:
Active: failed (Result: exit-code) since Wed 2017-08-30 08:12:52 UTC; 16s ago
Process: 1612 ExecStart=/bin/sh -c ${CELERY_BIN} multi start ${CELERYD_NODES}
Aug 30 08:12:52 cloud-netzbarkeit-03 systemd[1]: Starting Celery Service...
Aug 30 08:12:52 cloud-netzbarkeit-03 systemd[1]: celery.service: Control process
Aug 30 08:12:52 cloud-netzbarkeit-03 systemd[1]: Failed to start Celery Service.
Aug 30 08:12:52 cloud-netzbarkeit-03 systemd[1]: celery.service: Unit entered fa
Aug 30 08:12:52 cloud-netzbarkeit-03 systemd[1]: celery.service: Failed with res