django - URLField 附加到 'http://127.0.0.1:8000/'
问题描述
我有一个ULRField
我正在尝试使用的链接,href
但是当我点击它时,我会选择类似的东西http://127.0.0.1:8000/www.example.com
而不是www.example.com
模型.py
class Website(models.Model):
website = models.URLField(max_length=100)
模板.html
<a href="{{ dealer.website }}">{{ dealer.website }}</p>
解决方案
将我的评论移至答案:
使用协议保存值
https://
。
推荐阅读
- c - 向进程组中除自身以外的所有进程发出信号
- python - sqlalchemy 无法识别我的 mysql 数据库
- gnuradio - osmocom 源和 rtl-sdr 源的区别?
- java - JPA createStoredProcedureQuery 在使用 Hibernate 时抛出“ORA-01000: maximum open cursors exceeded”
- apache-nifi - 以编程方式读取 Nifi Counter 值
- java - 如何在 Java 中读取在线 XML 文件以了解汇率
- vba - VBA将公式添加到包含特定文本的单元格
- python - 如何将当前的 python 程序转换为多处理/多线程
- wpf - 在 2 个不同的网格视图中选择相同的项目
- java - 登录成功后换屏?(安卓工作室)