-
-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs: how to use migrations on dango>1.7 with a custom application #227
Comments
Is this for someone who is a first-time user, or someone upgrading from Django < 1.7, or someone upgrading from DOT < 0.8? |
You can reproduce the error with django>=1.7 and the current DOT master branch. Create a new project, add an app with the custom application model and set the OAUTH2_PROVIDER_APPLICATION_MODEL in the settings. The steps above are the only workaround I'm aware of. |
@synasius Is the equivalent process necessary for those still using Django 1.6+South, or this issue is Django Migration (>1.7) issue? |
the issue occurs on a new Django>=1.7 project when using a custom application model. Please note that changing the Application Model has the same effect of changing user model, so the same warnings applies. Please read https://docs.djangoproject.com/en/1.8/topics/auth/customizing/#substituting-a-custom-user-model carefully!! |
It may be useful for people adding Django-OAuth-Toolkit to an existing project to be aware of https://docs.djangoproject.com/en/1.9/howto/writing-migrations/#controlling-the-order-of-migrations Any migration that adds a swappable application model should have:
specified in it. |
Closing this as 1.11 is the minimum version supported and it's been too long. |
When using a custom application model migrations don't work out of the box.
The
makemigrations
command should fail with an error like:Let's say you have your custom user model in
foo.MyApp
, follow these steps to correctly create migrations for your app:OAUTH2_PROVIDER_APPLICATION_MODEL
in your settings or it is commented out.oauth2_provider
andfoo
are listed inINSTALLED_APPS
.makemigrations
commandOAUTH2_PROVIDER_APPLICATION_MODEL
\migrate
command.The text was updated successfully, but these errors were encountered: