django add user to group
from django.contrib.auth.models import Group, User
g = Group.objects.get(name='My Group Name')
users = User.objects.all()
for u in users:
g.user_set.add(u)
django add user to group
from django.contrib.auth.models import Group, User
g = Group.objects.get(name='My Group Name')
users = User.objects.all()
for u in users:
g.user_set.add(u)
django display view library
from django.views.generic.detail import DetailView
show post id on django admin interface
class BookAdmin(admin.ModelAdmin):
readonly_fields = ('id',)
admin.site.register(Book, BookAdmin)
django add user to group
from django.contrib.auth.models import Group
my_group = Group.objects.get(name='my_group_name')
my_group.user_set.add(your_user)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us