Simon Willison’s Weblog

Subscribe

21st December 2007

Using Unipath to Keep Things Portable. Django tip to avoid hard-coding full paths. I usually set a global called OUR_ROOT in settings.py using os.path.dirname(__file__) and use os.path.join with it to construct any other paths that I need.

This is a link post by Simon Willison, posted on 21st December 2007.

Monthly briefing

Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments.

Pay me to send you less!

Sponsor & subscribe