文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Django Settings Site Domain example.com

Django Settings Site Domain example.com

时间:2009-04-05  来源:cobrawgl

It took me a while to figure out how to change from the default, example.com. Maybe it should have been obvious, but I was looking in all the wrong places and every search I did wouldn’t come up with an answer. As I discovered, it isn’t a setting in the settings.py file. It’s something that is in the database. You can change it through the Django admin interface, phpMyAdmin, or how ever you feel comfortable. It’s in the django_site table. When setting SITE_ID in settings.py it is the ID in this table. And this is the information that Site.objects.get_current().domain uses. Which is awesome for rss feeds and e-mails that you send out or anytime you need the domain in a link.

from django.contrib.sites.models import Site domain = Site.objects.get_current().domain
排行榜 更多 +
XLM币最具爆发力的安全交易所币安binance下载

XLM币最具爆发力的安全交易所币安binance下载

金融理财 下载
XEM币最安全隐私链的全球交易所币安binance下载

XEM币最安全隐私链的全球交易所币安binance下载

金融理财 下载
WAVES币最新上线的优质交易所币安binance下载

WAVES币最新上线的优质交易所币安binance下载

金融理财 下载