2014-12-09 15 views
6

sto cercando di spingere il mio progetto in Heroku e sto seguendo queste istruzioni:ImportError: No module named errore my_project.wsgi con caposquadra iniziare

https://devcenter.heroku.com/articles/getting-started-with-django

Attualmente sto bloccato da parte del dice foreman start

ottengo questo errore: -> errore completo http://dpaste.com/3Y213Y2

(boothie.0.1)MTVL1289dd026:HerokuBoothie bli1$ foreman start 
14:59:05 web.1 | started with pid 58353 
14:59:05 web.1 | [2014-12-09 14:59:05 -0800] [58353] [INFO] Starting gunicorn 19.1.1 
14:59:05 web.1 | [2014-12-09 14:59:05 -0800] [58353] [INFO] Listening at: http://0.0.0.0:5000 (58353) 
14:59:05 web.1 | [2014-12-09 14:59:05 -0800] [58353] [INFO] Using worker: sync 
14:59:05 web.1 | [2014-12-09 14:59:05 -0800] [58356] [INFO] Booting worker with pid: 58356 
14:59:05 web.1 | [2014-12-09 14:59:05 -0800] [58356] [ERROR] Exception in worker process: 
14:59:05 web.1 | Traceback (most recent call last): 
14:59:05 web.1 | File "/Users/bli1/Development/Django/HerokuBoothie/boothie.0.1/lib/python2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker 
14:59:05 web.1 |  worker.init_process() 
14:59:05 web.1 | File "/Users/bli1/Development/Django/HerokuBoothie/boothie.0.1/lib/python2.7/site-packages/gunicorn/workers/base.py", line 114, in init_process 
14:59:05 web.1 |  self.wsgi = self.app.wsgi() 
14:59:05 web.1 | File "/Users/bli1/Development/Django/HerokuBoothie/boothie.0.1/lib/python2.7/site-packages/gunicorn/app/base.py", line 66, in wsgi 
14:59:05 web.1 |  self.callable = self.load() 
14:59:05 web.1 | File "/Users/bli1/Development/Django/HerokuBoothie/boothie.0.1/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load 
14:59:05 web.1 |  return self.load_wsgiapp() 
14:59:05 web.1 | File "/Users/bli1/Development/Django/HerokuBoothie/boothie.0.1/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp 
14:59:05 web.1 |  return util.import_app(self.app_uri) 
14:59:05 web.1 | File "/Users/bli1/Development/Django/HerokuBoothie/boothie.0.1/lib/python2.7/site-packages/gunicorn/util.py", line 356, in import_app 
14:59:05 web.1 |  __import__(module) 
14:59:05 web.1 | ImportError: No module named HerokuBoothie.wsgi 

Ecco una foto di la mia struttura del progetto. Il progetto si trova all'interno di una directory denominata HerokuBoothie. enter image description here

Profilo:

web: gunicorn HerokuBoothie.wsgi --log-file -

risposta

2

Penso che sia causato dal vostro struttura del progetto; se seguite il tutorial Heroku sul punto avete errore (foreman start parte), la struttura delle directory sarebbe simile a questa:

hellodjango/ 
    manage.py 
    Procfile 
    hellodjango/ 
     __init__.py 
     settings.py 
     urls.py 
     wsgi.py 
    venv/ 
     bin/ 
     include/ 
     lib/ 

Si può vedere la struttura di quello che hai è un po 'diverso, c'è un ulteriore HerokuBoothie directory in la tua struttura. Penso che ristrutturare il tuo progetto (qualcosa come mv ~/Development/Django/HerokuBoothie/HerokuBoothie/* ~/Development/Django/HerokuBoothie e rimuovere la directory vuota HerokuBoothie) risolverebbe questo problema, ma potresti dover cambiare alcuni codici se utilizzi percorsi assoluti nei tuoi codici.

2

è necessario impostare la pythonpath come modulo HerokuBoothie si trova in un'altra cartella:

web: gunicorn HerokuBoothie.wsgi --pythonpath ../HerokuBoothie --log-file - 
Problemi correlati