title: Setting Django admin permissions programmatically
body: <p>The Django site I'm working on has the possibility for users to sign up for an account. To provide them with some editing functionality, I use the built-in Django admin. However, I'm having a problem: After a user has signed up, they don't have any permissions inside the Django admin, not even view permissions. Thus my question: How do I, in code, assign admin permissions to the user for the relevant models, in the same way I can assign them manually in the "User Permissions" section when editing the user in the admin? I've already tried with the <a href="https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.has_add_permission" rel="noreferrer">usual</a> <code>has_xxx_permissions()</code> using custom <code>ModelAdmin</code> classes, but that didn't work. So my guess is that I overlooked something obvious. Any ideas?</p>