The first line placeholder
First, the project needs analysis, business logic analysis
Project requirements:
1. Home Display
2. User Login Register
3. Courses display, display Course Details
4. Video Playback
5. Add the shopping cart, shopping cart adjust
6. Create Order
7. payment
Business logic:
1. Go to Home
2. Click to view a list of courses
3. Click to enter the course details
4. Click to play video
5. Go to the login page is not logged in, logged on to check for permission, then you have permission to enter the play page, without permission remind purchase
6. Add the shopping cart, create an order, pay
Home Module
FIG rotation: image + link interface provides
Navigation: name + link
log in Register
log in:
Django authentication system provided by default based on the introduction of the project to replace the authentication mechanism JWT Session mechanism, the identity of the user credentials stored in the Token, and then docking Django's authentication system, log on
Django REST framework JWT provides a view of obtaining login token, you can use the default direct return value only token, in order to facilitate the display of the current logged-on user, modify the default view jwt return value, id with username increase in the client page
Django model class user authentication system and method provides very convenient, but can not meet the needs of the project, such as field holds no phone number, so we extended the model classes it offers users
Multi-condition registering: JWT extended login view, when you receive a user name and password, but also a call to authenticate Django authentication system provided () to check the user name and password are correct.
We support login account by modifying the authentication backend Django authentication system (primarily authenticate method) can be either a user name or a phone number
Pole test verification:
1. The serial number request verification page is loaded toward the rear end
2. Slide successfully completed, the slide transmits the results to verify the rear end, the front end returns to allow the verification is successful login button click message
SMS registration:
1. Click the Send SMS
2. The messages will be stored in redis, and to remind the front sent successfully
3. Click the registration, verification code entered with the code inside redis contrast, the success of the next step
course
Implement the program in django-filter module classification display, use drf sorting and paging functions implemented curriculum paging and sorting
sorting classes:
The default is not classified, show all
Course shows:
The curriculum includes courses show classification, course information, course section, class information, teacher information, pricing strategy content
Details page:
CKEditor rich text editor, Paul Wolff, a user request to the backend token and play video
Video Player
Paul Leeway use video services platform, to achieve video playback charge, with the help of Paul Wolff development documents
Specific processes are: a front end to the rear end of the video playback request token, the rear end of the front end to the authentication of the sender can obtain the correct token video front end to get the token security acquires video Wolff.