Invalid absolute path in settings.py file

Issue #1149 invalid
Anonymous created an issue

I am new to Django, so if i am wrong kindly forgive..

I created a project using clonesatchmo.py and in the local_settings.py file

DIRNAME appeared as :

DIRNAME = os.path.dirname(os.path.abspath(file))

which to my knowledge should look like as:

DIRNAME = os.path.abspath(os.path.dirname(file))

Thank You!

Comments (2)

  1. Chris Moffitt repo owner

    As far as I can tell these are functionally equivalent.

    If I have this file:

    import os
    
    print os.path.dirname(os.path.abspath(__file__))
    print os.path.abspath(os.path.dirname(__file__))
    

    When I run it, I get the same output. Please try on your system and tell me if you get something different.

  2. Tay Ray Chuan

    Off-hand, I agree they are equivalent, but I think our current

    os.path.dirname(os.path.abspath(__file__))
    

    sanitize-before-parse approach seems more correct.

    Please re-open if this is a problem.

  3. Log in to comment