我想做的是调用已经在Django视图中创建的模块(RSAtest
)。我正在从AboutPageView调用RSAtest模块中的函数。但由于某些原因,它显示以下错误:ModuleNotFoundError:No module name'webapp.functional网站'你能告诉我如何使用Django中的模块吗?你知道吗
# howdy/views.py
from django.shortcuts import render
from django.views.generic import TemplateView
from webapp.functional import RSAtest
class HomePageView(TemplateView):
def get(self, request, **kwargs):
return render(request, 'index.html', context=None)
# Add this view
class AboutPageView(TemplateView):
RSAtest.main()
#os.system('python3 howdy/RSAtest.py')
template_name = "about.html"
谢谢你的帮助。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐