Skip to content

Commit

Permalink
fix: wrong settings param
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Sep 28, 2023
1 parent d88f63a commit 81ba7e1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ CDN vs local
E' possibile recuperare i file statici (css, js, svg) da una CDN.
Nel ```settings.py``` del proprio progetto basta customizzare i seguenti parametri:

- ```DJANGO_BOOSTRAP_ITALIA_USE_CDN``` (default **False**);
- ```DJANGO_BOOSTRAP_ITALIA_CDN``` (default **https://cdn.jsdelivr.net/npm/bootstrap-italia@2.6.2/dist**);
- ```DJANGO_BOOTSTRAP_ITALIA_USE_CDN``` (default **False**);
- ```DJANGO_BOOTSTRAP_ITALIA_CDN``` (default **https://cdn.jsdelivr.net/npm/bootstrap-italia@2.6.2/dist**);

Descrizione dei blocchi
-----------------------
Expand Down
4 changes: 2 additions & 2 deletions bootstrap_italia_template/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
JS_DEFAULT_DATE_FORMAT = "dd/MM/yyyy"

# CDN FOR STATICS
DJANGO_BOOSTRAP_ITALIA_USE_CDN = False
DJANGO_BOOSTRAP_ITALIA_CDN = 'https://cdn.jsdelivr.net/npm/bootstrap-italia@2.7.0/dist'
DJANGO_BOOTSTRAP_ITALIA_USE_CDN = False
DJANGO_BOOTSTRAP_ITALIA_CDN = 'https://cdn.jsdelivr.net/npm/bootstrap-italia@2.7.0/dist'
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

register = template.Library()

DJANGO_BOOSTRAP_ITALIA_USE_CDN = getattr(settings, 'DJANGO_BOOSTRAP_ITALIA_USE_CDN', DJANGO_BOOSTRAP_ITALIA_USE_CDN)
DJANGO_BOOSTRAP_ITALIA_CDN = getattr(settings, 'DJANGO_BOOSTRAP_ITALIA_CDN', DJANGO_BOOSTRAP_ITALIA_CDN)
DJANGO_BOOTSTRAP_ITALIA_USE_CDN = getattr(settings, 'DJANGO_BOOTSTRAP_ITALIA_USE_CDN', DJANGO_BOOTSTRAP_ITALIA_USE_CDN)
DJANGO_BOOTSTRAP_ITALIA_CDN = getattr(settings, 'DJANGO_BOOTSTRAP_ITALIA_CDN', DJANGO_BOOTSTRAP_ITALIA_CDN)


@register.simple_tag
def django_bootstrap_italia_static_path(resource):
if not resource: return ''
if DJANGO_BOOSTRAP_ITALIA_USE_CDN:
return f'{DJANGO_BOOSTRAP_ITALIA_CDN}/{resource}'
if DJANGO_BOOTSTRAP_ITALIA_USE_CDN:
return f'{DJANGO_BOOTSTRAP_ITALIA_CDN}/{resource}'
return static(resource)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name='design-django-theme',
version='v2.7.0',
version='v2.7.0-1',
packages=['bootstrap_italia_template', ],
package_data={'bootstrap_italia_template': ['bootstrap_italia_template/*']},
include_package_data=True,
Expand Down

0 comments on commit 81ba7e1

Please sign in to comment.