Unit: Unable to configure Django app with unit 1.0

Created on 19 Apr 2018  路  3Comments  路  Source: nginx/unit

Unit exist with status code 1

unit.log

2018/04/19 06:59:10 [info] 2026#2026 "django" application started
2018/04/19 06:59:10 [alert] 2026#2026 Python failed to import module "wsgi"
2018/04/19 06:59:10 [notice] 1954#1954 process 2026 exited with code 1
2018/04/19 06:59:10 [warn] 1957#1957 failed to start application "django"
2018/04/19 06:59:10 [alert] 1957#1957 failed to apply new conf

unit.config

{
     "listeners": {
         "*:8080": {
             "application": "django"
         }
     },
     "applications": {
        "django": {
                "type": "python 3.5",
                "processes": 1,
                "module": "wsgi",
                "user": "root",
                "group": "root",
                "path": "/srv/app",
                "home": "/srv/venv"
        }
   }
}

Folder structure

vagrant@ubuntu-xenial:/srv/app$ tree
.
|-- app
|   |-- __init__.py
|   |-- pyinfo.py
|   |-- settings.py
|   |-- urls.py
|   `-- views.py
|-- config.json
|-- db.sqlite3
|-- manage.py
|-- static
`-- wsgi.py

2 directories, 9 files

Note: Tried without virtualenv, still same error.

Most helpful comment

Hello, try "path": "/srv", (without 'app' directory).

All 3 comments

Hello, thanks for the report. What's inside wsgi.py?

Hello, try "path": "/srv", (without 'app' directory).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yujinqiu picture yujinqiu  路  5Comments

Madhu1512 picture Madhu1512  路  4Comments

hongzhidao picture hongzhidao  路  3Comments

Izorkin picture Izorkin  路  4Comments

pchaganti picture pchaganti  路  3Comments