diff --git a/blog/context_processors.py b/blog/context_processors.py index 128526a..05882d6 100644 --- a/blog/context_processors.py +++ b/blog/context_processors.py @@ -41,6 +41,7 @@ def seo_processor(requests): 'OPEN_SITE_COMMENT': setting.open_site_comment, 'BEIAN_CODE': setting.beiancode, 'ANALYTICS_CODE': setting.analyticscode, + "BEIAN_CODE_GONGAN": setting.gongan_beiancode } cache.set(key, value, 60 * 60 * 10) diff --git a/blog/models.py b/blog/models.py index 7eb4ddd..35e649b 100644 --- a/blog/models.py +++ b/blog/models.py @@ -246,7 +246,9 @@ class BlogSettings(models.Model): google_adsense_codes = models.TextField('广告内容', max_length=2000, null=True, blank=True, default='') open_site_comment = models.BooleanField('是否打开网站评论功能', default=True) beiancode = models.CharField('备案号', max_length=2000, null=True, blank=True, default='') - analyticscode=models.TextField("网站统计代码", max_length=1000, null=False, blank=False, default='') + analyticscode = models.TextField("网站统计代码", max_length=1000, null=False, blank=False, default='') + gongan_beiancode = models.TextField('公安备案号', max_length=2000, null=True, blank=True, default='') + class Meta: verbose_name = '网站配置' verbose_name_plural = verbose_name diff --git a/templates/share_layout/footer.html b/templates/share_layout/footer.html index e0f165c..3aa8452 100644 --- a/templates/share_layout/footer.html +++ b/templates/share_layout/footer.html @@ -31,7 +31,14 @@ {% if BEIAN_CODE %}
+ {{ BEIAN_CODE }} +
+ + {% if BEIAN_CODE_GONGAN %} + {{ BEIAN_CODE_GONGAN |safe }} + {% endif %}