'api-docs' is not a registered namespace

2017-03-13 Thread Daviddd
Dear All, Django 1.10.6 Django-rest-framework 3.6.2 ``` #api/urls.py def include_version(version): """ Returns an include statement containing URL patterns for the passed API version. """ kwargs = {} if version != settings.API_CURRENT_VERSION: kwargs['namespace'] = '

Re: 'api-docs' is not a registered namespace

2017-03-18 Thread Daviddd
ars 2017 17:18:56 UTC+1, Daviddd a écrit : >> >> Dear All, >> >> Django 1.10.6 >> Django-rest-framework 3.6.2 >> >> >> ``` >> #api/urls.py >> def include_version(version): >> """ >> Returns an include sta

Re: 'api-docs' is not a registered namespace

2017-03-18 Thread Daviddd
.urls.exceptions.NoReverseMatch: 'api-docs' is not a registered namespace On Thursday, March 16, 2017 at 4:39:48 PM UTC+1, Antoine Nguyen wrote: > > Stupid question: have you installed the coreapi package? > > Antoine > > Le lundi 13 mars 2017 17:18:

Re: 'api-docs' is not a registered namespace

2017-03-18 Thread Daviddd
^api-docs/', include_docs_urls(title='***')), ] I suppose it's a bug having the versioning applied. I will try to open an issue in github. D On Thursday, March 16, 2017 at 4:39:48 PM UTC+1, Antoine Nguyen wrote: > > Stupid question: have you installed the coreapi packag

Re: coreapi tutorial not working

2017-08-09 Thread Daviddd
This for sure not. From the DRF doc: http://www.django-rest-framework.org/topics/3.6-announcement/#interactive-api-documentation > The coreapi library is required as a dependancy for the API docs. Make sure to install the latest version (2.3.0 or above). On Wednesday, August 2, 2017 at 8:53:40

DateTimeField serializer different values specifying 'DATETIME_FORMAT': "%Y-%m-%dT%H:%M:%S%z",

2018-03-14 Thread Daviddd
Hello All, I'm using Django 2.0.1 and DRF djangorestframework==3.7.7 with USE_TZ = True. The model field is declared as modified = models.DateTimeField(auto_now=True) Serializer ** class Meta: fields = ('id', 'url', 'owners', 'type', 'title', 'abstract', 'created', 'keywords', 'use

APIClient and accept_language header

2018-04-13 Thread Daviddd
Dear all, Using APIClient (not the requests based class) is it possible to pass as param the accept_language? class BaseAPITestCase(APITestCase): @classmethod def setUpTestData(cls): def _get_jwt_token(user_credentials): url_token_auth = reverse('api:default:api-toke

Re: APIClient and accept_language header

2018-04-17 Thread Daviddd
pr 2018, at 07:41, Daviddd > > wrote: > > ACCEPT_LANGUAGE='es' > > > I think you’d need to pass it like this: > > HTTP_ACCEPT_LANGUAGE=‘es' > > > Kind Regards, > > Carlton > -- You received this message because you are subscribed

Re: Any good practice to caching ListAPIView?

2019-03-08 Thread Daviddd
I do something similar: class CacheKeyDispatchMixin: def dispatch(self, *args, **kwargs): if self.request.method == 'GET' or self.request.method == 'HEAD': url_to_cache = '/{0}{1}'.format(get_language(), self.request.get_full_path()) cache_hash = calculate_xxxh