Cipher
Cipher

Reputation: 2132

ValueError - How to Extend OAuth2 Application Model - Django

I want extend Application model of django oauth toolkit. They have given intsructions here link

But i am not getting how to do it. I have created one app inside apps folder and inside models i have added the following code.

from django.db import models
from oauth2_provider.models import AbstractApplication

class MyApplication(AbstractApplication):
    logo = models.ImageField()
    agree = models.BooleanField()

Resgitered the app inside installed_apps as 'apps.oauth2', and added the following line:

OAUTH2_PROVIDER_APPLICATION_MODEL='apps.OAuth2' 

But it giving me error

LookupError: No installed app with label 'apps'.

Installed Apps [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    'crispy_forms',

    'apps.commons',
    'apps.company',
    'apps.oauth2',
]

Upvotes: 0

Views: 379

Answers (1)

Headmaster
Headmaster

Reputation: 2342

According this manual link model in OAUTH2_PROVIDER_APPLICATION_MODEL should be class name not app

Upvotes: 1

Related Questions