35 lines
1.6 KiB
Python
35 lines
1.6 KiB
Python
from django.contrib.auth.decorators import login_required
|
|
from django.shortcuts import render
|
|
from django.utils.decorators import method_decorator
|
|
from django.views.generic import TemplateView
|
|
|
|
|
|
# Create your views here.
|
|
# @method_decorator(login_required, name='dispatch')
|
|
class HomeView(TemplateView):
|
|
template_name = 'core/home.html'
|
|
|
|
|
|
class TestIpView(TemplateView):
|
|
template_name = 'core/home.html'
|
|
|
|
def get(self, request, *args, **kwargs):
|
|
print(request.headers)
|
|
headers_data = {'Host': 'accounts.gooyal.ir',
|
|
'X-Real-Ip': '212.23.216.131',
|
|
'X-Forwarded-For': '5.216.121.72, 212.23.216.131',
|
|
'X-Forwarded-Proto': 'http',
|
|
'Connection': 'close',
|
|
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0',
|
|
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
|
'Accept-Language': 'en,en-US;q=0.7,fa;q=0.3',
|
|
'Accept-Encoding': 'gzip, deflate, br, zstd',
|
|
'Cookie': 'csrftoken=xor4RVhDDuhQ5l4hf44iI3o2I0FJU8kJ; sessionid=3c0kju13bswh6ufu3mdnl1u38wi7d4b3',
|
|
'Upgrade-Insecure-Requests': '1',
|
|
'Sec-Fetch-Dest': 'document',
|
|
'Sec-Fetch-Mode': 'navigate',
|
|
'Sec-Fetch-Site': 'none',
|
|
'Sec-Fetch-User': '?1',
|
|
'Priority': 'u=0, i'}
|
|
|
|
return super(TestIpView, self).get(request, *args, **kwargs)
|