florimondmanca/djangorestframework-api-key

Cant create API Key - Error: "Unknown column 'prefix' in 'field list'"

DmytroOnyshchuk opened this issue · 2 comments

Describe the bug
After install Django REST Framework API Key and make "python3 manage.py migrate" i have an error with create API Key in admin panel, error message: Unknown column 'prefix' in 'field list'. Please check it.

Desktop (please complete the following information):

  • OS: Ubuntu Server 20.04
  • Version: 2.0
  • Python Version: 3.8.2
  • Django Version: 2.2.12
  • DRF Version: 3.11.1

Screenshots
error

Hello!

Please check it.

Not sure how you meant this to come across, but please be aware that as a volunteer-based open source nobody here is in a position to require anyone's time. :)

That being said, from your screenshots there are a few questions I'd have to move this forward:

  • You wrote this happens in the admin. What exact series of steps could somebody use to reproduce this error? For example, "1/ Opn admin site, 2/ Go to API Keys, 3/ Click new API key, 4/ Submit form, error occurs".
  • I've been moderately engaged with this project recently, so could we verify that prefix is indeed a known model field?
  • Are you doing any kind of customization that could lead the prefix field to not be defined in your custom model?
  • Etc...

Edit: I read you actually mentioned this was happening when creating an API key in the admin.

So a few more things we should check...

  • Does this reproduce when creating an API key programmatically from the Django shell (instructions in the usage guide)? If so, what's the traceback from that?
  • If you're able to use a different DBMS, does it reproduce say on Postgres?
  • Does it reproduce on a brand new empty DB?
  • Does it reproduce if running the local test app in this repo? (Running scripts/serve I believe.)

Going to close assuming this got solved eventually, thanks.