diff options
| author | Bobby <[email protected]> | 2023-07-12 20:18:26 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2023-07-12 20:18:26 -0400 |
| commit | b87d34cd1d1bd39d97b97ba051f230f2ea26b72c (patch) | |
| tree | d70ea0c0e7278c483d73d82a186a20dc2bba07ec | |
| parent | 2ce0ccb1106c8b21b2e9d99ecf8e0772cbf6344a (diff) | |
| download | thatcomputerscientist-b87d34cd1d1bd39d97b97ba051f230f2ea26b72c.tar.xz thatcomputerscientist-b87d34cd1d1bd39d97b97ba051f230f2ea26b72c.zip | |
setting `x-frame-options` to sameorigin for anidata view
| -rw-r--r-- | blog/views.py | 4 | ||||
| -rw-r--r-- | solitude/views.py | 6 | ||||
| -rw-r--r-- | thatcomputerscientist/hosts.py | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/blog/views.py b/blog/views.py index e2dd28f5..e09ec3fb 100644 --- a/blog/views.py +++ b/blog/views.py @@ -7,6 +7,7 @@ from datetime import datetime from random import choice from string import ascii_letters, digits +import requests from bs4 import BeautifulSoup from django.contrib import messages from django.contrib.auth.models import User @@ -14,9 +15,9 @@ from django.core.cache import cache from django.core.paginator import Paginator from django.http import Http404, HttpResponse, HttpResponseRedirect from django.shortcuts import redirect, render, reverse +from django.views.decorators.clickjacking import xframe_options_sameorigin from dotenv import load_dotenv from haystack.query import SearchQuerySet -import requests from user_agents import parse from announcements.models import Announcement @@ -566,6 +567,7 @@ def socialify(request): def anilist(request): return render(request, 'blog/anilist.html', {'title': 'My Anime List'}) +@xframe_options_sameorigin def anidata(request): malURL = 'https://myanimelist.net/animelist/crvs' MAL = requests.get(malURL) diff --git a/solitude/views.py b/solitude/views.py index 81bc1075..d9eda1ae 100644 --- a/solitude/views.py +++ b/solitude/views.py @@ -1,8 +1,8 @@ -from django.http import HttpResponse +import json + from django.shortcuts import render -from .constants.welcome_playlist import WELCOME_TRACKS -import json +from .constants.welcome_playlist import WELCOME_TRACKS # Create your views here. TEMPLATE_BASE_PATH = '@solitude' diff --git a/thatcomputerscientist/hosts.py b/thatcomputerscientist/hosts.py index 503b3443..861ba8b5 100644 --- a/thatcomputerscientist/hosts.py +++ b/thatcomputerscientist/hosts.py @@ -1,4 +1,4 @@ -from django_hosts import patterns, host +from django_hosts import host, patterns host_patterns = patterns( '', |
