headers = {
'Host': 'ovga.mos.ru',
'User-Agent': 'Magic User-Agent v999.26 Windows PRO 11',
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate, br',
'Connection': 'keep-alive',
'X-Requested-With': 'XMLHttpRequest'
}
url = 'http://ovga.mos.ru:8080/_ajax/pass/list?search={"grz":"К239ММ159"}&sort=validitydate&order=desc'
response = requests.get(url, headers=headers)
<Response [200]>
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
# ... the rest of your URLconf goes here ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
import pandas as pd
lst=[{'id': 2785280, 'score': 13},
{'id': 66560002, 'score': 4},
{'id': 180432899, 'score': 7},
{'id': 52793348, 'score': 5},
{'id': 86411270, 'score': 5},
{'id': 2334728, 'score': 2},
{'id': 2523146, 'score': 4},
{'id': 159318028, 'score': 5},
]
df=pd.DataFrame(lst)
df=df.groupby('id')['score'].sum()
class TechUnit(models.Model):
type_name1 = 'номер1'
type_name2 = 'номер2'
type_name3 = 'номер3'
Category = [
( type_name1, 'номер1'),
( type_name2, 'номер2'),
( type_name3, 'номер3'),
]
inner_id = models.CharField(max_length=100, verbose_name='Внутренний номер', unique=True)
tech_type = models.CharField(max_length=100, verbose_name='Вид техники', choices=Category,
default=Main)
def __str__(self):
return self.inner_id
for (name, items) in cook_book:
print('\n%s:' % name.capitalize())
for (ingredient, quantity, unit) in items:
print('%s, %d %s' % (ingredient, quantity * person, unit))