質問

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?

役に立ちましたか?

解決

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top