Python project shares music website system based on Django

0 Preface

Hi, everyone, today I will introduce to you a python management system that you can use in your own course design or graduation design!

What I want to share today is: graduation project music website system based on Django

Project sharing:

https://gitee.com/sinonfin/system-sharing

1 Design description

Enter the command "python manage.py runserver" in the virtual environment to start the project. After successful startup, visit "http://127.0.0.1:5000" to enter the homepage of Sweet Orange Music Network, as shown in Figure 1. In this page, users can browse carousels, popular singers and popular songs;

Insert image description here

In the navigation bar, click the "ranking list" hyperlink, and the song ranking list will be displayed, as shown in Figure 2. Click the "Genre" hyperlink to display songs in different languages, as shown in Figure 3. Clicking the "Singer" hyperlink will display all singers, as shown in Figure 4.

Insert image description here

Insert image description here
Insert image description here

On each page, click the play button to play music, as shown in Figure 5.

Insert image description here

Click the Collection button. If you are already logged in, you can collect the song, as shown in Figure 6. If you are not logged in, you will be prompted to log in.

Insert image description here

In the Sweet Orange Music Network, click the "Login" hyperlink at the top to display the login page, through which the login function can be implemented, as shown in Figure 7; if you have not registered yet, you need to register as a member first, the registration page As shown in Figure 8.

Insert image description here

This project has no backend, but you can manage songs and singers through the administrator account. The account number and password are as follows:
Account: mr
Password: mrsoft
In the Sweet Orange Music Network, the administrator can log in to the website through the administrator account, and then hover the mouse over the user name to display the "Backstage Management" menu, as shown in Figure 9 .

Insert image description here

Click the "Backend Management" hyperlink to enter the singer management page, as shown in Figure 10.

Insert image description here
In the singer management page, click "Add Singer" to enter the new singer page, as shown in Figure 11. Fill in the singer picture path in the singer picture column, such as 1.jpg. Then copy the singer's picture 1.jpg to the "OnlineMusic\app\static\images\artist\" path, as shown in Figure 12.

Insert image description here

Insert image description here
Click the "Backend Management" hyperlink to enter the singer management page, as shown in Figure 13. Click the "Add Song" button and fill in the song path in the song file address bar, such as 53.mp3. Then copy the singer's mp3 file to the "OnlineMusic\app\static\images\song\" path, as shown in Figure 14.

Insert image description here

Some related source codes

# _*_ coding: utf-8 _*_
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, FileField, TextAreaField
from wtforms.validators import DataRequired, Email, Regexp, EqualTo, ValidationError
from app.models import User

class RegisterForm(FlaskForm):
    """
    用户注册表单
    """
    username = StringField(
        validators=[
            DataRequired("用户名不能为空!"),
        ],
        description="用户名",
        render_kw={
    
    
            "placeholder": "请输入用户名!",
        }
    )
    email = StringField(
        validators=[
            DataRequired("邮箱不能为空!"),
            Email("邮箱格式不正确!")
        ],
        description="邮箱",
        render_kw={
    
    
            "type": "email",
            "placeholder": "请输入邮箱!",
        }
    )
    pwd = PasswordField(
        validators=[
            DataRequired("密码不能为空!")
        ],
        description="密码",
        render_kw={
    
    
            "placeholder": "请输入密码!",
        }
    )
    repwd = PasswordField(
        validators=[
            DataRequired("请输入确认密码!"),
            EqualTo('pwd', message="两次密码不一致!")
        ],
        description="确认密码",
        render_kw={
    
    
            "placeholder": "请输入确认密码!",
        }
    )
    submit = SubmitField(
        '注册',
        render_kw={
    
    
            "class": "btn btn-primary",
        }
    )

    def validate_email(self, field):
        """
        检测注册邮箱是否已经存在
        :param field: 字段名
        """
        email = field.data
        user = User.query.filter_by(email=email).count()
        if user == 1:
            raise ValidationError("邮箱已经存在!")


class LoginForm(FlaskForm):
    """
    登录功能
    """
    email = StringField(
        validators=[
            DataRequired("邮箱不能为空!")
        ],
        description="邮箱",
        render_kw={
    
    
            "type"       : "email",
            "placeholder": "请输入邮箱!",
        }
    )
    pwd = PasswordField(
        validators=[
            DataRequired("密码不能为空!")
        ],
        description="密码",
        render_kw={
    
    
            "type"       : "password",
            "placeholder": "请输入密码!",
        }
    )
    submit = SubmitField(
        '登录',
        render_kw={
    
    
            "class": "btn btn-primary",
        }
    )

class SuggetionForm(FlaskForm):
    """
    意见建议
    """
    name = StringField(
        label="姓名",
        validators=[
            DataRequired("姓名不能为空!")
        ],
        description="姓名",
        render_kw={
    
    
            "placeholder": "请输入姓名!",
            "class" : "form-control"
        }
    )
    email = StringField(
        label="邮箱",
        validators=[
            DataRequired("邮箱不能为空!")
        ],
        description="邮箱",
        render_kw={
    
    
            "type"       : "email",
            "placeholder": "请输入邮箱!",
            "class" : "form-control"
        }
    )
    content = TextAreaField(
        label="意见建议",
        validators=[
            DataRequired("内容不能为空!")
        ],
        description="意见建议",
        render_kw={
    
    
            "class": "form-control",
            "placeholder": "请输入内容!",
            "rows" : 7
        }
    )
    submit = SubmitField(
        '发送消息',
        render_kw={
    
    
            "class": "btn-default btn-cf-submit",
        }
    )





Project sharing

Project sharing: complete source code + environment configuration document + design manual

https://gitee.com/sinonfin/system-sharing

Guess you like

Origin blog.csdn.net/mabile123444/article/details/135454533