Skip to content

Add docs: how to use migrations on dango>1.7 with a custom application #227

@synasius

Description

@synasius

When using a custom application model migrations don't work out of the box.
The makemigrations command should fail with an error like:

ValueError: Lookup failed for model referenced by field oauth2_provider.Grant.application: foo.MyApp 

Let's say you have your custom user model in foo.MyApp, follow these steps to correctly create migrations for your app:

  1. Check you DON'T have OAUTH2_PROVIDER_APPLICATION_MODEL in your settings or it is commented out.
  2. Check both oauth2_provider and foo are listed in INSTALLED_APPS.
  3. Run makemigrations command
  4. Now add or uncomment OAUTH2_PROVIDER_APPLICATION_MODEL\
  5. Run migrate command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions