项目介绍
我的家乡是邯郸市。邯郸市我国为数不多的3000年没有改变过名字城市。我的家乡就是邯郸。在我的家乡有非常多的旅游景点和美食。为了让更多的人了解到邯郸的旅游景点和好吃的美食信息,我通过python+vue+elementui开发了本次的邯郸家乡网红旅游景点美食导游平台。希望可以通过本平台让更多的人了解到这个三千多年历史沉淀中的诞生的古城中的景点和美食。
通过首页部分我们可以看到一些推荐的邯郸美景和美食内容。并可通过点击其图片查看美食和美景的详细内容。
开发环境
开发语言:Python
数据库 :MySQL
系统架构:B/S
后端框架:Django
前端框架:Vue
开发工具:Pycharm
支持定做:Java/PHP/Python/Android/小程序/Vue/爬虫/C#/Asp.net
系统截图
部分代码
def news_info(request,id_):
'''
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}
data = news.getbyid(news,news, int(id_))
if len(data)>0:
msg['data']=data[0]
#浏览点击次数
try:
__browseClick__= news.__browseClick__
except:
__browseClick__=None
if __browseClick__=="是" and "clicknum" in news.getallcolumn(news,news):
try:
clicknum=int(data[0].get("clicknum",0))+1
except:
clicknum=0+1
click_dict={"id":int(id_),"clicknum":clicknum}
ret=news.updatebyparams(news,news,click_dict)
if ret!=None:
msg['code'] = crud_error_code
msg['msg'] = ret
return JsonResponse(msg)
def news_detail(request,id_):
'''
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}
data =news.getbyid(news,news, int(id_))
if len(data)>0:
msg['data']=data[0]
#浏览点击次数
try:
__browseClick__= news.__browseClick__
except:
__browseClick__=None
if __browseClick__=="是" and "clicknum" in news.getallcolumn(news,news):
try:
clicknum=int(data[0].get("clicknum",0))+1
except:
clicknum=0+1
click_dict={"id":int(id_),"clicknum":clicknum}
ret=news.updatebyparams(news,news,click_dict)
if ret!=None:
msg['code'] = crud_error_code
msg['msg'] = retfo
return JsonResponse(msg)
def news_update(request):
'''
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}
req_dict = request.session.get("req_dict")
if req_dict.get("mima") and req_dict.get("password"):
if "mima" not in news.getallcolumn(news,news) :
del req_dict["mima"]
if "password" not in news.getallcolumn(news,news) :
del req_dict["password"]
try:
del req_dict["clicknum"]
except:
pass
error = news.updatebyparams(news, news, req_dict)
if error!=None:
msg['code'] = crud_error_code
msg['msg'] = error
return JsonResponse(msg)
def news_delete(request):
'''
批量删除
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}
req_dict = request.session.get("req_dict")
error=news.deletes(news,
news,
req_dict.get("ids")
)
if error!=None:
msg['code'] = crud_error_code
msg['msg'] = error
return JsonResponse
(msg)