Reputation: 5855
I have just copied a working Django project from a development server to a production server. I have not touched the code in any way. In the admin interface there is a blog app, in each blog post there is a get_absolute_url so the admin creates the "view on site" button. On the development server when I click this button it opens the post on the site as expected: an example link would be /admin/r/25/515/ which when loaded then redirects to /blog_app/posts/515/slug. That's perfect. On the production server though the "view on site" link has the exact same value of /admin/r/25/515/ but when loaded returns a strange url that leads to nowhere: admin/r/25/515/.com/blog_app/posts/515/slug. I have no idea where this ".com" comes from, I started looking everywhere but have no clue. Any idea?
Upvotes: 1
Views: 928
Reputation: 5855
That was an Nginx conf problem, I use it as a proxy / load balancer and in the proxy_pass setting I did not enter the full domain name thinking it was a kind of variable. My bad. Not really Django related but since many people use it that way it can be useful to know.
Upvotes: 1