openrosa_headers_mixin.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:fieldsight-kobocat 作者: awemulya 项目源码 文件源码
def get_openrosa_headers(self, request, location=True):
        tz = pytz.timezone(settings.TIME_ZONE)
        dt = datetime.now(tz).strftime('%a, %d %b %Y %H:%M:%S %Z')

        data = {
            'Date': dt,
            'X-OpenRosa-Version': '1.0',
            'X-OpenRosa-Accept-Content-Length': DEFAULT_CONTENT_LENGTH
        }

        if location:
            data['Location'] = request.build_absolute_uri(request.path)

        return data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号