Ramin Farajpour Cami Ramin Farajpour Cami - 4 months ago 8
Python Question

How to define (string+int+...) URL Pattern RegEx Django

my url :

http://127.0.0.1:8000/avatar/Z0FBQUFBQlhuZWI3ejVzTU10TUwyY0twMFJqZHM5MU1LajdEVnJfSzVWN3RXcUFya00wZjdLOUZmbjBzUG5ZSldibkNXeEtMQ1dsZnE4WXlRd0lNLXllRXhNbS1CUWdFSnc9PQ==


url pattern :
url(r'^avatar/(?P<avaID>\w+)$', ReportsController.UserImage),


"w+" this means just string or "d+" this means just digit but
i need in url with all character in url pattern django how?

Answer

Then match every character using .:

 url(r'^avatar/(?P<avaID>.+)$', ReportsController.UserImage)