# Facing problem while creating new video room with the help of django api

**URL:** <https://janus.discourse.group/t/facing-problem-while-creating-new-video-room-with-the-help-of-django-api/1600>\
**Category:** General\
**Created:** [April 21, 2025, 8:15am UTC](https://janus.discourse.group/t/facing-problem-while-creating-new-video-room-with-the-help-of-django-api/1600 "2025-04-21T08:15:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HimanishVyas](https://avatars.discourse-cdn.com/v4/letter/h/3ab097/32.png) [@HimanishVyas](https://janus.discourse.group/u/HimanishVyas)\
**Post date:** [April 21, 2025, 8:15am UTC](https://janus.discourse.group/t/facing-problem-while-creating-new-video-room-with-the-help-of-django-api/1600/1 "2025-04-21T08:15:04Z")

</div>

Hello, I am trying to build the video call app in that i need to create new video room, currently i creating with the help of Django API this is my Code

JANUS\_ADMIN\_URL = “[http://127.0.0.1:7088/admin/janus.plugin.videoroom](http://127.0.0.1:7088/admin/janus.plugin.videoroom)” # ✅ Janus admin runs on 7088, not 8088  
JANUS\_ADMIN\_SECRET = “janusoverlord”

@csrf\_exempt  
def create\_janus\_room(request):  
if request.method != “POST”:  
return JsonResponse({“error”: “Only POST requests allowed”}, status=405)

```
try:
    data = json.loads(request.body)
    room_id = int(data.get("room_id"))
    if not room_id:
        return JsonResponse({"error": "room_id is required"}, status=400)
except (ValueError, TypeError, json.JSONDecodeError):
    return JsonResponse({"error": "Invalid room_id or JSON"}, status=400)

payload = {
  "janus": "create",
  "admin_secret": "janusoverlord",
  "transaction": "randomstring",
  "request": {
    "room": 1234,
    "description": "Room 1234",
    "publishers": 10
  }
}

try:
    response = requests.post(JANUS_ADMIN_URL, json=payload)
    print("JANUS RESPONSE TEXT:", response.text)

    # Try JSON decode
    janus_response = response.json()

    if janus_response.get("janus") == "success":
        return JsonResponse({"success": True, "room_id": room_id})
    else:
        return JsonResponse({
            "error": "Failed to create room",
            "details": janus_response
        }, status=500)

except requests.RequestException as e:
    return JsonResponse({"error": "Janus connection error", "details": str(e)}, status=502)
except json.JSONDecodeError:
    return JsonResponse({
        "error": "Invalid JSON from Janus",
        "raw_response": response.text
    }, status=500)

```

Currently i am getting this error for Janus server

{  
“error”: “Failed to create room”,  
“details”: {  
“janus”: “error”,  
“transaction”: “randomstring”,  
“error”: {  
“code”: 457,  
“reason”: “Unhandled request ‘create’ at this path”  
}  
}  
}

i am using Janus first time, so i might be missing something here please guide me.
