keep it simple, sigit !

  1. Search
  2. Subscribe
  3. Archive
  4. Random
Newer
Older
  • Django settings tips

    In django settings.py you need to insert absolute path on some settings like this :

    MEDIA_ROOT = ‘/home/django/projects/media/’


    But if your folder path is in your current django project, it is good idea to use relatif path, here the code :

    import os
    rel = lambda *f: os.path.join(os.path.abspath(os.path.dirname(__file__)),*f)


    Type that code in top of your settings.py. Than to use it :

    MEDIA_ROOT = rel(‘media’)

    Posted on December 6, 2009

  • web-comics
  • staff
  • numskulls

Field Notes Theme. Designed by Manasto Jones. Powered by Tumblr.