Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

footer.html error django.template.exceptions.TemplateDoesNotExist #45

Closed
quiknick opened this issue May 9, 2022 · 2 comments
Closed
Assignees
Labels
accepted This issue has been accepted for implementation question Further information is requested

Comments

@quiknick
Copy link

quiknick commented May 9, 2022

<class 'django.template.exceptions.TemplateDoesNotExist'>

footer.html

Python version: 3.8.10
NetBox version: 3.2.0
Netbox-proxbox 0.0.4

If I comment out footer.html on the following files in netbox_proxbox/templates/netbox_proxbox/ everything works fine.
proxmox_vm_full_update.html
proxmox_vm_list.html
home.html

@emersonfelipesp
Copy link
Member

You must follow the following section of Installation Guide available here:


1.3.2. Change Netbox 'settings.py' to include Proxbox Template directory

Probably on the next release of Netbox, it will not be necessary to make the configuration below! As the Pull Request #8733 got merged to develop branch

Edit /opt/netbox/netbox/netbox and find TEMPLATE_DIR section

  • How it is configured (Netbox >= v3.2.0):
TEMPLATES_DIR = BASE_DIR + '/templates'
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [TEMPLATES_DIR],
        'APP_DIRS': True,
        'OPTIONS': {
            'builtins': [
                'utilities.templatetags.builtins.filters',
                'utilities.templatetags.builtins.tags',
            ],
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.template.context_processors.media',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'netbox.context_processors.settings_and_registry',
            ],
        },
    },
]

  • How it is must be:
TEMPLATES_DIR = BASE_DIR + '/templates'

# PROXBOX CUSTOM TEMPLATE
PROXBOX_TEMPLATE_DIR = BASE_DIR + '/netbox-proxbox/netbox_proxbox/templates/netbox_proxbox'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [TEMPLATES_DIR, PROXBOX_TEMPLATE_DIR],
        'APP_DIRS': True,
        'OPTIONS': {
            'builtins': [
                'utilities.templatetags.builtins.filters',
                'utilities.templatetags.builtins.tags',
            ],
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.template.context_processors.media',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'netbox.context_processors.settings_and_registry',
            ],
        },
    },
]

I did it because I had to change the base/layout.html from Netbox, since there is no Jinja2 block to fill with custom information into the footer HTML tag

@emersonfelipesp emersonfelipesp self-assigned this May 9, 2022
@emersonfelipesp emersonfelipesp added question Further information is requested accepted This issue has been accepted for implementation labels May 9, 2022
@quiknick
Copy link
Author

quiknick commented May 9, 2022

Muito obrigado! I was missing the 'DIRS': [TEMPLATES_DIR, PROXBOX_TEMPLATE_DIR],

@quiknick quiknick closed this as completed May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This issue has been accepted for implementation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants