Skip to content

Commit

Permalink
Don't hardcode INSTALL_DIR and use os.path.join
Browse files Browse the repository at this point in the history
Makes it easier to run bleep on non-POSIX systems and is more python
"best practice-y"
  • Loading branch information
SEJeff committed Nov 9, 2011
1 parent 4ca5b72 commit c37f3e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Bleep! is an open source project built on the


### Configuration ### Configuration


Edit django settings.py file to set INSTALL_DIR and database. Edit django settings.py file to set up the database.


## TODO ## TODO


Expand Down
10 changes: 6 additions & 4 deletions settings.py
Original file line number Original file line Diff line number Diff line change
@@ -1,14 +1,16 @@
# Django settings for bleep project. # Django settings for bleep project.


import os

DEBUG = True DEBUG = True
TEMPLATE_DEBUG = DEBUG TEMPLATE_DEBUG = DEBUG


INSTALL_DIR='/Users/alexh/bleep-workspace/bleep' INSTALL_DIR= os.path.dirname(os.path.abspath(__file__))


# Update the modules path here # Update the modules path here
print 'debuggery: Updating the modules path in %s !' % __file__ print 'debuggery: Updating the modules path in %s !' % __file__
import sys import sys
sys.path.append(INSTALL_DIR+'/services') sys.path.append(os.path.join(INSTALL_DIR, 'services'))




ADMINS = ( ADMINS = (
Expand Down Expand Up @@ -94,7 +96,7 @@
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows. # Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths. # Don't forget to use absolute paths, not relative paths.
INSTALL_DIR+"/templates", os.path.join(INSTALL_DIR, "/templates"),
) )


INSTALLED_APPS = ( INSTALLED_APPS = (
Expand All @@ -110,7 +112,7 @@
# 'django.contrib.admindocs', # 'django.contrib.admindocs',
) )


STATIC_DOC_ROOT = INSTALL_DIR+'/assets' STATIC_DOC_ROOT = os.path.join(INSTALL_DIR, 'assets')




AUTH_PROFILE_MODULE = "bleeps.UserProfile" AUTH_PROFILE_MODULE = "bleeps.UserProfile"
Expand Down

0 comments on commit c37f3e9

Please sign in to comment.