This is the repository for this blog post.
I made a simple app to have multiple google login form with Allauth.
This description assumes the use of docker and windows11.
And I use pycharm for my IDE.
- Enter following command from the command line.
git clone https://github.com/DevWoody856/multi_allauth
-
After downloading the repo, create an
.env
file in the root of the project. -
In the .env file you created, write the following.
DEBUG_VALUE=TRUE
SECRET_KEY=*****************************************************
DB_NAME=postgres
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=db_twologin_8_220530
DB_PORT=5432
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
Regarding the SECRET_KEY
, I recommend that you create a dummy key at a place like this site and put it in the .env
file.
As a reminder, DB_HOST
is the service name of the database in docker-compose.yaml
.
In this docker configuration, DB_HOST is db_twologin_8_220530
.
- From the project root, enter the following command.
docker-compose up --build
- If you success
docker-compose up -build
,
you can see the message "starting development server at http://0.0.0.0:8022/".
Once it is up and running, please open another terminal while docker running, enter the following command. (Be sure to go to the root directory of the project before entering this command) This is the command that enters the dokcer side and launches the command line.
docker-compose exec backend sh
- When you are ready to enter a command, type the following command.
python manage.py makemigrations
- Then, after that
python manage.py migrate
- Database set is finished. Enter the following command and the application should start.
python manage.py runserver
- If you get the following message, it is working.
Starting development server at http://127.0.0.1:8000/
- Also, in order for this app to work, you must Oauth2.0 credential from GCP (Google cloud platform) and must be entered into django-admin.
Please refer to chapters 8 and 9 of this article.