- Использовать - библиотеку Flask https://palletsprojects.com/p/flask/
- Для наполнения БД данными:
- написать модель (таблицу) на SQLAlchemy https://flask-sqlalchemy.palletsprojects.com/en/2.x/quickstart/ с полями id (int), name (string), created_at(datetime), active(bool) name - имя студента created_at - дата создаиня archived - если true тогда запись удалена
- Написать API методы (получаем запрос, обращаемся к БД, отдаём результат):
- GET /students
- POST /students
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import vk_api | |
def main(): | |
login, password = 'user@user.ru', '12345678' | |
vk_session = vk_api.VkApi(login, password) | |
try: | |
vk_session.authorization() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import requests | |
import vk_api | |
def main(): | |
login, password = 'user@user.ru', '12345678' | |
vk_session = vk_api.VkApi(login, password) | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo su - | |
VERSION=1.21.2 | |
mkdir -p /opt/bin | |
curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose | |
chmod +x /opt/bin/docker-compose | |
docker-compose --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/users/project/pydub/venv/bin/python /Users/users/project/pydub/test/test.py | |
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.................EEEE.......... | |
====================================================================== | |
ERROR: test_192khz_audio (__main__.AudioSegmentTests) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/Users/users/project/pydub/test/test.py", line 187, in setUp | |
test1 = AudioSegment.from_mp3(os.path.join(data_dir, 'test1.mp3')) | |
File "/Users/users/project/pydub/test/pydub/audio_segment.py", line 703, in from_mp3 | |
return cls.from_file(file, 'mp3', parameters) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestSerializers(serializers.Serializer): | |
type = serializers.CharField(max_length=200) | |
object = serializers.DictField( | |
lead_id=serializers.IntegerField(), | |
form_name=serializers.CharField(max_length=200), | |
answers=serializers.ListField( | |
serializers.DictField( | |
lead_id=serializers.IntegerField(), | |
key=serializers.CharField(max_length=200) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg-agent \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-key fingerprint 0EBFCD88 | |
sudo add-apt-repository \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from base64 import b64encode | |
from json import dumps, loads, JSONEncoder | |
import pickle | |
class AllTypeJSONEncoder(JSONEncoder): | |
def default(self, obj): | |
if isinstance(obj, (list, dict, str, int, float, bool, type(None))): | |
return super().default(obj) | |
elif isinstance(obj, (set, )): |
I hereby claim:
- I am skar404 on github.
- I am skar404 (https://keybase.io/skar404) on keybase.
- I have a public key ASD80XgMdVEtUrYVYd6Tm9nyZStaA7mtlGTiYHxI02Ja2Ao
To claim this, I am signing this object:
OlderNewer