Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django rest framework versioning

I'm new to the DRF. I tried to write an example by description on links:

http://james.lin.net.nz/2014/02/18/django-rest-framework-api-versioning/

django-rest-framework: api versioning

and share it: https://github.com/van2048/DRF_versioning

, but I get the error "NoReverseMatch at / app_drf/v1 /". Please tell me, that was not written correctly?

like image 953
Abradox Avatar asked May 06 '14 22:05

Abradox


1 Answers

Try replacing your pattern with this in /app_drf/v1/urls.py:

router.register(r'^$', ver_views.AppDrfModelViewSet)

The $ is a regex operator that matches to the end of the string. https://docs.python.org/2/library/re.html

like image 148
Jkk.jonah Avatar answered Oct 17 '22 19:10

Jkk.jonah