【发布时间】:2018-01-19 06:57:55
【问题描述】:
我在 Python 中创建了一个网络爬虫,现在我想将此文件插入到我的 views.py 中,并使用在 HTML 页面上创建的 HTML 按钮执行它们。
我的爬虫名称是 maharera.py,它保存在我保存 views.py 的同一文件夹中
我的 views.py 看起来像这样:
from django.shortcuts import render
from django.conf.urls import url
from django.conf.urls import include
from django.http import HttpResponse
# Create your views here.
def index(request):
first = {"here":"will enter more details"}
return render(request, "files/first-page.html", context=first)
#return HttpResponse("<em>Rera details will be patched here</em>")
将它插入views.y 后,我想使用我创建的html HTML 执行该文件。我该怎么做?
【问题讨论】:
标签: django python-3.6