Changes between Version 1 and Version 2 of Ticket #23436


Ignore:
Timestamp:
Sep 6, 2014, 4:56:14 AM (10 years ago)
Author:
Harry Percival
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23436 – Description

    v1 v2  
    88
    99{{{
    10     python manage.py shell
    11     >>> from django.conf import settings
    12     print(BASE_DIR)
     10python manage.py shell
     11>>> from django.conf import settings
     12print(BASE_DIR)
    1313}}}
    1414
     
    1616
    1717{{{
    18     python -i myproject/settings.py
    19     >>> print(BASE_DIR)
     18python -i myproject/settings.py
     19>>> print(BASE_DIR)
    2020}}}
    2121
    2222As an aside, in general, in any path wrangling you should always call abspath first. Try running this script, saved to a file:
    2323
    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{{{
     25import os
     26print(os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
     27print(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
     28}}}
    2729
    2830As 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?
Back to Top