In python, libraries under a directory belonging to a certain path can be imported.
A path is: The priority is
import sys
print sys.path
Then the path will be returned in the list so you can check which libraries can be imported.
By the way, the module of the project created by django can be automatically imported as a library by the following mechanism.
# -*- coding:utf-8 -*-
import sys, os
# project_directory is the django project directory
#Example) /var/user/django_test_Project path such as project
sys.path.append(os.path.join(project_directory, os.pardir))
import django_test_project
If there is no error in, it is OK.
Recommended Posts