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

FIX: update TEMPLATES search paths to allow overriding of default templates #58

Merged
merged 1 commit into from
Aug 19, 2022

Conversation

Raruto
Copy link
Collaborator

@Raruto Raruto commented Aug 19, 2022

Through this patch it is now possible to override templates as explained here

As per [email protected], these are the variables that are in use / changed:

# https://github.com/g3w-suite/g3w-admin/blob/458c8bec11864ef29b9a14291231fb0543f11b77/g3w-admin/base/settings/base.py#L15-L16

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# https://github.com/g3w-suite/g3w-admin/blob/458c8bec11864ef29b9a14291231fb0543f11b77/g3w-admin/base/settings/base.py#L99-L123

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, '../templates')],
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'django.template.context_processors.media',
                'base.context_processors.global_settings'
            ],
            'loaders': [
                    'django.template.loaders.filesystem.Loader',
                    'django.template.loaders.app_directories.Loader'
                    #('django.template.loaders.cached.Loader', [
                    #    'django.template.loaders.filesystem.Loader',
                    #    'django.template.loaders.app_directories.Loader'
                    #]),
            ]
        },

    },
]

@wlorenzetti
Copy link
Member

@Raruto thanks the backport I think is not necessary at now.

@wlorenzetti wlorenzetti merged commit e435dcc into g3w-suite:dev Aug 19, 2022
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.

2 participants