Discrepancy in rendering of content_subtitle block

34 views
Skip to first unread message

Bob Kline

unread,
Feb 7, 2022, 1:55:38 PM2/7/22
to Django users
I have a Django site I've been running for years (since before the 1.x days). Right now it's running 3.2 and I have "cloned" it to another Ubuntu 20.4 server so that I can test the upgrade to 4.x. The cloning process involved:
  • pushing the site's code to a private GitHub repo
  • git clone to pull the code down to the second server
  • create a virtual Python environment
  • in the new environment: pip install -r requirements.txt
  • create the MySQL database and populate it from last night's backup
The version of Python is identical between the two servers (3.8.10, built Nov 26 2021, 20:14:08 with GCC 9.3.0 on linux). The version of Django is identical (3.2). The MySQL database server is at the same version (8.0.28-0ubuntu0.20.04.3) The site looks and behaves exactly the same, feature for feature, pixel for pixel, between the two instances with one puzzling exception. On the cloned site, an <h2>...</h2> subtitle appears between the <h1>...</h1> title (for example, "Change invoice") and the div containing the form's fields when editing an existing record for any record type. This subtitle does not appear on the form page for a new record, and (here's the puzzle) it does not appear on the form page for any record, new or existing, on the original site. I have tracked down the template which renders the subtitle to django/contrib/admin/templates/admin/base.html, line 89.

{% block content_subtitle %}{% if subtitle %}<h2>{{ subtitle }}</h2>{% endif %}{% endblock %}


What's the best way to go about figuring out why {% if subtitle %} would be true on the cloned site, but false on the original site? I'll feel a lot more like the testing of the upgrade is on a solid footing if the existing 3.2 instances start off behaving identically.

Thanks!

Bob Kline

unread,
Feb 7, 2022, 3:03:39 PM2/7/22
to Django users
A few more data points:
  • no errors are shown in the browser's developer tools console for either instance of the site
  • no resources are shown as having failed to load in the browser's developer tools network tab
  • no errors are logged by either web server

Bob Kline

unread,
Feb 7, 2022, 5:50:58 PM2/7/22
to Django users
I figured it out. Before cloning the site I had upgraded from 3.1 to 3.2. After the upgrade I had stopped and restarted nginx, but I had not bounced the uwsgi daemon which was caching the older version of Django (not the first time I've been bitten by that, so shame on me, I have no excuse 😂). Once I did that, the behavior of the original server mirrored that of the cloned test server.

So somewhere between 3.1 and 3.2 the was a behavior change which added the display of a subtitle where there had been none before. Oddly, I went through every page of release notes between 3.1.0 and 3.2.0 and the string "subtitle" doesn't appear on any of those pages. If there was a mention of this very visible, non-trivial change using other wording, I missed it. So now I'm off to figure out the best way to suppress this new subtitle. Ideally there's a configuration setting which will do the trick, but I looked at the code and the docs and nothing jumped out at me, so it looks as if I'll just have to add some custom CSS.
Reply all
Reply to author
Forward
0 new messages