Есть проект python/django. Ничего серьезного не представляет, просто подобие блога. Хочу развернуть на Heroku. Вроде всё, что нужно создал, залил. Log о развертывании говорит, что всё замечательно и можно проверить результат. Перехожу на ссылку, а там "An error occurred in the application and your page could not be served. Please try again in a few moments.". Не могу понять, что не так.
Build log:
-----> Python app detected
-----> Installing runtime (python-2.7.10)
-----> Installing dependencies with pip
Collecting click==5.1 (from -r requirements.txt (line 1))
Downloading click-5.1-py2.py3-none-any.whl (65kB)
Collecting Django==1.8.6 (from -r requirements.txt (line 2))
Downloading Django-1.8.6-py2.py3-none-any.whl (6.2MB)
Collecting first==2.0.1 (from -r requirements.txt (line 3))
Downloading first-2.0.1-py2.py3-none-any.whl
Collecting pip-tools==1.1.6 (from -r requirements.txt (line 4))
Downloading pip_tools-1.1.6-py2.py3-none-any.whl
Collecting six==1.10.0 (from -r requirements.txt (line 5))
Downloading six-1.10.0-py2.py3-none-any.whl
Collecting virtualenv==13.1.2 (from -r requirements.txt (line 6))
Downloading virtualenv-13.1.2-py2.py3-none-any.whl (1.7MB)
Collecting wheel==0.26.0 (from -r requirements.txt (line 7))
Downloading wheel-0.26.0-py2.py3-none-any.whl (63kB)
Installing collected packages: click, Django, first, six, pip-tools, virtualenv, wheel
Successfully installed Django-1.8.6 click-5.1 first-2.0.1 pip-tools-1.1.6 six-1.10.0 virtualenv-13.1.2 wheel-0.26.0
-----> Preparing static assets
Collectstatic configuration error. To debug, run:
$ heroku run python manage.py collectstatic --noinput
-----> Discovering process types
Procfile declares types -> (none)
-----> Compressing... done, 41.9MB
-----> Launching... done, v4
https://shielded-ravine-6460.herokuapp.com/ deployed to Heroku
Логи по heroku logs
Много чего повторяется. Вот то, что повторяется:
2015-11-18T19:34:57.472520+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/fav
icon.ico" host=shielded-ravine-6460.herokuapp.com request_id=6fcbc5ae-e902- 485d-8983-b8de043d0023 fwd="184.95.52.196" dy
no= connect= service= status=503 bytes=
Логи по heroku run python manage.py collectstatic --noinput
Running python manage.py collectstatic --noinput on shielded-ravine-6460... up, run.1370
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_c
ommand_line
utility.execute()
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 190, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 41, in load_command_cl
ass return module.Command()
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py"
, line 32, in __init__self.storage.path('')
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/storage.py", line 48, in path
raise ImproperlyConfigured("You're using the staticfiles app "
django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.
Логи после редактирования settings.py:
heroku run python manage.py collectstatic --noinput
Running python manage.py collectstatic --noinput on shielded-ravine-6460... up, run.1293
0 static files copied to '/app/static', 63 unmodified.
heroku
. Для этого зайди в папку проекта и введиheroku logs
.