Skip to content

Commit

Permalink
Add CSFR exempt and remove allowed hostsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Edouard Bourque committed Apr 18, 2024
1 parent 9aad0e8 commit 48c7e32
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions clashstats/battlelog/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.http import HttpResponse
from django.template import loader
from django.views.decorators.csrf import csrf_exempt
import requests
from .models import (
Arena,
Expand Down Expand Up @@ -34,6 +35,7 @@ def playerstatssearch(request):
return HttpResponse(template.render(context, request))


@csrf_exempt
def battlelog(request, tag):
Arenas = Arena.objects.all().values()
Gamemodes = GameMode.objects.all().values()
Expand Down
2 changes: 2 additions & 0 deletions clashstats/clanranking/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.http import HttpResponse
from django.template import loader
from django.views.decorators.csrf import csrf_exempt
from django.db.models import Q
import requests
from .models import Members, Clans, Battles
Expand All @@ -14,6 +15,7 @@ def clanrankingsearch(request):
return HttpResponse(template.render(context, request))


@csrf_exempt
def clanranking(request, clantag):
# Request variables
APIKEY = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiIsImtpZCI6IjI4YTMxOGY3LTAwMDAtYTFlYi03ZmExLTJjNzQzM2M2Y2NhNSJ9.eyJpc3MiOiJzdXBlcmNlbGwiLCJhdWQiOiJzdXBlcmNlbGw6Z2FtZWFwaSIsImp0aSI6IjRiODJiNzlmLTg5NzAtNDllYi05NGEyLWEyZDAzNzU5MjIyNSIsImlhdCI6MTcxMjk1MzUyMSwic3ViIjoiZGV2ZWxvcGVyLzNkNjhmM2MyLWM4ZmItNDAyYy0zZTU4LTk0YjIzMGY1Y2IzZCIsInNjb3BlcyI6WyJyb3lhbGUiXSwibGltaXRzIjpbeyJ0aWVyIjoiZGV2ZWxvcGVyL3NpbHZlciIsInR5cGUiOiJ0aHJvdHRsaW5nIn0seyJjaWRycyI6WyI3NC4xMi4xNjkuMjMwIiwiMTczLjE4Mi4xNTQuMjQ2IiwiMjA5LjE3MS4xNjIuMTQ1IiwiMjA3LjE2Ny4yMTYuODkiXSwidHlwZSI6ImNsaWVudCJ9XX0.YvF3ojCgj7r7KdBBCoSufuTnVj6Qd0wz6YaRWfdSet6QPIZOn3HSlXlJUlyLLfUQUQi0G6nfL3MPleE_CTnn2w"
Expand Down
2 changes: 1 addition & 1 deletion clashstats/clashstats/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['192.168.2.39']
ALLOWED_HOSTS = []


# Application definition
Expand Down

0 comments on commit 48c7e32

Please sign in to comment.