Stuck with Django on a Synology Diskstation

2,723 views
Skip to first unread message

MH

unread,
Mar 2, 2020, 3:04:23 PM3/2/20
to Django users
Hi there

I am rather a newbie, but after some problems I got django installed on my Synology Diskstation. So, I ignored many other problems and am very happy that I built my very first, very simple app. And now I would like to move it from the development stage to the production stage. Obviously I should make a change to a distinct webserver. Synology offers nginx and apache 2.4. I installed both. And now I do not really know how to proceed. Out there, there are many instructions to use something called mod-wsgi. But I cannot install this from the package center of the Diskstation.

I also tried to get opkg working. And this did not turn out so well, too. Most packages return an error, when I try to install something. Before this gets too elusive, I would ask you for guidance and then I can provide you with the following error messages.

Best regards
MH

nitish kumar

unread,
Mar 3, 2020, 1:16:50 AM3/3/20
to Django users
Hi MH,


what flavour of Linux you are using. if it is centos/redhat you can use below steps.

   $sudo yum install httpd24-devel.x86_64 gcc git
     $sudo python3.5 -m pip install  mod-wsgi

once installed you need to add site configuration and permissions to your Django code.

 $ cd ~/django_app
 $python manage.py makemigrations
 $python manage.py migrate
 Note: if you get any errors remove  "db.sqlite3" file and execute the above 2 commands
 $python manage.py collectstatic
 $sudo chown :www-data db.sqlite3
 $sudo service apache2 restart

If packages are not available you have to try the offline installation. and you need to install dependencies manually.

ping me if you need more help(https://twitter.com/vullinitish)

Andréas Kühne

unread,
Mar 3, 2020, 7:41:16 AM3/3/20
to django...@googlegroups.com
Hi,

I don't think this is actually possible. Django runs python and not only simple html. Nginx and apache are simple webservers. So unless you can get good access to the terminal on the diskstation - I wouldn't even try this. Why do you want to have the application running on a disk station?

Regards,

Andréas


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3b30b913-c881-451d-a25e-3539eaefa035%40googlegroups.com.

MH

unread,
Mar 3, 2020, 8:01:31 AM3/3/20
to Django users
Dear nitish

Thanks for your reply. I guess it is kind of a linux that Synology uses, but it is different from other distros. So many advice on the internet builds upon the ability to install packages via apt-get or ipkg, but both are not available here. Somehow (really only somehow) I got entware/opkg installed. But since then I have problems with the installations of most packages there.

Here are the results of my adaption of your suggested commands:

/opt/bin# ./opkg find httpd
/opt/bin#

So, it seems there is no httpd24 on this repo.

/opt/bin# ./opkg install apache
Package apache (2.4.37-2) installed in root is up to date.

/opt/bin# ./opkg install gcc
Package gcc (7.4.0-5) installed in root is up to date.

/opt/bin# sudo python3.5 -m pip install mod-wsgi
Collecting mod-wsgi
 
Using cached mod_wsgi-4.7.1.tar.gz (498 kB)
    ERROR
: Command errored out with exit status 1:
     command
: /usr/local/bin/python3.5 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-24inw61_/mod-wsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-24inw61_/mod-wsgi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-24inw61_/mod-wsgi/pip-egg-info
         cwd
: /tmp/pip-install-24inw61_/mod-wsgi/
   
Complete output (5 lines):
   
Traceback (most recent call last):
     
File "<string>", line 1, in <module>
     
File "/tmp/pip-install-24inw61_/mod-wsgi/setup.py", line 168, in <module>
       
'missing Apache httpd server packages.' % APXS)
   
RuntimeError: The 'apxs' command appears not to be installed or is not executable. Please check the list of prerequisites in the documentation for this package and install any missing Apache httpd server packages.
   
----------------------------------------
ERROR
: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I guess there are many problems, but this is just a start.

Best regards
MH

MH

unread,
Mar 3, 2020, 8:01:39 AM3/3/20
to Django users
Dear Andreas

I want to build a little system, which consists of several django apps that help me in my daily life. But I don't want to upload documents about insurances and stuff to any cloud. Therefore I wanted a solution on premise and the NAS seemed to be a good choice. Could be wrong about that. So far I was happy with development version, but it seems difficult to install other things like mod-wsgi.

Best regards
MH

Omar Abou Mrad

unread,
Mar 3, 2020, 12:13:20 PM3/3/20
to django...@googlegroups.com
[Alternative] While this shouldn't be considered as a way to circumvent learning how to
configure apache or nginx to serve/proxy python apps, you can also consider sticking
to pure python dependencies (if this is for personal use). you can ignore the webserver
completely and simply opt for [1] gunicorn for app serving and use [2] whitenoise for
serving static files.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

MH

unread,
Mar 4, 2020, 7:51:10 AM3/4/20
to Django users
Hi Omar

Actually I do not know why apache is better than the development webserver from django or gunicorn, but I wanted to give it a try. The installation worked.

Now I am not sure what I am doing wrong:

gunicorn project/wsgi.py:application
[2020-03-04 13:46:26 +0000] [28939] [INFO] Starting gunicorn 19.9.0
[2020-03-04 13:46:26 +0000] [28939] [INFO] Listening at: http://127.0.0.1:8000 (28939)
[2020-03-04 13:46:26 +0000] [28939] [INFO] Using worker: sync
[2020-03-04 13:46:26 +0000] [28950] [INFO] Booting worker with pid: 28950
[2020-03-04 13:46:26 +0000] [28950] [ERROR] Exception in worker process
Traceback (most recent call last):

 
File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
 
File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
ImportError: Failed to find application, did you mean 'project/wsgi:application'?
[2020-03-04 13:46:26 +0000] [28950] [INFO] Worker exiting (pid: 28950)
[2020-03-04 13:46:26 +0000] [28939] [INFO] Shutting down: Master
[2020-03-04 13:46:26 +0000] [28939] [INFO] Reason: Worker failed to boot.

I just found this file in my project folder in a folder below the manage.py command. So therefore I thought that this could be the right wsgi file. I did not write anything into it.

MH

unread,
Mar 5, 2020, 3:13:37 AM3/5/20
to Django users
Could anyone tell me how to start correctly the unicorn (integration)?

Omar Abou Mrad

unread,
Mar 5, 2020, 5:55:00 AM3/5/20
to django...@googlegroups.com
Change your working directory to "project" (the directory containing wsgi.py) and use:

 gunicorn -w 4 wsgi:application

It should work.

On Thu, Mar 5, 2020 at 10:14 AM 'MH' via Django users <django...@googlegroups.com> wrote:
Could anyone tell me how to start correctly the unicorn (integration)?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
Message has been deleted

MH

unread,
Mar 5, 2020, 7:10:24 AM3/5/20
to Django users
Thanks Omar,

but do I have to write something into that wsgi file?

gunicorn -w 4 wsgi:application
[2020-03-05 12:55:09 +0000] [29297] [INFO] Starting gunicorn 19.9.0
[2020-03-05 12:55:09 +0000] [29297] [INFO] Listening at: http://127.0.0.1:8000 (29297)
[2020-03-05 12:55:09 +0000] [29297] [INFO] Using worker: sync
[2020-03-05 12:55:09 +0000] [29307] [INFO] Booting worker with pid: 29307
[2020-03-05 12:55:09 +0000] [29307] [ERROR] Exception in worker process
Traceback (most recent call last):
 
File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in
load_wsgiapp
 
File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app
 
File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", line 12, in <module>
   
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +0000] [29307] [INFO] Worker exiting (pid: 29307)
[2020-03-05 12:55:09 +0000] [29308] [INFO] Booting worker with pid: 29308
[2020-03-05 12:55:09 +0000] [29308] [ERROR] Exception in worker process
Traceback (most recent call last):
 
File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in
load_wsgiapp
 
File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app
 
File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", line 12, in <module>
   
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +0000] [29309] [INFO] Booting worker with pid: 29309
[2020-03-05 12:55:09 +0000] [29308] [INFO] Worker exiting (pid: 29308)
[2020-03-05 12:55:09 +0000] [29310] [INFO] Booting worker with pid: 29310
[2020-03-05 12:55:09 +0000] [29309] [ERROR] Exception in worker process
Traceback (most recent call last):
 
File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in
load_wsgiapp
 
File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app
 
File "/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", line 12, in <module>
   
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +0000] [29309] [INFO] Worker exiting (pid: 29309)
[2020-03-05 12:55:09 +0000] [29310] [ERROR] Exception in worker process
Traceback (most recent call last):
 
File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in
load_wsgiapp
 
File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app
 
File "/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", line 12, in <module>
   
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +0000] [29310] [INFO] Worker exiting (pid: 29310)
[2020-03-05 12:55:10 +0000] [29297] [INFO] Shutting down: Master
[2020-03-05 12:55:10 +0000] [29297] [INFO] Reason: Worker failed to boot.

The wsgi filee only consists of:

import os

from django.core.wsgi import get_wsgi_application

os
.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

application
= get_wsgi_application()


What should I do differently?

MH

unread,
Mar 5, 2020, 7:33:43 AM3/5/20
to Django users
Somehow I cannot write everything into one post that I wanted to reply. Here comes the rest of my original post.


gunicorn -w 4 wsgi:application
[... continued ...]

Traceback (most recent call last):
 
File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in
wsgi
 
Traceback (most recent call last):

Omar Abou Mrad

unread,
Mar 5, 2020, 8:20:58 AM3/5/20
to django...@googlegroups.com
Is django installed properly?
Are you still able to use runserver?
What happens when you run the following?

python -c "import django.core.wsgi" && echo "Yup, works!"

also, looking further into your error log, make sure you're in the proper directory.
(i may have given you the wrong one earlier, run the below and see if it works)

cd /var/services/homes/admin/DjangoProject/project/
gunicorn -w 4 project.wsgi:application

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

MH

unread,
Mar 5, 2020, 8:58:57 AM3/5/20
to Django users
Dear Omar

python -c "import django.core.wsgi" && echo "Yup, works!"
Traceback (most recent call last):

 
File "<string>", line 1, in <module>
ImportError: No module named django.core.wsgi


but
python3 manage.py runserver 0:8000
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
March 05, 2020 - 14:42:06
Django version 3.0.3, using settings 'project.settings'
Starting development server at http://0:8000/
Quit the server with CONTROL-C.



Omar Abou Mrad

unread,
Mar 5, 2020, 9:15:51 AM3/5/20
to django...@googlegroups.com
gunicorn is yielding the same error as the standard python command I gave you,
whereas you use python3 to fire up the django development server. I'll venture
a guess and say the problem is due to the environment.

Are you using any virtual environment or installing system wide?
How did you install django?
How did you install gunicorn?
Did you use pip?
Do you have a pip3?
Does "pip --version" and "pip3 --version" yield different results?

If you answered yes to the last 3 questions, try removing gunicorn using pip
and installing it using pip3.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

MH

unread,
Mar 5, 2020, 9:49:47 AM3/5/20
to Django users

To be quite honest, this is really challenging for me, because the synology OS drove me nuts. I am under the impression that I have multiple installations of python and pip running now.

In order to get an overview, I will now try to find every pip on my system and to install gunicorn everywhere. (I would wish I just had one central apt-get command here)...

~/.local/bin$ ./pip3 install gunicorn
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/python3.8/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/homes/admin/.local/lib/python3.8/site-packages (from gunicorn) (45.2.0)

and

~/.local/bin$ ./pip3.5 install gunicorn
Defaulting to user installation because normal site-packages is not writeable
Collecting gunicorn
 
Using cached gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
Requirement already satisfied: setuptools>=3.0 in /volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages (from gunicorn) (41.0.1)
Installing collected packages: gunicorn
  WARNING
: The script gunicorn is installed in '/var/services/homes/admin/.local/bin' which is not on PATH.
 
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed gunicorn-20.0.4

and

./pip3.8 install gunicorn
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/python3.8/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/homes/admin/.local/lib/python3.8/site-packages (from gunicorn) (45.2.0)

and

./pip install gunicorn
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/python3.8/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/homes/admin/.local/lib/python3.8/site-packages (from gunicorn) (45.2.0)

These were all from the same directory. Next post with more infos from other folders.




MH

unread,
Mar 5, 2020, 9:56:16 AM3/5/20
to Django users
/volume1/@appstore/py3k/usr/local/bin$ ./pip install gunicorn
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/python3.5/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages (from gunicorn) (41.0.1)

The output for this folder is identical for pip3 and pip 3.5.

/usr/bin$ ./pip install gunicorn
/usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning: 'point_conversion_form_t' has no values explicitly defined; next version will refuse to guess which integer type it is meant to be (unsigned/signed, int/long)
 
% self._get_c_name())
DEPRECATION
: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support

Defaulting to user installation because normal site-packages is not writeable
Collecting
gunicorn
 
Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
     
|████████████████████████████████| 113 kB 1.4 MB/s
Installing collected packages: gunicorn
ERROR
: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/gunicorn-19.10.0.dist-info'
Check the permissions.

and as root:
/usr/bin# ./pip install gunicorn
/usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning: 'point_conversion_form_t' has no values explicitly defined; next version will refuse to guess which integer type it is meant to be (unsigned/signed, int/long)
 
% self._get_c_name())
DEPRECATION
: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting gunicorn
 
Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
     
|████████████████████████████████| 113 kB 1.4 MB/s
Installing collected packages: gunicorn
Successfully installed gunicorn-19.10.0

I will now try it again.


Omar Abou Mrad

unread,
Mar 5, 2020, 10:04:46 AM3/5/20
to django...@googlegroups.com
As of Python 3.3 virtual environments are builtin, it would be wise to get used to them.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

MH

unread,
Mar 5, 2020, 10:10:19 AM3/5/20
to Django users
 gunicorn -w 4 wsgi:application
[2020-03-05 15:55:51 +0000] [4472] [INFO] Starting gunicorn 19.9.0
[2020-03-05 15:55:51 +0000] [4472] [INFO] Listening at: http://127.0.0.1:8000 (4472)
[2020-03-05 15:55:51 +0000] [4472] [INFO] Using worker: sync
[2020-03-05 15:55:51 +0000] [4483] [INFO] Booting worker with pid: 4483
[2020-03-05 15:55:51 +0000] [4483] [ERROR] Exception in worker process
Traceback (most recent call last):

 
File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
 
File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +0000] [4483] [INFO] Worker exiting (pid: 4483)
[2020-03-05 15:55:51 +0000] [4484] [INFO] Booting worker with pid: 4484
[2020-03-05 15:55:51 +0000] [4484] [ERROR] Exception in worker process
Traceback (most recent call last):

 
File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
 
File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +0000] [4484] [INFO] Worker exiting (pid: 4484)
[2020-03-05 15:55:51 +0000] [4486] [INFO] Booting worker with pid: 4486
[2020-03-05 15:55:51 +0000] [4486] [ERROR] Exception in worker process
Traceback (most recent call last):

 
File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
 
File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +0000] [4486] [INFO] Worker exiting (pid: 4486)
[2020-03-05 15:55:51 +0000] [4487] [INFO] Booting worker with pid: 4487
[2020-03-05 15:55:51 +0000] [4487] [ERROR] Exception in worker process
Traceback (most recent call last):

 
File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
 
File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
 
File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
 
File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +0000] [4487] [INFO] Worker exiting (pid: 4487)
[2020-03-05 15:55:51 +0000] [4472] [INFO] Shutting down: Master
[2020-03-05 15:55:51 +0000] [4472] [INFO] Reason: Worker failed to boot.



MH

unread,
Mar 5, 2020, 3:28:45 PM3/5/20
to Django users
Dear Omar

but would that help me right now? Besides the problem of finding the right pip, I mean? As you can see, even now my gunicorn won't work :(

MH

unread,
Mar 5, 2020, 3:50:51 PM3/5/20
to Django users
Is there anything particular hat I have to write into that wsgi.py file?

Omar Abou Mrad

unread,
Mar 5, 2020, 4:45:28 PM3/5/20
to django...@googlegroups.com
Make sure you're in the root of the project and run:

gunicorn -w 4 project.wsgi:application

you dont need to change anything.

On Thu, Mar 5, 2020, 10:51 PM 'MH' via Django users <django...@googlegroups.com> wrote:
Is there anything particular hat I have to write into that wsgi.py file?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

MH

unread,
Mar 5, 2020, 5:00:36 PM3/5/20
to Django users
If I am not totally mistaken it could be that gunicorn wants to work with python2.7 while I did everything with python3. But how could I direct gunicorn to take python3?

V. J

unread,
Mar 5, 2020, 5:16:54 PM3/5/20
to django...@googlegroups.com
Zdravím vás, myslíme že přístup byl udělen jen pár lidem kteří odvádí dobrou práci, jelikož by bylo dost nebezpečné udělit přístup všem, tak pokud vas mohu poprosit obraťte se s žádostí na ně. A pokud uznaji za vhodné že je to potřeba, provedou opravu, nebo doplnění. Pokud se mýlím, tak mě kontaktujte a prenastavim pravidla přístupu. Přeji hezký den s pozdravem Vasek Jachim

Odesláno z mého telefonu Huawei


-------- Původní zpráva --------
Předmět: Re: Stuck with Django on a Synology Diskstation
Odesílatel: 'MH' via Django users
Komu: Django users
Kopie:

Is there anything particular hat I have to write into that wsgi.py file?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

MH

unread,
Mar 5, 2020, 5:31:46 PM3/5/20
to Django users
Dear Omar

Finally I figured out, which of my gunicorn versions belonged to the right python3 that I invoked earlier. Now it seems to start. I write seems because in the browser it now immediately gives me an error that it cannot find a certain module "docx". I will come back to that in a different post.

But thanks for all so far!

Omar Abou Mrad

unread,
Mar 6, 2020, 12:28:23 AM3/6/20
to django...@googlegroups.com
Reach out to me privately, I'll assist you further.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

Tony Chang

unread,
Jul 14, 2021, 9:46:55 AM7/14/21
to Django users
Dear MH,

I also stuck here.

When I run ~# python3 -m pip install mod-wsgi

I got the same error message: RuntimeError: The 'apxs' command appears not to be installed or is not executable. Please check the list of prerequisites in the documentation for this package and install any missing Apache httpd server packages.

I installed the Apache HTTP Server 2.4.43 from Synology DSM 6.2.4-25556 Package Center. The apex is found in the system.

~# find / -iname apx*

/volume1/@appstore/Apache2.4/usr/local/bin/apxs

Could you share with me the way you got out from here?

Thanks

Best Regards,

Tony


MH 在 2020年3月3日 星期二下午9:01:31 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages