When i deploy project in dev mode i can access admin site(127.0.0.0:8000/admin), but when I deploy project in production mode I can't access admin site(docker-machine-ip/admin).
Note: other function still work fine,.env setting: DJANGO_ADMIN_URL=admin
Any idea to enable admin site on production mode.
You could try linking to your admin in a template and see what url you get.
{% if request.user.is_superuser %}
<a href="{% url 'admin:index' %}">Django Admin</a>
{% endif %}
Your .env file should have this line:
DJANGO_ADMIN_URL=^admin/
@jangeador : I tried: DJANGO_ADMIN_URL=^admin/ still not work.
Any errors? Can you log in to the regular site?
on browser: Server Error (500)
on terminal: nginx_1 | 116.98.26.54 - - [14/Sep/2016:03:11:23 +0000] "GET /admin/login/?next=/admin/ HTTP/1.1" 500 38 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0" "-"
That error 500 could be anything. Since you are running docker it would be really easy to see logs. Just docker-compose up on the docket-machine terminal and then look at the output. It should display the real error.
nginx_1 | 116.98.26.54 - - [14/Sep/2016:03:11:23 +0000] "GET /admin/login/?next=/admin/ HTTP/1.1" 500 38 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0" "-"
Only this show on Docker-machine terminal
I was hoping the django_1 machine would display the error. If you have your email configured you should be getting an email with the error. Please configure a real address as the admin in the config file and you should get an email with the error. One of the most common problems with this is the incorrect setting in allowed hosts. You might want to check that.
in this site: https://cookiecutter-django.readthedocs.io/en/latest/settings.html
i saw DJANGO_ADMIN_URL in Production Default is: raises error.
anyidea?
The documentation states that it raises error as a production default because it is not present and the configuration will look for it. You already define it in your .env file so it should not raise an error because it finds it there.
I'm newbie and just finish config raven to see Error message. This is my problem:

note: I access normal in develop mode only can't access in production mode. other thing work normal.
please help me!
If you have not defined DJANGO_ADMIN_URL in your .env file, then Django will crash.
Fix this and then start looking into other things. Deployment, like debugging, is a process of elimination.
@pydanny, @jangeador: Thanks for your support. That's postgres container problem. It was stop. Everything ok right now. Thanks all!
@cunhuvan Can you provide solution? I have similar problem
@Marpop where are you deploying? I had to set my admin-url in the .env file DJANGO_ADMIN_URL=hereyouradminlink/ and then specifically set it again in my Heroku settings: DJANGO_ADMIN_URL=heregoesyouradminlinkasspecifiedinyourenvfile/
Depending on where you are deploying this will differ
@Micromegass I've solve it, but can't remember how. Sorry and thanks :)
Who have a solution, I'm also getting the same error.
I can't be able to login into the admin after creating superuser.
@johnpaul89 Do you have https configured?
No but Thank You.
I have figured out where the problem was.
No but Thank You.
I have figured out where the problem was.
how did you fix it? Thank you in advance.
No but Thank You.
I have figured out where the problem was.
How did you fix it ?
No but Thank You.
I have figured out where the problem was.how did you fix it? Thank you in advance.
Did you find the solution?
Yes. But i forgot it. :)
Và o 0:04, Th 3, 16 thg 6, 2020 Kaushik Kakdey notifications@github.com đã
viết:
No but Thank You.
I have figured out where the problem was.how did you fix it? Thank you in advance.
Did you find the solution?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/pydanny/cookiecutter-django/issues/790#issuecomment-644256348,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACYPYUMC3Y47L47I6HQZD5DRWZIC7ANCNFSM4CPNUMVA
.
Most helpful comment
how did you fix it? Thank you in advance.