Hi,
I am having issues with django installed on a server reversed proxied to the main website. Most of the sites work just fine except a very small detail in the admin site, change form page.
Django is running on server A, served at / on port 12345. Server B which is the main web server and has a domain
www.example.com, and serves content (reverse proxies) from server A under /app/myapp.
Everything is fine except when I try to modify a foreign key value from the model that it is referenced. You know, if I modify fields of model A in the django admin site, I can click on these buttons to change a foreign key model B.
<a class="related-widget-wrapper-link change-related" id="change_id_modelb" data-href-template="/admin/main/modelb/__fk__/change/?_to_field=id&_popup=1" title="Change selected modelb">
which is parsed by static/admin/js/admin/RelatedObjectLookups.js, which adds a "real" href attribute via JS, giving
<a class="related-widget-wrapper-link change-related" id="change_id_system" data-href-template="/admin/main/modelb/__fk__/change/?_to_field=id&_popup=1" title="Change selected modelb" href="/admin/main/modelb/1/change/?_to_field=id&_popup=1"><img src="/app/myapp/static/admin/img/icon-changelink.svg" alt="Change"></a>
The reverse proxy program, however, only translates whatever is in the HTML <a href="" />, and does nothing about this customized data field.
This is not necessarily a bug, as it only happens in special cases like mine. I am not sure what to do -- I can modify this RelatedObjectLookups.js and just add '/app/myapp' in front of every link it produces, which should work and fix this problem at this point. However, a more complete solution would be to overhaul this lookup js and put a real link there, which is quite some work to do. Should I write a new ticket to Django Project, or do you have better suggestions?
Thank you