netdevopsbr / netbox-proxbox

Netbox Plugin for integration between Proxmox and Netbox
Apache License 2.0
341 stars 50 forks source link

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

Closed quiknick closed 2 years ago

quiknick commented 2 years ago

<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 commented 2 years ago

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


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**
quiknick commented 2 years ago

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