djangodjango-admin

Extra "[]" characters appearing before login fields for django admin


On my Django admin login page I see extra "[]" before the username and password fields:

screenshot of the extra brackets

and I really cannot figure out where they are coming from.

I'm using Django v5.1.3 and I haven't made any extra customisations to the django admin, so it should only be loading the default CSS and JS that the admin site natively comes with.

It happens on both Brave and Firefox browsers.

I'd really like to get rid of these, but have no idea where to start... let me know if any extra code/settings would be helpful to figure out.

Any help much appreciated.

Edit 1: You can see this 'in action' here: https://veghab.alexlittle.net/admin/login/?next=/admin/


Solution

  • Based on the square brackets bug thread [Django-forum], it appears to be a bug in CPython for Python-3.12 (see issue #117482 of CPython [GitHub]).

    You thus can downgrade to , wait for the bug to be fixed by CPython, or use a different WSGI server [Django-doc], since mod_wsgi is the part that introduces the square brackets.