Vaibhav Jain
Vaibhav Jain

Reputation: 5507

Allow colon in Django urls

I am trying to write urls rule for http://localhost:8000/api/http://www.google.com/

which is url(r'^api/(?P<url>(:\d+)+[.\w]+)/$', 'qlu_app.views.api', name='api'),

But it is not working ..Can some one please help me.

Upvotes: 1

Views: 1151

Answers (1)

alecxe
alecxe

Reputation: 474003

Give it a try:

url(r'^api/(?P<url>[:\/\.\w]+)/$', 'qlu_app.views.api', name='api'),

Upvotes: 4

Related Questions