Hi i am using multiple languages in my app and it is accessible by the url like www.asd.com/reg/?lang=es
Is there some way with which i can remove this "?" from my url and it becomes like www.asd.com/reg/es and also my functionality of multiple language is working properly.
Thanks
When you access url with ?lang=es, you will get a parameter named lang with value es in your view. This is generic HTTP url scheme.
With django, similar thing can be done using appropriate url pattern. For example:
url(r'^reg/(?P<lang>[\w]+)$', 'your_app.views.view_func',),
And in view
def view_func(request, lang=None):
...
# lang will have value passed.
# do your stuff
So when you access www.asd.com/reg/es, parameter lang will have value es in your view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With