[PYTHON] Django authentication features aren't reflected well

Introduction

In this article, I will write about how to deal with the error that occurred when incorporating the user authentication function with Django + Docker.

ModuleNotFoundError: No module named 'allauth' I was messed up by this error statement. I was giving up because I didn't know what to do, but the solution was very easy ...

First, add the following to the "Docker" file.

Dockerfile


RUN pip install django-allauth

Next, add it to "requirements.txt".

requirements.txt:requirements.txt


django-allauth>=0.32.0

Finally, type the following into the terminal.

terminal


$ docker-compose build

Finally, we will do the usual work.

terminal


$ docker-compose run --rm web python3 manage.py makemigrations

$ docker-compose run --rm web python3 manage.py migrate

$ docker-compose up

That's it.

Finally

I've spent hours with this error, and I hope it helps someone who is also stumbling.

The commands are summarized here, so I hope you find it helpful.

Django + Docker command

Recommended Posts

Django authentication features aren't reflected well
Python Django CSS reflected