谷鸽或百度的镜像:
1、E:\django下建个文件夹名为搜索引擎→PyCharm新建项目选Django→location改为E:\django\搜索引擎→More
Settings的Application写个search
***************分割线***************
2、项目文件夹搜索引擎:
①settings.py,只改语言和时区
②urls.py:
from
django.conf.urls import url
from
django.contrib import admin
from search import views
urlpatterns = [
]
***************分割线***************
3、应用文件夹search:
①新建俩文件夹templates和static:templates里存放复制自谷鸽首页的googleIndex.html,和强子院子写的baiduIndex.html;static放images\so.gif等强子所做的百度前端样式。
******分割线******
②views.py:
from
django.shortcuts import render
from django.http import HttpResponse
import requests
from fake_useragent import UserAgent
def copySearchEngineData(word):
def index(request):
def so(request):
******分割线******
③baiduIndex.html:
{% load static from staticfiles
%}
<!doctype html>
<html>
<body>
</body>
</html>