- token auth support in the API views.
- create a when a local user signs up.
This commit is contained in:
Adi Sieker 2016-06-29 16:07:16 +02:00
Родитель 15f838c15d
Коммит 887aefb59a
3 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -55,7 +55,7 @@ class Categories(ListAPIView):
class Apps(DestroyAPIView):
authentication_classes = (authentication.BasicAuthentication,)
authentication_classes = (authentication.TokenAuthentication, authentication.BasicAuthentication,)
permission_classes = (UpdateDeletePermission,)
serializer_class = AppSerializer
queryset = App.objects.all()
@ -78,7 +78,7 @@ class Apps(DestroyAPIView):
class AppReleases(DestroyAPIView):
authentication_classes = (authentication.BasicAuthentication,)
authentication_classes = (authentication.TokenAuthentication, authentication.BasicAuthentication,)
permission_classes = (UpdateDeletePermission, IsAuthenticated)
throttle_classes = (PostThrottle,)
throttle_scope = 'app_upload'

Просмотреть файл

@ -1,11 +1,12 @@
from django import forms
from captcha.fields import ReCaptchaField
from rest_framework.authtoken.models import Token
class SignupFormRecaptcha(forms.Form):
"""integrate a recaptcha field."""
recaptcha = ReCaptchaField()
def signup(self, request, user):
pass
t = Token.objects.create(user=user)
t.save()

Просмотреть файл

@ -27,6 +27,7 @@ INSTALLED_APPS = [
'parler',
'captcha',
'rest_framework',
'rest_framework.authtoken',
'corsheaders',
'allauth',
'allauth.account',