Month: July 2022

line bot 發佈文字訊息(push text message) 流程

可參考 https://learn.markteaching.com/%E3%80%90chatbot-%E6%95%99%E5%AD%B8%E3%80%91-line%E6%A9%9F%E5%99%A8%E4%BA%BA-%E7%99%BC%E4%BD%88%E6%96%87%E5%AD%97%E8%A8%8A%E6%81%AFpush-text-message/   首先需要在Line 控制台取得 User id 接著再程式碼內新增一個方法(method) 最後就是發佈文字訊息就能搞定啦!   下面示範的是當user 對line BOT 說 “GetUID”, line BOT 就會回傳其UID, 再主動發一個MESSAGE 給該USER~ if event.message.text == “GetUID”: uid = event.source.user_id login_status = “not-member” line_bot_api.reply_message(event.reply_token, TextSendMessage(text=uid)) line_bot_api.push_message(uid, TextSendMessage(text=login_status)) Read More

‘staticfiles’ is not a registered tag library. Must be one of

可參考 https://stackoverflow.com/questions/55929472/django-templatesyntaxerror-staticfiles-is-not-a-registered-tag-library Read More

ImportError: cannot import name ‘url’ from ‘django.conf.urls’ (在Django 4 用舊版本指令的後果)

可參考 https://www.youtube.com/watch?v=cRrShdhqyuM 開啟 urls.py : from django.urls import path, include, re_path from django.urls import re_path as url     Read More

How to Use venv to Create Virtual Environments in Python 3 (建立虛擬環境)

python – m venv [name_by_you] Read More

“’django-admin’ is not recognized as an internal or external command,” 解決方法

python -m venv venv venv\Scripts\activate pip install django django-admin startproject mysite Read More

wpChatIcon