I set up docker-compose
to server django
v5.0.6 and I see login page but after signin I face with CSRF
error.
my docker-compose
containers:
- Nginx
- web (django container)
- postgres
all the configs are correct and I can call APIs and see login page of admin area.
nginx.conf
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://web:8000;
}
location /static {
autoindex on;
alias /static;
}
}
.env
...
DJANGO_ALLOWED_HOSTS=example.com,web
CSRF_TRUSTED_ORIGINS=["example.com"]
ALLOWED_HOSTS=['example.com']
...
how can I fix it?
I try to setup based on the configs but I gave 403 error only for admin area. all APIs works fine.