随笔分类 -  Django

摘要:def short_process_all(self): if len(str(self.process_all)) > 30: return '{}...'.format(str(self.process_all)[0:29]) else: return str(self.process_all) 阅读全文
posted @ 2022-10-09 08:52 橘白CC 阅读(64) 评论(0) 推荐(0)
摘要:def get_export_filename(self, request, queryset, file_format): old_name = super().get_export_filename(request, queryset, file_format) date = datetime. 阅读全文
posted @ 2022-10-08 18:14 橘白CC 阅读(30) 评论(0) 推荐(0)
摘要:def xnn_image(self, obj): try: img = mark_safe( '<a href="{}" target="_blank"><img src="{}" width="25px" height="25px"/></a>'.format( obj.legend_mf.ur 阅读全文
posted @ 2022-10-08 18:13 橘白CC 阅读(40) 评论(0) 推荐(0)
摘要:用的笨方法,引用的china.js包,包在百度网盘联系分享 <script src="{%static './js/china.js'%}"></script> <!-- <script type="text/javascript" src="https://api.map.baidu.com/ap 阅读全文
posted @ 2022-09-29 22:23 橘白CC 阅读(58) 评论(0) 推荐(0)
摘要:STATIC_URL = 'static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'), ) 阅读全文
posted @ 2022-09-29 22:21 橘白CC 阅读(26) 评论(0) 推荐(0)
摘要:<div class="col-sm-4"> <div id="main0" style="wight:400px;height: 400px;border: 1px solid #f5f7fa;border-radius: 7px;background:#f5f7fa"> <script src= 阅读全文
posted @ 2022-09-29 15:24 橘白CC 阅读(180) 评论(0) 推荐(0)
摘要:InlineModelAdmin class InlineModelAdmin class TabularInline class StackedInline 举例,有两个Model: from django.db import models class Author(models.Model): 阅读全文
posted @ 2022-09-14 15:49 橘白CC 阅读(266) 评论(0) 推荐(0)
摘要:1、创建新建项目python django-admin.py startproject #项目名称pip django-imagekit1.1项目内容settings.py是项目的整体配置文件,系统的数据库配置、应用配置和其他配置urls.py是项目的URL配置文件,web工程Url映射的配置wsg 阅读全文
posted @ 2022-08-01 18:13 橘白CC 阅读(73) 评论(0) 推荐(0)