limit amount of authentication tokens

2019-07-14 Thread cyril moreau
Hi, I would like to know if there is a way to limit the amount of token that a user can create? I am using django-oauth2-toolkit to generate the token. The user can hit the auth url (http://localhost:8000/o/token/) as much as he wants and creates a new token everytime he goes to that url. Thi

Re: django.db.utils.OperationalError: no such table: user_user

2019-03-08 Thread cyril moreau
gt; inbuilt app. > > On Fri, Mar 8, 2019 at 2:27 AM cyril moreau > wrote: > >> To fix my issue I had to makemigrations for each one of my app : >> >> by doing the following it will create my user table : >> >> python manage.py makemigrations user >> >

Re: django.db.utils.OperationalError: no such table: user_user

2019-03-07 Thread cyril moreau
To fix my issue I had to makemigrations for each one of my app : by doing the following it will create my user table : python manage.py makemigrations user does not work if i just do : python manage.py makemigrations Best regards Le jeudi 7 mars 2019 19:01:10 UTC+1, cyril moreau a écrit

django.db.utils.OperationalError: no such table: user_user

2019-03-07 Thread cyril moreau
Hi, I have the following model that i use as AUTH_USER_MODEL : model.py class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField(_('email address'), unique=True) password = models.CharField(_('password'), max_length=255, blank=False) first_name = models.CharField(_('fi

drf - change Foreign key to another field in a serializer using modelviewset

2019-02-07 Thread cyril moreau
Hi, I have a ModelViewSet class as : class EventAPIListCreate( viewsets.ModelViewSet): queryset = EventAPI.objects.all() serializer_class = EventAPISerializer and my serializer looks like : class EventAPISerializer(serializers.ModelSerializer): class Meta: model = EventAPI fie

how to use sessionauthentication with a custom Model user and define _auth_user_id

2018-12-17 Thread cyril moreau
Hi, I am trying to use the sessionauthentication with a custom user Model but it fails and i dont know why. My custom Model is :user/user.py from django.db import models from django.core.mail import send_mail from django.contrib.auth.models import PermissionsMixin from django.contrib.auth.base_us

Re: rest API create a signed_cookies including my token

2018-12-17 Thread cyril moreau
if you include js on your site > (some third party thing) that scrapes the localstorage variables. > > Regards, > > Andréas > > > Den mån 17 dec. 2018 kl 11:24 skrev cyril moreau >: > >> Hi, >> >> I thought also about storing the token in the local sto

Re: rest API create a signed_cookies including my token

2018-12-17 Thread cyril moreau
/medium.com/@rajaraodv/securing-react-redux-apps-with-jwt-tokens-fcfe81356ea0 > > Check under the header "Storing JWT token". > > It doesn't need to be a JWT token - the principal is that same regardless > of how you generate the token. > > Regards, &g

APIview CSRF Protect Usage

2018-12-16 Thread cyril moreau
Hi, I dont understand how works the CSRF Protection with an API View. I understand the process when using a django template : When the template loads, The form page get a hidden field with an alphanumeric string and the client get a csrf cookie with another alphanumeric. When submitting the for

rest API create a signed_cookies including my token

2018-12-16 Thread cyril moreau
Hi, I am looking for information/help about storing my token in a cookie in a safe way. Backend : Django rest framework - Frontend Reacjs I am using django-rest-framework-social-oauth2 to get a token (from different provider