Im sorry for my bad English.
在 2019年8月1日,下午4:01,niranjan shukla <niranjanshukla88@gmail.com> 写道:views.pyfrom django.http import JsonResponsefrom django.views.decorators.http import require_POSTfrom common.decorators import ajax_requiredfrom .models import Contact@ajax_required@require_POST@login_requireddef user_follow(request):user_id = request.POST.get('id')action = request.POST.get('action')if user_id and action:try:user = User.objects.get(id=user_id)if action == 'follow':Contact.objects.get_or_create(user_from=request.user,user_to=user)else:Contact.objects.filter(user_from=request.user,user_to=user).delete()return JsonResponse({'status':'ok'})except User.DoesNotExist:return JsonResponse({'status':'ko'})return JsonResponse({'status':'ko'})when I install the common thenERROR:File "C:\Users\user\Desktop\allauth1 - Copy\users\views.py", line 133, in <module>from common.decorators import ajax_requiredModuleNotFoundError: No module named 'common.decorators'--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/74db8c7d-0a62-4736-8b0a-e2b355055007%40googlegroups.com.
No comments:
Post a Comment