我正在尝试将我的django项目部署到Heroku。但是,在推送到Heroku之后,我看到了“内部服务器错误”,但在本地它可以正常工作。
heroku日志:
ImportError: No module named app.wsgi
--- no python application found, check your startup logs for errors ---
unable to load app 0 (mountpoint='') (callable not found or import error)
--- no python application found, check your startup logs for errors ---
heroku[router]: at=info method=GET path="/" host=myapp.herokuapp.com request_id=645f6570-112d-46d9-9578-1b4e90c4b7d9 fwd="5.144.57.6" dyno=web.1 connect=1ms service=2ms status=500 bytes=104
我的 uwsgi 配置如下所示:
[uwsgi]
print = Hello I'm the uWSGI config for %c project!
;uid = user
;gid = staff
;chmod-socket = 664
;chown-socket = user:staff
auto-procname
protocol = uwsgi
procname-prefix-spaced = [uWSGI %c]
socket = %d%c.sock
http-socket = :$(PORT)
master
processes = %k
autoload
no-orphans
die-on-term
memory-report
disable-logging
ignore-write-errors
ignore-sigpipe
enable-threads
single-interpreter
lazy-apps
vacuum
harakiri = 60
harakiri-verbose
reload-mercy = %k
worker-reload-mercy = %k
max-requests = 5000
buffer-size = 65535
post-buffering = 1048576
reload-on-rss = 300
touch-reload = %p
;for-readline = .env
; env = %(_)
;end-for
pp = %d
module = %c.wsgi
;[stats]
;stats = %d%c.stats.sock
;stats = :1717
; serving static files via uwsgi
static-map2 = /assets=%dpublic
static-map2 = /uploads=%dpublic
;[cache]
cache = 1000
cache-blocksize = 65536
;[prdoduction]
if-env = DEV=False
print = Loaded production settings!
disable-logging
ignore-write-errors
ignore-sigpipe
endif
;[development]
if-env = DEV=True
print = Loaded development settings!
venv = /Users/user/.virtualenvs/%c
;logto = %dlogs/%c.uwsgi.log
py-autoreload = 2
endif