Git Product home page Git Product logo

web_final_backend's Introduction

web 期末大作业:北京林业大学夏令营报名系统

本系统后端使用 django rest framework 开发 REST 风格 API,使用 JWT 对 API 进行保护,以 sqlite3 作为数据库。前端以 Angular 9 作为基础框架,使用阿里开发的 Ant Design 组件库进行辅助开发。

项目代码同时步放在了 github 上:前端后端

系统目前运行在我的阿里云服务器上 阿里云

实现功能如下:

  • 用户注册、登录
  • 用户分级管理
  • 信息公告和通知
  • 学生报名功能
  • 学生管理

依赖

后端

  • sqlite3
  • nginx
  • python3.6
  • django
  • djangorestframework
  • djangorestframework-jwt
  • django-cors-headers
  • usgi

前端

  • node
  • angular9
  • Ant-Design: ng-zorro

启动测试 / 部署

后端

# 安装环境
pip install -r requirements.txt

# 初始化项目
python manage.py migrate

# 创建超级用户
python manage.py createsuperuser --email [email protected] --username admin

# 管理数据
python manage.py shell 
from backend.models import Student 
s = Student.objects.all() 

前端

# 安装 angular 客户端
npm install -g @angular/cli@9

# 安装依赖
npm install

# 开发环境测试
ng run serve

# 生产环境编译
ng build --prod

nginx 部署

location / {
    root /home/user/homepage;
    index index.html;
    try_files $uri $uri/ /index.html;
}

前端使用

/login

正常登陆界面,面向广大用户

:8000/admin

系统管理员界面,面向招生办工作人员,在内网使用

管理员创建:

python manage.py createsuperuser --username=username [email protected]

REST 接口

名称 动作 功能 测试
api-token-auth POST 登陆,获取 token api_test.user_test.get_token
api-token-verify POST 验证 token api_test.user_test.verify_token
logon POST 创建用户 api_test.user_test.create_user
users GET 获取所有学生信息 api_test.user_test.get_users
student GET 当前登陆学生获取信息 api_test.student_test.get_student
student POST 当前登陆学生提交信息 api_test.student_test.post_student

web_final_backend's People

Contributors

quaeast avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.