2014-05-08 16:59:35 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
|
2015-03-31 12:39:08 +00:00
|
|
|
def get_project_dir():
|
2014-05-08 16:59:35 +00:00
|
|
|
""" Return the current project path site/project """
|
|
|
|
from django.conf import settings
|
|
|
|
settings_file = os.sys.modules[settings.SETTINGS_MODULE].__file__
|
|
|
|
return os.path.dirname(os.path.normpath(settings_file))
|
|
|
|
|
|
|
|
|
|
|
|
def get_project_name():
|
|
|
|
""" Returns current project name """
|
2015-03-31 12:39:08 +00:00
|
|
|
return os.path.basename(get_project_dir())
|
2014-05-08 16:59:35 +00:00
|
|
|
|
|
|
|
|
2015-03-31 12:39:08 +00:00
|
|
|
def get_site_dir():
|
2014-05-08 16:59:35 +00:00
|
|
|
""" Returns project site path """
|
2015-03-31 12:39:08 +00:00
|
|
|
return os.path.abspath(os.path.join(get_project_dir(), '..'))
|
2014-05-08 16:59:35 +00:00
|
|
|
|
|
|
|
|
2015-03-31 12:39:08 +00:00
|
|
|
def get_orchestra_dir():
|
2014-05-08 16:59:35 +00:00
|
|
|
""" Returns orchestra base path """
|
|
|
|
import orchestra
|
|
|
|
return os.path.dirname(os.path.realpath(orchestra.__file__))
|