title: What is going wrong with my wsgi setup?
body: <p>I'm trying to setup uwsgi (and nginx eventually), but right now am stuck on uwsgi. I'm getting the following error when I try to run the server normally: </p>
  
  <pre><code>could not connect to server: Connection refused
      Is the server running on host "localhost" (::1) and accepting
      TCP/IP connections on port 5432?
  could not connect to server: Connection refused
      Is the server running on host "localhost" (127.0.0.1) and accepting
      TCP/IP connections on port 5432?
  </code></pre>
  
  <p>And this is the output from running command uwsgi --http :8000 --module Hellfish.wsgi:</p>
  
  <pre><code>*** Starting uWSGI 2.0.17 (64bit) on [Tue Jul  3 18:34:40 2018] ***
  compiled with version: 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2) on 03 July 2018 20:44:01
  os: Darwin-16.7.0 Darwin Kernel Version 16.7.0: Fri Apr 27 17:59:46 PDT 2018; root:xnu-3789.73.13~1/RELEASE_X86_64
  nodename: Whodinis-MacBook-Pro.local
  machine: x86_64
  clock source: unix
  detected number of CPU cores: 4
  current working directory: /Users/whodini/Desktop/who/Web/Hellfish
  detected binary path: /Users/whodini/Desktop/who/Web/Hellfish/env/bin/uwsgi
  !!! no internal routing support, rebuild with pcre support !!!
  *** WARNING: you are running uWSGI without its master process manager ***
  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 http bound on :8000 fd 5
  spawned uWSGI http 1 (pid: 70999)
  uwsgi socket 0 bound to TCP address 127.0.0.1:59020 (port auto-assigned) fd 4
  Python version: 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)  [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
  *** Python threads support is disabled. You can enable it with --enable-threads ***
  Python main interpreter initialized at 0x7fd92082c800
  your server socket listen backlog is limited to 100 connections
  your mercy for graceful operations on workers is 60 seconds
  mapped 72888 bytes (71 KB) for 1 cores
  *** Operational MODE: single process ***
  base dir path
  Traceback (most recent call last):
    File "./Hellfish/wsgi.py", line 16, in &lt;module&gt;
      application = get_wsgi_application()
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
      django.setup(set_prefix=False)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
      apps.populate(settings.INSTALLED_APPS)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/apps/registry.py", line 85, in populate
      app_config = AppConfig.create(entry)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/apps/config.py", line 94, in create
      module = import_module(entry)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
  ModuleNotFoundError: No module named 'django_countries'
  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 worker 1 (and the only) (pid: 70998, cores: 1)
  </code></pre>
  
  <p>Not sure why it can't import module Django_countries. I'm kind of operating blind here because this is the first time I've done this and having trouble following docs and tutorials. I've tried to kill the port and restart it but came up with this issue again. Also not sure if my .ini file is in the right place or if its configured correctly. I put it in the same directory as my Hellfish.wsgi file. Hellfish is the name of my project. Finally, here is the contents of my .ini file:</p>
  
  <pre><code>[uwsgi]
  
  socket = 127.0.0.1:8000
  
  chdir = /Users/whodini/Desktop/who/Web/Hellfish/
  home = /Users/whodini/Desktop/who/Web/Hellfish/env
  module = Hellfish.wsgi:application
  wsgi-file = Hellfish/wsgi.py
  master = true
  pidfile=/tmp/project-master.pid
  vacuum=True
  max-requests=5000
  
  processes = 4
  threads = 2
  stats = 127.0.0.1:8000
  </code></pre>
  
  <p>Some help here would be much appreciated.</p>