Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django-Oscar override templatetags

I tried to override category_tags by creating a local version of catalogue application with a local templatetags folder which has a category_tags.py file (also init.py). It seems the default category_tags file is used. If I change the name of my local tag file and of course I load the new name of the tag in the template it works but I would like to override or extend the default category_tags not to create another one.

Any ideas?

thanks!

like image 847
Traian Avatar asked Nov 12 '22 04:11

Traian


1 Answers

I got it working by putting the templates in my project_folder > templates > oscar_app_name > template_name.html

So to override the "checkout" app and template, my structure looks like this:

/project
--/apps
----/checkout
------[change checkout models]
----__init__.py
----app.py

--/project
----/templates
------/checkout
--------payment_details.html

----__init__.py
----settings.py
----urls.py

--manage.py

And then you have to edit settings.py Installed Apps

INSTALLED_APPS = [
    'django.contrib.admin',
    ...
    'compressor',
    'paypal',
] + get_core_apps(['apps.checkout'])
like image 146
Nostalg.io Avatar answered Nov 15 '22 07:11

Nostalg.io