Prior to this change to modify the address javascript you had to fork
and edit the address.js manually. This change let to define a setting
dict to customize the address.js.
e.g.
ADDRESS_SETTINGS = {
'country': ['AU'],
}
it will be injected in the address.js to limit the address to the
australian country.
To achieve that I move the address.js from a static file to a
templateview and threat the address.js file as a django template.
The TemplateView is responsible to retrieve the settings and generate
the context for the template.
There is a requirement to make django-address works now. The url must be
added in your project:
e.g.
urlpatterns = [
# ... other urls
path('address/', include('address.urls')),
]
Prior to this change to modify the address javascript you had to fork and edit the
address.js
manually. This change let to define a setting dict to customize the address.js.e.g.
it will be injected in the address.js to limit the address to the australian country.
To achieve that I move the address.js from a static file to a templateview and threat the address.js file as a django template.
The TemplateView is responsible to retrieve the settings and generate the context for the template.
There is a requirement to make django-address works now. The url must be added in your project:
e.g.