Changes between Version 1 and Version 2 of Ticket #23436
- Timestamp:
- Sep 6, 2014, 4:56:14 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23436 – Description
v1 v2 8 8 9 9 {{{ 10 11 12 10 python manage.py shell 11 >>> from django.conf import settings 12 print(BASE_DIR) 13 13 }}} 14 14 … … 16 16 17 17 {{{ 18 19 18 python -i myproject/settings.py 19 >>> print(BASE_DIR) 20 20 }}} 21 21 22 22 As an aside, in general, in any path wrangling you should always call abspath first. Try running this script, saved to a file: 23 23 24 import os 25 print(os.path.abspath(os.path.dirname(os.path.dirname(__file__)))) 26 print(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 24 {{{ 25 import os 26 print(os.path.abspath(os.path.dirname(os.path.dirname(__file__)))) 27 print(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 28 }}} 27 29 28 30 As to tests, the only one I can think of would be a pretty horrible one involving actually callling out using subprocess.Popen to a python -i of the project template settings file, so maybe ok not to bother?