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

在Django项目中遇到HTML页面跳转问题,尝试在urls.py、views.py和HTML页面设置跳转,但遇到错误:i) importError batterycurrentView couldn't be imported,ii) Reverse for 'batterycurrent'失败。问题出在视图和URL配置上,需检查相关代码并修复。

我目前在使用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: []

请给我指点这个

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值