I think all features has been implemented in rush, thus there too many coding standard has been violated
not follow pep8
standard for python code
- using
tabs
intention instead ofspaces
,spaces
is recommended for replacingtabs
long ago. - no space after
:
in dict declaration - import statements is not grouped and sorted
- too many code duplication, eg: generating unique
id
inmodels
- module level definition (class, module's method) is separated by only 1 empty line instead of 2 empty lines
- There is no admin in
account
andvideos
mean it's really hard to control the behavior of the system, also it's hard for QA testing too - All
view
have been implemented in only 1 fileviews
, which is really hard for adding new features later, also it increases the changes of having code conflict when have multiple engineers work on same file. - The JSON response is not well defined. Sometime I see
JSONResponse({"d"}, status=400)
, sometimeJSONResponse("Unknown Video", status=400)
- Since we use
djangorestframework
, we can use the defined statuses in that package, instead of using raw number response code - Test is mostly check for the response status code, not the expected result and behavior of the system, we can add more assertion to make tests have more meaningful.
- Some part of code are not necessary, like this one
from email_info import *
EMAIL_USE_TLS = EMAIL_USE_TLS
EMAIL_HOST = EMAIL_HOST
EMAIL_HOST_USER = EMAIL_HOST_USER
EMAIL_HOST_PASSWORD = EMAIL_HOST_PASSWORD
EMAIL_PORT = EMAIL_PORT```
The last 5 lines is not eccessary
- what
> Written with [StackEdit](https://stackedit.io/).