Skip to content

feat: custom /favicon.ico#1190

Open
wesleyboar wants to merge 2 commits into
mainfrom
feat/favicon-proxy-view
Open

feat: custom /favicon.ico#1190
wesleyboar wants to merge 2 commits into
mainfrom
feat/favicon-proxy-view

Conversation

@wesleyboar

@wesleyboar wesleyboar commented Jun 24, 2026

Copy link
Copy Markdown
Member

Overview

Adds a Django view that serves /favicon.ico directly from Django.

Why?

PDF renderers fetch /favicon.ico from origin and won't follow a <link> tag pointing to a CDN URL, so this view is needed to serve the correct favicon to those clients.

PORTAL_FAVICON["is_remote"] result
True view proxies CDN URL
False view serves file via staticfiles.finders*

Responses are cached for 24 hours.

Related

Changes

  • added taccsite_cms/views.py with favicon proxy view
  • updated taccsite_cms/urls.py to register ^favicon\.ico$ route

Testing

  1. make start
  2. In settings_local.py, set
    PORTAL_FAVICON = {
        "is_remote": True,
        "img_file_src": "https://cdn.jsdelivr.net/gh/TACC/Core-CMS-Custom@ec5bc70/3dem_assets/favicon.ico"
    }
  3. curl -si http://localhost:8000/favicon.ico.
  4. Verify 200 image/x-icon with the remote favicon.
  5. Change setting value to
    PORTAL_FAVICON = {
        "is_remote": False,
        "img_file_src": "site_cms/img/favicons/favicon.ico"
    }
  6. curl -si http://localhost:8000/favicon.ico
  7. Verify 200 image/x-icon with the local static file.

UI

GH.1190.mov

Adds a Django view that serves /favicon.ico from either a remote CDN
URL or a local static file, based on PORTAL_FAVICON["is_remote"].

- PDF renderers fetch /favicon.ico from origin and ignore <link> tags
- Caches response for 24 hours via @cache_page
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@wesleyboar wesleyboar changed the title feat(favicon): add /favicon.ico proxy view feat(favicon): custom /favicon.ico Jun 24, 2026
@wesleyboar wesleyboar changed the title feat(favicon): custom /favicon.ico feat: custom /favicon.ico Jun 24, 2026
wesleyboar added a commit to TACC/Camino that referenced this pull request Jul 1, 2026
Lets /favicon.ico fall through to Django so the new CMS proxy view
can serve it. Required by TACC/Core-CMS#1190.
rstijerina pushed a commit to TACC/Camino that referenced this pull request Jul 2, 2026
Lets /favicon.ico fall through to Django so the new CMS proxy view
can serve it. Required by TACC/Core-CMS#1190.
wesleyboar added a commit to TACC/Camino that referenced this pull request Jul 2, 2026
Lets /favicon.ico fall through to Django so the new CMS proxy view
can serve it. Required by TACC/Core-CMS#1190.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant