get header data from prod
This commit is contained in:
parent
e1b34b2482
commit
2d1079f0c2
2 changed files with 21 additions and 2 deletions
|
|
@ -24,6 +24,9 @@ class SMSPolicy(BaseModel):
|
||||||
related_name='+', null=True, blank=True, unique=True)
|
related_name='+', null=True, blank=True, unique=True)
|
||||||
preferred = models.CharField(max_length=16, choices=SMSClienChoises.choices, default=SMSClienChoises.FAKE)
|
preferred = models.CharField(max_length=16, choices=SMSClienChoises.choices, default=SMSClienChoises.FAKE)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.get_preferred_display()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_client() -> BaseSMSClient:
|
def get_client() -> BaseSMSClient:
|
||||||
policy = SMSPolicy.objects.get_or_create(application=None)[0]
|
policy = SMSPolicy.objects.get_or_create(application=None)[0]
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ from django.shortcuts import render
|
||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
|
|
||||||
|
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
# @method_decorator(login_required, name='dispatch')
|
# @method_decorator(login_required, name='dispatch')
|
||||||
class HomeView(TemplateView):
|
class HomeView(TemplateView):
|
||||||
|
|
@ -14,6 +15,21 @@ class TestIpView(TemplateView):
|
||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
print(request.headers)
|
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)
|
return super(TestIpView, self).get(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue