Skip to content

Instantly share code, notes, and snippets.

@caljess599
Created November 20, 2014 17:23
Show Gist options
  • Save caljess599/0693de00a432412a4f4b to your computer and use it in GitHub Desktop.
Save caljess599/0693de00a432412a4f4b to your computer and use it in GitHub Desktop.
initial_data.json modification for sentry
[{
"pk": 1,
"model": "sentry.user", #CHANGED MODEL NAME
"fields": {
"username": "admin",
"first_name": "",
"last_name": "",
"is_active": true,
"is_superuser": true,
"is_staff": true,
"last_login": "2013-10-04T23:58:16Z", #REMOVED "groups" and "user_permissions" FIELDS
"password": "encryptedgooblygookgoeshere",
"email": "[email protected]",
"date_joined": "2013-10-04T23:58:16Z"
}
}]
@caljess599
Copy link
Author

Response to https://gist.github.com/iromli/8019162:

PROBLEM:
Running sentry --conf=sentry.conf.py upgrade raises AttributeError: Problem installing fixture 'initial_data.json': 'NoneType' object has no attribute 'using'

SOLUTION:
Sentry doesn't define an auth.user, only a sentry.user, so we changed the model name. We then made the fields match by removing the "groups" and "user_permissions" fields.

Note: You need run upgrade FIRST, THEN copy in the fixture file and pass it in using loaddata. (The upgrade command tries to load the fixtures before the model has been created and thus the fixture fails.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment