欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

django html跳转页面跳转页面,Django html单击打开另一个html页面

发布时间:2023/12/4 编程问答 41 豆豆
生活随笔 收集整理的这篇文章主要介绍了 django html跳转页面跳转页面,Django html单击打开另一个html页面 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

我目前在使用django打开html页面时遇到了问题,尽管我已经尝试在网址.py, 视图.py,以及html页面。我的代码如下:

电池电流.py在“视图”文件夹下from __future__ import absolute_import

from __future__ import unicode_literals

from django.core.files.storage import default_storage

from django.core.urlresolvers import reverse_lazy

from django.http import HttpResponseRedirect

from django.utils import timezone

from django.views.generic import FormView, TemplateView

from sendfile import sendfile

import os.path

from .mixin import AjaxTemplateMixin, PermissionRequiredMixin, PageTitleMixin

from ..forms import DiagnosticsForm

from ..tasks import dump_diagnostics

from django.shortcuts import render

class DiagnosticMixin(PageTitleMixin, PermissionRequiredMixin):

permission_required = ['system.view_log_files']

page_title = 'Diagnostics'

form_class = DiagnosticsForm

class BatteryCurrentView(DiagnosticMixin,FormView):

template_name = 'system/batterycurrent.html'

def batterycurrent(request):

return render(request, 'system/batterycurrent.html')

网址.py

^{pr2}$

**电池电流.html在里面诊断.html. 在

电池电流.html(模板(html在系统文件夹中)

Battery Current Vs Timestamp

当我开始执行代码时,错误出现了i) importError batterycurrentView couldn't be imported

ii)Reverse for 'batterycurrent' with arguments '()' and keyword arguments '{}'

not found. 0 pattern(s) tried: []

请给我指点这个

总结

以上是生活随笔为你收集整理的django html跳转页面跳转页面,Django html单击打开另一个html页面的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。