Skip to content

Commit

Permalink
revisi csrf trusted origin
Browse files Browse the repository at this point in the history
  • Loading branch information
fathonidf committed Nov 22, 2023
1 parent 6ab4c60 commit d5c5ad2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions adventurers_inventory/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@

WSGI_APPLICATION = 'adventurers_inventory.wsgi.application'

CSRF_TRUSTED_ORIGINS = ["https://daffa-mohamad-tugas.pbp.cs.ui.ac.id"]

# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
Expand Down
2 changes: 0 additions & 2 deletions main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def create_item(request):
context = {'form': form}
return render(request, "create_item.html", context)

@csrf_exempt
def register(request):
form = UserCreationForm()

Expand All @@ -55,7 +54,6 @@ def register(request):
context = {'form':form}
return render(request, 'register.html', context)

@csrf_exempt
def login_user(request):
if request.method == 'POST':
username = request.POST.get('username')
Expand Down

0 comments on commit d5c5ad2

Please sign in to comment.