Make sync_templates command more flexible
The changes were made to:
- Use regular expression instead of globbing for sync_template command which enables syncing a couple of specific templates, e.g.
django-admin sync_templates --only="(all-fields|car-hunt)"
and support previous behavior like matching multiple templates with e.g. a common prefixdjango-admin sync_templates --only="^job.*"
It is also not necessary to use the ".json" at the end to match the proper template files.
-
Adds
BASEROW_SYNC_TEMPLATES_PATTERN
env var that is automatically picked up on startup and syncs only the templates defined as a pattern here. -
Running
django-admin sync_templates
without any parameter will sync all templates as before. However if needed, it is possible to invokedjango-admin sync_templates --from-env
to sync templates defined in the env var in case folks don't sync templates on startup or want to rerun the sync.
Edited by Petr Stribny