Пример #1
0
 def get(self, request, *args, **kwargs):
     auth = request.META.get('HTTP_AUTHORIZATION')
     if auth is None:
         return basic_challenge("authenticate to update DNS", 'badauth')
     username, password = basic_authenticate(auth)
     self.hostname = username
     self.secret = password
     return super(JsUpdateView, self).get(request, *args, **kwargs)
Пример #2
0
 def get(self, request, *args, **kwargs):
     auth = request.META.get('HTTP_AUTHORIZATION')
     if auth is None:
         return basic_challenge("authenticate to update DNS", 'badauth')
     username, password = basic_authenticate(auth)
     self.hostname = username
     self.secret = password
     return super(JsUpdateView, self).get(request, *args, **kwargs)