[英]EmbedVideoField is not being imported
我正在嘗試實現視頻嵌入功能。 我想使用“django-embed-video”。
所以我下載了這樣的包:
pip3 install django-embed-video
然后我在 settings.py 文件中將“embed_video”添加到我已安裝的應用程序中
但是,當我嘗試從我的 models.py 文件中的“embed_video.fields”導入“EmbedVideoField”時,它並沒有被導入。 我不明白為什么會這樣? 我錯過了什么嗎?
請務必將其添加到settings.py
以檢測 HTTP(s)
TEMPLATE_CONTEXT_PROCESSORS = (
...
'django.core.context_processors.request',
)
像這樣從embed_video
包中導入EmbedVideoField()
。
from embed_video.fields import EmbedVideoField #important
video = EmbedVideoField() # same like models.URLField()
一定要遷移
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.