Bottom Page

Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Problems configuring and running uWSGI
Im trying to follow a tutorial to deploy a simple blog with Django and running into some problems with uwsgi.
So far I have done the following (as per the tutorial instructions):

Moved the contents of to 
Created and files in a new settings folder for local and production environments 
Installed PSQL and created a user and db Installed WSGI

I have then run uwsgi with this command

uwsgi --module=codego.wsgi:application -- --   http= --   virtualenv=/Users/david/documents/projects/django/codego   /venv/ --thunder-lock
I am then able to open my django site locally where it loads with no css

I then created the following uwsgi.ini file in a directory labeled ‘config’ in the main project folder

projectname = codego
base = /Users/david/documents/projects/django/codego/
master = true
virtualenv =     /Users/david/documents/projects/django/codego/venv/
pythonpath = %(base)
chdir = %(base)
env = DJANGO_SETTINGS_MODULE=%   (codego)
module = codego.wsgi:application
socket = /tmp/%(codego).sock
finally I run this command

uwsgi –ini config/uwsgi.ini
and then I get the error:

ImportError: No module named 'codego.wsgi'

unable to load app 0 (mountpoint='') (callable not found     or import error)
and this is the full output:

[uWSGI] getting INI configuration from config/uwsgi.ini
*** Starting uWSGI (64bit) on [Wed Sep 28    19:40:26 2016] ***
compiled with version: 4.2.1 Compatible Apple LLVM   7.0.2 (clang-700.1.81) on 17 September 2016 14:57:57
os: Darwin-14.5.0 Darwin Kernel Version 14.5.0: Mon  Aug 29 21:14:16 PDT 2016; root:xnu-  2782.50.6~1/RELEASE_X86_64
nodename: Davids-MacBook-Air.local
machine: x86_64
clock source: unix
detected number of CPU cores: 4
current working directory:   /Users/david/Documents/projects/django/codego/codego
detected binary path:   /Users/david/Documents/projects/django/codego/venv/bin/   uwsgi
!!! no internal routing support, rebuild with pcre support  !!!
chdir() to  /Users/david/documents/projects/django/codego/
your processes number limit is 709
your memory page size is 4096 bytes
detected max file descriptor number: 256
lock engine: OSX spinlocks
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /tmp/%    (codego).sock fd 3
Python version: 3.5.1 (default, Dec  7 2015, 21:59:08)     [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)]
Set PythonHome to     /Users/david/documents/projects/django/codego/venv/
*** Python threads support is disabled. You can enable it    with --enable-threads ***
Python main interpreter initialized at 0x7f96a9d00c00
your server socket listen backlog is limited to 100   connections
your mercy for graceful operations on workers is 60  seconds
mapped 145520 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
added /Users/david/documents/projects/django/codego/    to pythonpath.
ImportError: No module named 'codego.wsgi'
unable to load app 0 (mountpoint='') (callable not found    or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 2935)
spawned uWSGI worker 1 (pid: 2936, cores: 1)
it seems that there’s a problem with the wsgi file being loaded but its in the right place. This is the path to the file also:

and this is the contents of it:

import os

from django.core.wsgi import get_wsgi_application

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

application = get_wsgi_application()
also if I try to run I get a long output of errors, this is a sample

File "", line 16, in <module>
    application = get_wsgi_application()
  File   "/Users/david/Documents/projects/django/codego/venv/lib/ python3.5/site-packages/django/core/", line 13, in    get_wsgi_application

return _bootstrap._gcd_import(name[level:], package,   level)
  File "<frozen importlib._bootstrap>", line 986, in  _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in    _find_and_load

ImportError: No module named 'codego'
what am I doing wrong here?


Have you seen this

Quote: /Users/david/Documents/projects/django/codego/codego/codego/
Why is it nested so deeply within itself? Wouldn't that mean you'd need to do something like "from codego.codego import codego"?
hello and sorry for the lack of response here, I setup using nginx on Digital Ocean in the end, thanks for the responses though

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  flask to uwsgi threading issue batchenr 1 624 Jun-17-2019, 02:12 PM
Last Post: batchenr
  location settings for Django Uwsgi Nginx Configuration for production sandyman 0 1,131 Sep-15-2017, 09:08 AM
Last Post: sandyman
  Django+uWsgi unable to find "application" callable rosettas 3 4,318 Aug-24-2017, 01:41 PM
Last Post: nilamo

Forum Jump:

Users browsing this thread: 1 Guest(s)