期末做品檢查

1.期末做品檢查:基本要求 
css

檢查時間:18最後四節課,上課以前必須所有完成,上課作基本部署就開始檢查
方式:逐個運行演示,抽查代碼
主題:選一個主題,整個網站風格統一,佈局合理,儘可能美觀。html

2.期末做品檢查:必須完成:前端

網站父模板統一佈局:頭部導航條、底部圖片導航、中間主顯示區域佈局java

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}
     模板
    {% endblock %}</title>
{% block head %}
   <link rel="stylesheet" type="text/css" href="../static/css/text.css">
{% endblock %}
        <script>
        function mySwitch() {
            var myele=document.getElementById("on_off")
            if(myele.src.match("on")){
                myele.src="{{ url_for('static',filename='image/off.jpg') }}"
                document.getElementById("myBody").style.background="grey"
                document.getElementById("demo").style.color="antiquewhite"
            }
            else {
                myele.src="{{ url_for('static',filename='image/on.jpg') }}"
                document.getElementById("myBody").style.background="antiquewhite"
                document.getElementById("demo").style.color="black"
            }
        }
         </script>

</head>
<body id="myBody"style="background-color:antiquewhite;">
<nav class="aaa">
<form action="{{ url_for('search') }}" method="get">
    <img src="{{ url_for('static',filename='image/5.jpg') }}"style="height: 40px;width: 45px; ">
    <a href="http://www.iqiyi.com/">愛奇藝官網</a>
    <a href="http://www.aiqiyibofangqi.com/">APP下載</a>
    <a href="{{ url_for("wenda") }}">用戶問答</a>
    <a href="{{ url_for("shouye") }}">首頁</a>
    <input name="q" type="text" placeholder="請輸入搜索內容">
    <input type="submit" value="搜索">
</form>
<form class="search">
    {% if username %}
        <a  href="{{ url_for('all',user_id=session.get('userid'),tag='1') }}">{{ username }}</a>
        <a href="{{ url_for('logout') }} ">註銷</a>
    {% else %}
        <a  href="{{ url_for("denglu") }}">用戶登陸</a>
        <a href="{{ url_for("zhuce") }}">註冊</a>
    {% endif %}
    <img  class="light" id="on_off" onclick="mySwitch()" src="{{ url_for('static',filename='image/on.') }}" style="height: 40px;width: 35px; " >
</form>
</nav>
<hr>
{% block jiemian %}  {% endblock %}
</body>
</html>

註冊、登陸、註銷python

{% extends'base.html' %}

{% block title %}
用戶註冊
{% endblock %}

{% block jiemian %}
<script src="{{ url_for('static',filename='js/cc.js') }}"></script>
<link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='css/zhuce.css') }}">
<p>{{ username }}</p>
<div  class="container" >
    <form action="{{ url_for('zhuce') }}" method="post">
        <div class="header"><h2 align="center"  >新用戶註冊</h2></div>
        <div class="content" >
            <div class="input-box">
                <br>用戶暱稱<input id="un" type="text" name="username" placeholder="請輸入暱稱">
            </div>
            <div class="input-box">
                <br>輸入密碼<input id="pw" type="password" name="password"placeholder="請輸入密碼"><br>
            </div>
            <div class="input-box">
                <br>確認密碼<input id="tpw" type="password" name="pass"placeholder="請確認密碼"><br>
            </div>
            <div class="input-box">
          <br><button onclick="myLogin()">註冊</button>
             <div class="error_box"><br></div>
            </div>
        </div>
        <div class="footer" >版權*GZCC</div>
    </form>
</div>
{% endblock %}
function myLogin() {
    var one = document.getElementById("un");
    var two = document.getElementById("pw");
    var three = document.getElementById("error_box");
    var four = document.getElementById("tpw");
    if (two.value.length < 6) {
        three.innerHTML = "爲了帳號安全,請輸入6個以上的密碼!";
        return false
    }
    else if ((one.value.charCodeAt(0) >= 48) && one.value.charCodeAt(0) <= 57) {
        three.innerHTML = "帳號首個不能爲數字!";
        return false
    }
    else if (two.value != four.value) {
        three.innerHTML = "輸入密碼不一致!請從新輸入!";
        return false
    }
    else for (var i = 1; i < one.value.length; i++) {
            if ((one.value.charCodeAt(i) < 48 || one.value.charCodeAt(i) > 57) && (one.value.charCodeAt(i) < 97 || one.value.charCodeAt(i) > 122)) {
                three.innerHTML = "帳號只能爲數字!";
                return false
            }
        }

            if(one.value.length<6){
                three.innerHTML="帳號需爲6-12個長度!";
                 return false;
            }
          return true;
}

   

發佈、列表顯示mysql

詳情頁
評論、列表顯示
web

{% extends'base.html' %}

{% block title %}
問答平臺
{% endblock %}

{% block jiemian %}
<div  id="container" style="width:500px;margin: 0 auto " >
    <form action="{{ url_for('wenda') }}" method="post">
        <div id="header" style="background-color:lightblue;height: 40px"><h2 align="center" style="margin-bottom:0;font-size: 33px;font-family: 楷體" >問答平臺</h2></div>
        <div id="content" style="background-color:#EEEEEE;height: 280px;width:500px;float:left;text-align:center;font-size: 22px">
            <label for="aa">標題</label><br>
           <textarea  style="width: 400px" id="aa" name="title"></textarea><br>
            <label for="bb">詳情</label><br>
           <textarea  style="width: 400px"  id="bb"rows="9" name="detail"></textarea><br>
            <input  type="submit" value="提交"style="width:65px;height:25px;font-size:15px">
        </div>
        <div id="footer" style="background-color:lightblue;clear:both;text-align:center;height: 40px;font-size: 31px;font-family: 楷體">版權*GZCC</div>
    </form>
</div>
{% endblock %}
{% extends'base.html' %}
{% block title %}
問答詳情頁
{% endblock %}
{% block js %}{% endblock %}

{% block jiemian %}
<body bgcolor="antiquewhite"><link rel="stylesheet" type="text/css" href="../static/css/cc.css">
    <div class="d1">
        <form action="{{ url_for('comment') }}" method="post">
            <p><span class="timu">{{ ques.title }}<br></span>
            <p class="neir" >{{ ques.detail }}</p>
            <a href="{{ url_for('all',user_id=ques.author_id,tag='1') }}" class="a"><img class="people" src="{{ url_for('static',filename='image/people.png') }}"><span class="xm">{{ ques.author.username }}</span></a>
            <hr class="hr">
            <textarea class="pinglun" name='pinglun'></textarea>
            <input name="question_id" type="hidden" value="{{ ques.id }}">
            <br> <input  type="submit" value="發佈"style="width:65px;height:25px;font-size:15px">
            <p>評論:({{ ques.comments|length }})</p>
            <table border=1 >
                {% for foo in ques.comments %}
                    <tr><td>
                        <img class="people" src="{{ url_for('static',filename='image/people.png') }}">
                    <a href="{{ url_for('all',user_id=foo.author_id,tag=1) }}" class="name">{{ foo.author.username }}</a>
                     <span class="time" >{{ foo.creat_time }}</span><br>
                    <p class="nr">{{ foo.detail }}</p></td></tr>
                {% endfor %}
            </table>
        </form>
   </div>
</body>
{% endblock %}

我的中心
搜索,條件組合搜索
sql

{% extends 'base.html' %}
{% block title %}我的詳情{% endblock %}
{% block head %}
  <link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='css/dd.css') }}">
    {% endblock %}
{% block jiemian %}
        <div class="d1">
        <ul class="nav_url">
              <img src="{{ url_for('static',filename='image/wenhao.png') }}"><h4 role="presentation"><a href="{{ url_for('all',user_id=id,tag='1') }}" >所有問答</a></h4>
              <img src="{{ url_for('static',filename='image/wujiao.png') }}"><h4 role="presentation"><a href="{{ url_for('all',user_id=id,tag='2') }}">所有評論</a></h4>
              <img src="{{ url_for('static',filename='image/taiyang.png') }}"><h4 role="presentation"><a href="{{ url_for('all',user_id=id,tag='3') }}" >我的中心</a></h4>
        </ul>
            {% block user1 %}{% endblock %}
        </div>
{% endblock %}
{% extends "userbase.html" %}

{% block user1 %}
    {% for foo in questions%}
        <table border="1" >
                <tr><td>
                    <img class="people" src="{{ url_for('static',filename='image/people.png') }}"><a href="{{ url_for('all',user_id=foo.author_id,tag='1') }}" class="name">{{ foo.author.username }}</a><br>
                    <p>標題:{{ foo.title }}</p>
                    <p>{{ foo.detail }}</p></td></tr>
        </table>
     {% endfor %}<hr>
{% endblock %}
<form action="{{ url_for('search') }}" method="get">
    <img src="{{ url_for('static',filename='image/5.jpg') }}"style="height: 40px;width: 45px; ">
    <a href="http://www.iqiyi.com/">愛奇藝官網</a>
    <a href="http://www.aiqiyibofangqi.com/">APP下載</a>
    <a href="{{ url_for("wenda") }}">用戶問答</a>
    <a href="{{ url_for("shouye") }}">首頁</a>
    <input name="q" type="text" placeholder="請輸入搜索內容">
    <input type="submit" value="搜索">
</form>

  

  

一篇完整的博客
數據庫

我的學期總結flask

總結Python+Flask+MysqL的web建設技術過程,標準以下:
便是對本身所學知識的梳理
也可做爲初學入門者的簡單教程
也可做爲本身之後複習的嚮導
也是一種向外展現能力的途徑

我的學期總結

     時間很快,立刻大三的第一學期即將過去,回顧本身的信息管理系統這門課,在這一學期確實收穫了不少,從最基本的對一個信息系統的瞭解,到深刻理解如何將系統數據存入保存到數據庫MySQL中,下面對這學期的課程作一個簡單的梳理:

(1)開學第一課,老師帶領咱們瞭解了什麼是管理信息系統,因而對其有了一個大體的瞭解,接下來就是學習python語言中的一些基本庫,讓咱們燃起對python語言學習的慾望,印象深入是那次用turtle庫畫了五星紅旗爲祖國慶生。學習的還有一些條件查詢循環語句等……

(2)下面主要就是用pycharm軟件寫網頁系統,用html元素製做web頁面,作出頁面的導航條部分,因爲這些東西跟咱們平常的網站極爲類似,因此你們都燃起了學好頁面設計的慾望,登陸註冊,javascrip基礎,登陸前端驗證,後端將用戶數據存到後端的數據庫之中,這教給了咱們強大的網頁設計功能

(3)夜間模式的切換,關閉與開啓,父模板的製做,子模板繼承父模板與擴展,{block...}{endblock}

(4)用戶的發佈問答功能,將顯示在首頁,並記錄好發佈時間展現給瀏覽者,瀏覽對象經過用戶名進入查看文章詳情,並能發佈評論,雖然這些功能可能平時看起來簡單簡易,可是經過本身的代碼實現出來是一種成就,也是一種對知識的掌握。

(5)點擊詳情頁的用戶,能夠看到各用戶的我的中心,這對我說印象深入,由於我的中心須要繼承父模板,而後我的問答、評論又要繼承我的中心,這之間還需利用tag調轉頁面。邏輯緊密而且相互貫通。

(6)最後幾節課,老師教會咱們如何對密碼進行加密以及對模型的分離。

 

        爲數18周的信息管理系統的學習讓我感覺頗深,老師會常常發佈做業給咱們完成,這對於咱們是一種知識鞏固的方法,下面是對學好這門課的見解:

(1)不恥下問,我以爲這很重要,上課老師講的內容若是有不解的地方,要抓住機會問同窗,問老師,趁熱打鐵是學習知識最好的辦法。

(2)利用各網站搜索知識,讓本身的知識更強大。學習學的精要靠本身課後對加勤奮練習,現在科技發達,利用好網絡知識能夠學習到更多東西,好比css製做就能參考網站。

(3)多看網頁設計,多瀏覽相關書本,這不但可讓本身開拓眼界的同時還能夠愉悅本身。

 

      學完信息管理對一些架構的加深瞭解:

Python, 是一種面向對象、解釋型計算機程序語言。

Flask是一個使用 python編寫的輕量級 Web 應用框架,Flask也被稱爲 "microframework" ,由於它使用簡單的核心,用 extension 增長其餘功能。Flask沒有默認使用的數據庫、窗體驗證工具。

MySQL 是一種關聯數據庫管理系統,關聯數據庫將數據保存在不一樣的表中,而不是將全部數據放在一個大倉庫內,這樣就增長了速度並提升了靈活性。MySQL 所使用的 SQL 語言是用於訪問數據庫的最經常使用標準化語言。

python+flask+mysql能夠做爲咱們開發web網頁的一種工具,其功能咱們已經在課程上見證過,其強大須要咱們更多加學習去發現。

 

3.期末做品檢查:加分功能

文章分類、顯示點贊、收藏修改密碼、頭像、上傳頭像個人高級搜索

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息