1.在views中添加一个def 为homepage
basepath=os.getcwd()+'\\dockerApp\\app\\templates\\';
def homepage(request):
    response=render_to_response(basepath+"index.html");
    return response
 
2.在urls.py中添加红色部分
from django.conf.urls import include, url
from django.contrib import admin
from app.views import *;
admin.autodiscover()

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$',homepage),
    url(r'^getdata/$',getdata)
]
 

相关文章:

  • 2021-10-04
  • 2022-01-21
  • 2021-09-10
  • 2021-11-12
  • 2022-03-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-08
  • 2022-02-17
  • 2022-12-23
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2021-04-17
相关资源
相似解决方案