Django restframe view access process source analysis

Access process source code analysis, here we mainly see how the user's request to access our view function. ...

Access process source code analysis, here we mainly see how the user's request to access our view function.

Note: be sure to follow the blogger's comments to see the code in Chinese and the following code!!!

1. Run project command: Python manage.py Here you can see the entry time of the program manage.py file

#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): # Load the global profile of the project os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mySwagger.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) from exc execute_from_command_line(sys.argv) if __name__ == '__main__': main()
Project's manage.py

1 June 2020, 05:37 | Views: 1364

Add new comment

For adding a comment, please log in
or create account

0 comments