Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Commit

Permalink
always load funfactory from vendor library
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnen committed Aug 28, 2012
1 parent c76098d commit df0f394
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@
# Edit this if necessary or override the variable in your environment.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')

try:
# For local development in a virtualenv:
from funfactory import manage
except ImportError:
# Production:
# Add a temporary path so that we can import the funfactory
tmp_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'vendor', 'src', 'funfactory')
sys.path.append(tmp_path)
# Add a temporary path so that we can import the funfactory
tmp_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'vendor', 'src', 'funfactory')
# Comment out to load funfactory from your site packages instead
sys.path.insert(0, tmp_path)

from funfactory import manage
from funfactory import manage

# Let the path magic happen in setup_environ() !
sys.path.remove(tmp_path)
# Let the path magic happen in setup_environ() !
sys.path.remove(tmp_path)


manage.setup_environ(__file__, more_pythonic=True)
Expand Down

0 comments on commit df0f394

Please sign in to comment.