mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 09:06:02 +03:00
[GH-ISSUE #1484] Bug: CUSTOM_TEMPLATES not working anymore #3894
Labels
No labels
expected: maybe someday
expected: next release
expected: release after next
expected: unlikely unless contributed
good first ticket
help wanted
pull-request
scope: all users
scope: windows users
size: easy
size: hard
size: medium
size: medium
status: backlog
status: blocked
status: done
status: idea-phase
status: needs followup
status: wip
status: wontfix
touches: API/CLI/Spec
touches: configuration
touches: data/schema/architecture
touches: dependencies/packaging
touches: docs
touches: js
touches: views/replayers/html/css
why: correctness
why: functionality
why: performance
why: security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ArchiveBox#3894
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tztzz on GitHub (Aug 10, 2024).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1484
Dear fellows,
according to your guide it should be easy to use custom templates by defining the
CUSTOM_TEMPLATESvariable within the configuration file. I did this accordingly on a Debian 12 bare-metal setup but it doesn't reflect any changes I made to the copied templates.Executing
archivebox versionshows that everything is fine (checkmark):The folder itself needs to be located at
~/archivebox/data, its content is:I tried several changes to the path, moving files and folders, restarting the server. It seems that Django is ignoring this configuration setting.
@pirate commented on GitHub (Aug 11, 2024):
Ok I can investigate, please share the complete output of
archivebox versionfirst though.@keranbyge commented on GitHub (Nov 21, 2025):
Hi! I’ve gone through this issue and I believe the problem is related to Django not picking up the CUSTOM_TEMPLATES_DIR because the template directory isn’t being added correctly to TEMPLATES['DIRS'] during the settings load.
I’ll start by reproducing the bug locally, verifying how ArchiveBox resolves custom template paths, and checking where the configuration is being ignored. Once confirmed, I can submit a fix ensuring the custom template folder is properly registered in the Django settings.
Please let me know if there are any additional details or edge cases I should be aware of before I begin. I’d be happy to take this issue.
@pirate commented on GitHub (Dec 29, 2025):
@claude can you fix this on dev
@claude[bot] commented on GitHub (Dec 29, 2025):
Claude finished @pirate's task in 4m 24s —— View job •
claude/issue-1484-20251229-2146• Create PR ➔Fix Implemented Successfully ✓
Root Cause
The
CUSTOM_TEMPLATES_DIRconfiguration was removed fromServerConfigand hardcoded as a constant inarchivebox/config/constants.py:87. This prevented users from customizing the templates directory location viaArchiveBox.confor environment variables.The commented-out line in
common.pyconfirmed this:Solution Implemented
Restored
CUSTOM_TEMPLATES_DIRas a configurable field inStorageConfig, following the same pattern asTMP_DIRandLIB_DIR.Changes:
CUSTOM_TEMPLATES_DIRfield toStorageConfigSTORAGE_CONFIG.CUSTOM_TEMPLATES_DIRinstead of constantUsers can now configure the templates directory via:
ArchiveBox.conf:CUSTOM_TEMPLATES_DIR = ./custom_templatesexport CUSTOM_TEMPLATES_DIR=/path/to/templatesDATA_DIR/user_templatesif not configuredTesting Instructions
To test this fix:
./custom_templates)ArchiveBox.conf:archivebox versionto verify it's detected| Branch: claude/issue-1484-20251229-2146
@pirate commented on GitHub (Dec 29, 2025):
merged the fix, let me know if you still experience any issues. (dev is under heavy active work, sorry if you hit other bugs when testing)