-
-
Save BrightnBubbly/72f9b1b9a28820e9d1c20cce77bc39c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@csrf_exempt | |
def init(request): | |
if not request.body: | |
return JsonResponse(status=200, data={'message': 'No request body'}) | |
body = json.loads(bytes(request.body).decode('utf-8')) | |
if 'username' not in body: | |
return JsonResponse(status=400, data={'message': 'Username is required to join the channel'}) | |
username = body['username'] | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment