2018-10-18T09:30:24.77... ">

Issue with whitenoise


When accessing the app link, the server crushes!

Excerpt from heroku logs:

2018-10-18T09:30:24.772373+00:00 app[web.1]: ModuleNotFoundError: No module named 'whitenoise.middleware.WhiteNoiseMiddlewaredjango'; 'whitenoise.middleware' is not a package

 

I verified again in my settings.py (my local file, github file and heroku file) and all of them are containing the same line of code:

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'whitenoise.middleware.WhiteNoiseMiddleware'
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

 

I even tried to reinstall o heroku (again) whitenoise, but it was already installed:

> heroku run pip install whitenoise
Running pip install whitenoise on ⬢ whispering-anchorage-54563... up, run.5357 (Free)
Requirement already satisfied: whitenoise in ./.heroku/python/lib/python3.6/site-packages
You are using pip version 9.0.2, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

 

I am stuck. Can you please help?

 

Category: Django
Tutorial: Upload Django Project To Heroku
Asked at Oct. 18, 2018, 9:50 a.m. by spricope

2 Answers


Actually the error message from heroku is the following one:

2018-10-18T10:01:11.940759+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=whispering-anchorage-54563.herokuapp.com request_id=58d51ce7-0c8d-49b1-8fe5-1324102dbaae fwd="*.*.*.*" dyno= connect= service= status=503 bytes= protocol=https

 

where *.*.*.* is my ip.

Any idea?

 

 

Answered on: Oct. 18, 2018, 10:07 a.m.
Answered by: spricope

Sorry for bothering you all!

It was my mistake: a missing comma at the end of the green text (above)

Everything is working fine (the app is up and running on heroku) and I can't wait to go further with this tutorial.  laugh

Answered on: Oct. 18, 2018, 11:43 a.m.
Answered by: spricope