Преглед на файлове

Update docs/userguide/tasks.rst

Using os.getcwd() will produce unexpected results since it is based on the current working directory at the time the command is run. It looks fragile to me. The proposed approach uses the location of the setting module itself to determine the appropriate path.
Olivier Aubert преди 12 години
родител
ревизия
5b9f382034
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      docs/userguide/tasks.rst

+ 1 - 1
docs/userguide/tasks.rst

@@ -176,7 +176,7 @@ add the project directory to the Python path::
 
     import os
     import sys
-    sys.path.append(os.getcwd())
+    sys.path.append(os.path.dirname(os.path.basename(__file__)))
 
     INSTALLED_APPS = ('myapp', )