I have a migration that depends on the application model being there - but since I'm not overriding the applicaiton model, I don't see the OAUTH2_PROVIDER_APPLICATION_MODEL in the settings.
Using django-configurations as well.
Hi yarbelk, did you ever find a solution to this issue? We're experiencing the same thing after migrating from django 1.5 to 1.7
Seeing this in Django 1.9 when running makemigrations. Not trying to use a custom model or anything, but one of my models has a foreign key to oauth2_provider.Application.
AttributeError: 'Settings' object has no attribute 'OAUTH2_PROVIDER_APPLICATION_MODEL'
Adding the setting fixes it, but it seems heavy-handed to fix it like that.
@jdp How do you fix the settings, I get the error right now , but no idea how to fix it.
@b35li copy the setting into your settings.py, like this:
OAUTH2_PROVIDER_APPLICATION_MODEL = 'oauth2_provider.Application'
Closing as these versions of Django are no longer supported.
@jleclanche this is still happening with django 1.10.7, can you point me in the direction of what would need to be done to get a pr in for this?
Hi, as @jleclanche said this undocumented behaviour looks like is still there.
I'm running Django 1.11.5 and I think it's a problem of circular imports that I still didn't figure out. The issue is triggered by a deadly combo of these params I'm using in my tests:
-n: I've installed Django Test Without Migrations
-v 2: with verbose level set to 1 or 0, the issue does not show up.
Example of complete cmd line I'm using:
$ DJANGO_SETTINGS_MODULE=myprj.settings.test python manage.py test --noinput -n myprj.module.tests.test_class -v 2
My workaround is to set in my projects settings the two following constants:
OAUTH2_PROVIDER_ACCESS_TOKEN_MODEL = 'oauth2_provider.AccessToken'
OAUTH2_PROVIDER_APPLICATION_MODEL = 'oauth2_provider.Application'
More recently, requires:
OAUTH2_PROVIDER_ACCESS_TOKEN_MODEL = 'oauth2_provider.AccessToken'
OAUTH2_PROVIDER_APPLICATION_MODEL = 'oauth2_provider.Application'
OAUTH2_PROVIDER_REFRESH_TOKEN_MODEL = 'oauth2_provider.RefreshToken'
Pasting in case others encounter this open issue as I did.
Still happening in Django 2.1
happen in django2.2 too
And happening in Django 3
django 2.2
python 3.7
i was having same the issue, i delete virtualenv folder re-install whole thing again. It worked!
I am having this exact problem... Any solution?
@PinkFLoyd92 https://github.com/jazzband/django-oauth-toolkit/issues/240#issuecomment-403928239
Most helpful comment
More recently, requires:
Pasting in case others encounter this open issue as I did.