I use Django, Telegram and get stock information
- Telethon 에서 텔레그램 채팅 가져오기 (O)
- django-telethon use stackoverflow
- bootstrap url
- What is the most pythonic way to check if multiple variables are not None?
- Serializer and Swagger(drf-yasg) are introduction
- Dumpdata & Loaddata
- Change HOST: DB to HOST: localhost
- poetry run python manage.py dumpdata --exclude auth.permission --exclude contenttypes > stock.json
- poetry run python manage.py loaddata stock.json
- Change HOST: localhost to HOST: DB
- Mac(로컬) 에서 접근보다 docker-compose exec -it web /bin/bash 를 사용할 것
- I completed the kakao login and I think I'll make a jwt
- I make a 'Kakao Login(kakao_nickname)' + put in another information(sex, age, Id...)
- Worked to include kakao login informations in the database
- postgresql error: sorry, too many clients already
- vi /var/lib/postgresql/data/postgresql.conf
- change max_connections: 100 to 300
- docker restart container_id
- psql -U tim
- show max_connections 300 checked
- I don't know why nohup suddenly closed
- Django django_admin_log' doesn't exist
- poetry run python manage.py makemigrations admin
- poetry run python manage.py migrate admin zero --fake
- '# fake 데이터베이스에 적용이 된 것 처럼 '속인다''
- '# zero 마이그레이션 파일을 하나도 적용하지 않은 것처럼 로그들을 수정
1. 휴대폰 인증번호 없이 진행 되는 법 or 인증을 받지않고 지속적인 연결
* 현재는 휴대폰에서 인증번호를 받으면 값을 변경해서 실행하고 있음
서버가 종료되지 않으면 재인증은 필요없음
2. 네이버 카페
* 네이버 카페에 가입해야만 보이는 정보들이 존재함
가입을 안해도 되는 링크로 대체
3. 비동기로 텔레그램의 데이터를 실시간으로 가져올 수 있어야 한다.
* 3-1. Redis [poetry add redis]
* 3-2. Celery [poetry add Celery]
3-3. apscheduler [poetry add apscheduler 데이터 apscheduler 로 들어오는 것은 확인
4. nohup poetry run python get_telethon.py &
4-1. Run time of job "job_am (trigger: cron[hour='14', minute='0,15,30,53', second='1'], next run at: 2023-01-17 14:00:01 KST)" was missed by 0:20:16.952368
4-2. I think it makes an error.
4. message.media.webpage.photo
How do I use photo file_reference Link: stackoverflow
5. nohup problem
I use to 'nohup poetry run python get_telethon.py' in local but error by 'ModuleNotFoundError: No module named 'django.db.migrations.migration' But I use to 'nohup poetry run python get_telethon.py' in docker-compose it's not error and I have to check it out tomorrow
- Poetry
- poetry install
- poetry add
- poetry run python manage.py runserver 0.0.0.0:8000
Dockerdocker build -t stock .docker run -it -p 8000:8000 --name container -v /Users/cslee/vscode/stock:/code/ stock-v(볼륨) 옵션 : 코드가 수정되면 감지하고 재시작-e(environment) *옵션 : 중요
- Docker-compose
- docker-compose up -d --build
- and a m1 mac 'platform: linux/amd64' in docker-compose
- env_file ./.env and set ${POSTGRES_DATABASE}
- django-environ
1.
import environ env = environ.Env(DEBUG=(bool, True)) environ.Env.read_env( env_file=os.path.join(BASE_DIR, '.env') ) SECRET_KEY = env('SECRET_KEY') and Don't ever use 'space bar' A = 'A' (x) A='A' (O)