Created
July 31, 2021 13:38
-
-
Save Chukslord1/9b141115253ee4540166e2bcbf746641 to your computer and use it in GitHub Desktop.
Agora Video Application
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
def index(request): | |
app_id="replace_with_app_id" | |
if request.method=="POST": | |
channel=request.POST.get("channel") | |
new=request.POST.get("new") | |
if new: | |
dir(secrets) | |
channel=secrets.token_urlsafe() | |
url="agora/?channel="+channel | |
save_channel=Channel.objects.create(channel=channel,app_id=app_id) | |
save_channel.save() | |
meeting = Meeting.objects.create(channel=channel) | |
meeting.save() | |
return redirect(url) | |
if Meeting.objects.filter(channel=channel): | |
url="agora/?channel="+channel | |
if Channel.objects.filter(app_id=app_id,channel=channel): | |
channel_delete=Channel.objects.get(app_id=app_id,channel=channel) | |
channel_delete.delete() | |
save_channel=Channel.objects.create(channel=channel,app_id=app_id) | |
save_channel.save() | |
else: | |
save_channel=Channel.objects.create(channel=channel,app_id=app_id) | |
save_channel.save() | |
return redirect(url) | |
return render(request,"app1/index.html") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment