Skip to content

Instantly share code, notes, and snippets.

@aKamrani
Last active January 31, 2026 14:35
Show Gist options
  • Select an option

  • Save aKamrani/ed64e4dbea38211461eab2dfdfcc5d9f to your computer and use it in GitHub Desktop.

Select an option

Save aKamrani/ed64e4dbea38211461eab2dfdfcc5d9f to your computer and use it in GitHub Desktop.
Sentry - Install & Tips
Here I will write all needed docs and configs and tricks for Sentry utilization:
@aKamrani
Copy link
Author

How to add User to Sentry and its Organ when Email is inaccessible:

docker exec -it sentry-web-1 bash
sentry createuser --org-id ORG_ID --email USER_EMAIL --password STRONG_PASSWORD --force-update  

// [--org-id ORG_ID is optional and always could be 1]

sentry shell

// MODIFY AND RUN THIS SCRIPT ON SENTRY SHELL:

from sentry.models import User, Organization, OrganizationMember
user = User.objects.get(email="USER_EMAIL")
org = Organization.objects.get(slug="ORG_NAME_OR_SLUG")

member, created = OrganizationMember.objects.get_or_create(
    organization=org,
    user_id=user.id,
    defaults={
        "role": "member",
        "user_email": user.email,
    }
)

if created:
    print("✅ User added to organization ORG_NAME_OR_SLUG")
else:
    print("ℹ️ User was already a member of organization ORG_NAME_OR_SLUG")

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