期末作品检查
光阴似箭,日月如梭,这学期的管理信息系统已然接近尾声。通过这一学期的学习,我们已对Python,Flask和MysqL的web建设技术有了基础的了解。以下为我的本学期个人总结:
万丈高楼平地起,管理信息系统这门课程也是如此。我们先从管理信息系统最基础的练习学起,如:简单输入输出交互;用户输入两个数字,计算并输出两个数字之和;输入半径,计算圆的面积;画一组同切圆、同心圆、五角星、左上角的五颗黄色实心五角星;条件、循环、函数定义;字符串基本操作;中英文词频统计预备、组合数据类型练习等诸如此类的基础入门练习。通过这些练习,我们对管理信息系统,Python有了初步的了解和认识。
紧接着老师开始教我们web基础,用html元素制作web页面。我觉得这方面最重要的是要细心去观察常用网页,区分它们不同组成部分、HTML元素,运用在实际web页面制作中。以下为我运用web基础、导航、头部、CSS基础,使用下拉列表选择框,无序列表,有序列表,定义列表 。第一次制作,十分粗糙。
使用JavaScript基础,如document.write() 方法、 window.alert()、innerHTML,完成道路与注册页面的前端
开始Flask项目,设置调试模式,理解Flask项目主程序,使用装饰器,设置路径与函数之间的关系,使用Flask中render_template,用不同的路径,返回首页、登录员、注册页,用视图函数反转得到URL,{{url_for(‘login’)}},完成导航条里的链接。以下为主py的主要代码:
from flask import Flask,render_template app = Flask(__name__) @app.route('/') def index(): return render_template('index.html') @app.route('/login/') def login(): return render_template('login.html') @app.route('/regist/') def regist(): return render_template('regist.html') if __name__== '__main__': app.run(debug=True)
制作网站网页共有元素的父模板html,包括顶部导航,中间区块划分,底部导航,底部说明等,汇总相关的样式形成独立的css、js文件,形成完整的base.html+css+js
安装与配置python3.6,flask和mysql数据库,mysql创建数据库,数据库配置信息config.py,建立mysql和app的连接,创建用户模型。
之后我们还学习了发布问答功能,用户注册登录后可通过此功能发布问答。
问答详情功能,用户可以点击感兴趣的问题,进行评论或回复。
还有个人详情功能,用户可以通过此功能查询其他用户或者自己的全部问答、全部评论和个人资料。
‘’
用户还可通过搜索导航搜索输入关键字搜索发布过的内容
首页显示
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>{% block title %} {% endblock %}新年快乐</title> <link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='css/20.css') }}"> {% block head %} {% endblock %} </head> <header class="navbar-wrapper"> <div class="navbar navbar-black"> <div class="container cl"> <form action="{{ url_for('search') }}" method="get" style="text-align: center;float: right;"> <img id="on_off" onclick="mySwitch()" src="{{ url_for('static',filename='images/pic_bulboff.gif') }}" style="height: 32px;width: 22px; " > <input name="q" type="text" placeholder="搜索从这里开始..." style="width: 180px;padding-left:14px;height: 28px;border: 2px solid #7BA7AB;border-radius: 5px;outline: none;background: #F9F0DA;color: #9E9C9C;"> <button type="submit" style="width: 55px;height: 31px;border: none;background: #ffa692;border-radius: 0 5px 5px 0;cursor: pointer;">查找</button> </form> <nav class="nav navbar-nav nav-collapse" role="navigation" id="Hui-navbar"> <ul class="cl"> <li><a class="logo navbar-logo f-l mr-10 hidden-xs" href="{{ url_for('index') }}">首页</a></li> {% if username %} <li><a href="#">{{ username }}</a></li> <li><a href="{{ url_for('logout') }}">注销</a></li> {% else %} <li><a href="{{ url_for('denglu')}}">登录</a></li> <li><a href="{{ url_for('zhuce') }}">注册</a></li> {% endif %} <li><a href="{{ url_for('question') }}">发布问答</a></li> </ul> </nav> </div> {% block main %} <div class="container"> <img src="../static/images/xinnian.jpg" alt="Norway" width="1000" height="300"> <div class="center"></div> {% endblock %} <footer class="footer mt-20"> <ul class="footer1-sns"> <style> li{display:inline;} </style> <p>年货购买请戳→</p> <li><a href="https://www.jd.com"><img src="https://wx4.sinaimg.cn/thumb300/006OKZ75ly1fmpur9hp8kj30u01hcb29.jpg" style="height:60px; width:60px"><br>淘宝</a></li> <li><a href="https://www.taobao.com"><img src="https://wx3.sinaimg.cn/mw690/7410164egy1fmsca23tt3j20wu1fb7wj.jpg" style="height:60px; width:60px"><br>京东</a></li> <li><a href="https://jx.tmall.com"><img src="../static/images/tx.jpg" style="height:60px; width:60px" ><br>天猫超市</a></li> </ul> <div class="container-fluid"> <nav> <a href="#" target="_blank">关于我们</a> <span class="pipe">|</span> <a href="#" target="_blank">联系我们</a> <span class="pipe">|</span> <a href="#" target="_blank">法律声明</a> </nav> <p>Copyright ©2016 H-ui.net All Rights Reserved. <br> <a href="http://www.miitbeian.gov.cn/" target="_blank" rel="nofollow">京ICP备1000000号</a><br> </p> </div> </footer> <nav class="navbar-userbar hidden-xs"></nav> </div> </div> </header> </html>
以上系统尚有不完善之处,我将在接下来的学习实践中继续努力,砥砺前行,争取有所进步。