Pergunta

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?

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top