coderedcms icon indicating copy to clipboard operation
coderedcms copied to clipboard

What files can/should I edit? only the templates directory?

Open jus3q opened this issue 2 years ago • 1 comments

I have added files to the templates directory from the coderedcms source and made a few tweaks to the html. This works fine

I tried to make a few further changes to files not within the templates directory and when I run the project I don't see any changes. I'm a bit confused how my installation pulls from the github source. In the templates directory it seems I can overwrite one of these files -however outside this directory no changes I make seem to take. For example I downloaded the forms.py file and changed some of the wording (text), but when I run my project these changes are not there.

I'm guessing at the permissions and settings here, but I assume I should only edit files in the templates folder? Does something block me from overwriting files in coderedcms directory?

jus3q avatar Aug 12 '22 16:08 jus3q

The template overriding behavior is a feature of Django. Any template which shares the same relative name/path in a Django app will override any other templates with the same name/path from other Django apps.

This behavior is exclusive to Django templates only. I'd recommend reading up on it: https://docs.djangoproject.com/en/4.0/howto/overriding-templates/

If you're wanting to override features of Python classes (e.g. forms), you can use standard Python inheritance techniques. I'd recommend starting here to learn how to do that: https://realpython.com/inheritance-composition-python/

vsalvino avatar Aug 12 '22 17:08 vsalvino

Closing due to inactivity. Please re-open if you discover any issues.

vsalvino avatar Oct 26 '22 18:10 vsalvino