django use float in url
from django.urls import path, register_converter
class FloatConverter:
regex = '[\d\.\d]+'
def to_python(self, value):
return float(value)
def to_url(self, value):
return '{}'.format(value)
register_converter(FloatConverter, 'float')
urlpatterns = [
path('admin/', admin.site.urls),
path('<float:float_number>/',TemplateView.as_view(template_name='homepage.html')),
]