Python+Mysql+bootstrap实现简单的web登录页面课设大作业(附源码)

项目说明:

开发环境:

Python 3.7 、PyCharm

框架:flask、bootstrap

数据库:Mysql 8.0

需要代码:看作者主页联系QQ

web效果:

Python+Mysql+bootstrap实现简单的web登录页面课设大作业(附源码)_第1张图片

登录成功后的跳转页面效果:

 全部页面长截图:

Python+Mysql+bootstrap实现简单的web登录页面课设大作业(附源码)_第2张图片

 Python+Mysql+bootstrap实现简单的web登录页面课设大作业(附源码)_第3张图片

 Python+Mysql+bootstrap实现简单的web登录页面课设大作业(附源码)_第4张图片

Python+Mysql+bootstrap实现简单的web登录页面课设大作业(附源码)_第5张图片

SQL数据库脚本:需要源代码的可以在以下截图中找到:

Python+Mysql+bootstrap实现简单的web登录页面课设大作业(附源码)_第6张图片

 sql .py文件:

Python+Mysql+bootstrap实现简单的web登录页面课设大作业(附源码)_第7张图片

项目源码访问地址如下:

腾讯文档腾讯文档-在线文档https://docs.qq.com/doc/p/71239d69a76f56cf1521717ae6b22c27cf876f10

import pymysql


def DB(user,password):
    db = pymysql.connect(host='localhost',
                         user='root',
                         password='123456',
                         database='book')

    cursor = db.cursor()

    sql = 'select * from user where username = "{}" and password = {}'.format(user, password)

    try:
        cursor.execute(sql)
        results = cursor.fetchall()
        if not results:
            return 0
        else:
            return 1
    except:
        return 0
    db.close()

 app.py:Python+Mysql+bootstrap实现简单的web登录页面课设大作业(附源码)_第8张图片

index.html页面代码:




    
    
    
    
    
    Carousel Template · Bootstrap v5.1

    
    

    



Heading

Some representative placeholder content for the three columns of text below the carousel. This is the first column.

View details »

Heading

Another exciting bit of representative placeholder content. This time, we've moved on to the second column.

View details »

Heading

And lastly this, the third column of representative placeholder content.

View details »


First featurette heading. It’ll blow your mind.

Some great placeholder content for the first featurette here. Imagine some exciting prose here.


Oh yeah, it’s that good. See for yourself.

Another featurette? Of course. More placeholder content here to give you an idea of how this layout would work with some actual real-world content in place.


And lastly, this one. Checkmate.

And yes, this is the last block of representative placeholder content. Again, not really intended to be actually read, simply here to give you a better view of what this would look like with some actual content. Your content.


 登录的页面:



  
    
    
    
    
    
    Signin Template · Bootstrap v5.1

    

    


    


    
    
  
  

欢迎登录


© 2022–至今

你可能感兴趣的:(网页开发HTML5,期末课程设计,前端,bootstrap,python,mysql)