title: Django admin detail page not loading with UUID as primary key
body: <p>After migrating ids in my Django app from int (default) to UUID4 the admin detail pages are not loading anymore. List views work correctly, also rendering the correct links for the objects:</p>
  <p><a href="https://i.stack.imgur.com/BnJuX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BnJuX.png" alt="enter image description here" /></a></p>
  <p>Link renders as</p>
  <pre><code>http://localhost:8000/admin/images/image/27ce8dbc-eb3f-443d-bf04-f612093cdc46/change/
  </code></pre>
  <p>But clicking on the UUID to open the details (or pasting it into a new tab) leads to infinite loading.</p>
  <p>Happens for all admins with UUID, the ones with the conventional id work.</p>
  <p>Models looks like this:</p>
  <pre class="lang-py prettyprint-override"><code>class Image(models.Model):
      &quot;&quot;&quot;Uploaded images.&quot;&quot;&quot;
      id = models.UUIDField(primary_key=True, default=uuid4)
      # more fields...
  </code></pre>
  <p>Nothing else besides id › uuid4 changed...</p>
  <p>Tested in Google Chrome with Django <code>v4.0.7</code> as well as <code>v4.1.1</code>.</p>
  <p>No logs, neither in the browser console nor the Django dev server, just a loading spinner in the browser tab.</p>
  <p>Here's the Django logging config:</p>
  <pre class="lang-py prettyprint-override"><code>LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'filters': {
          'require_debug_false': {
              '()': 'django.utils.log.RequireDebugFalse',
          },
          'require_debug_true': {
              '()': 'django.utils.log.RequireDebugTrue',
          },
          'require_testing_false': {
              '()': RequireTestingFalse,
          },
      },
      'handlers': {
          'console': {
              'level': 'INFO',
              'filters': ['require_debug_true'],
              'class': 'logging.StreamHandler',
          },
          'file': {
              'level': 'ERROR',
              'filters': ['require_debug_false', 'require_testing_false'],
              'class': 'logging.FileHandler',
              'filename': os.path.join(BASE_DIR, 'logs/django.log'),
          },
          'mail_admins': {
              'level': 'ERROR',
              'filters': ['require_debug_false', 'require_testing_false'],
              'class': 'django.utils.log.AdminEmailHandler',
          },
      },
      'loggers': {
          'django': {
              'handlers': [
                  'console',
              ],
          },
          'django.request': {
              'handlers': [
                  'file',
                  'mail_admins',
              ],
              'level': 'ERROR',
              'propagate': False,
          },
          'django.security': {
              'handlers': [
                  'file',
                  'mail_admins',
              ],
              'level': 'ERROR',
              'propagate': False,
          },
          'py.warnings': {
              'handlers': ['console'],
          },
      },
  }
  </code></pre>