A full stack online auction site made using React,Django,Bootstrap and PostgreSQL.
- Create a folder in the /frontend and in the /backend directory named
ssl
. - In each folder place a file named
cert.pem
with the ssl certificate and a file namedkey.pem
with the ssl key.
You can create the certificates with a tool like mkcert.
Create a file in the /backend directory named secrets.json
.
The file must have the following format:
{
"SECRET_KEY": "<Django secret key>",
"DB_PASSWORD": "<Database password>",
"ADMIN_PASSWORD": "<Initial website admin password>"
}
docker-compose build
DB_PASSWORD=$(cat ./backend/secrets.json | jq -r '.DB_PASSWORD') docker-compose up
or
DB_PASSWORD=$(cat ./backend/secrets.json | python3 -c "import sys, json; print(json.load(sys.stdin)['DB_PASSWORD'])") docker-compose up
- Open terminal to backend container:
docker exec -ti backend sh
- Create initial admin user:
python manage.py createadmin
The password of the admin is on the secrets.json
file , the username of the admin is admin
(you can change it on /backend/users/management/createadmin.py
).
The credentials can be used on the admin site and on the Django management page.
Site can be accessed at https://localhost:3000/.
Admin site can be accessed at https://localhost:3000/admin.