Nit pick: files of samples depend on Satchmo's install folder.

Issue #1105 invalid
utku karatas
created an issue

You have this block of code in every sample's


DIRNAME = os.path.dirname(file)

trick to get the two-levels up directory, which for the "simple" project should be the satchmo dir

_parent = lambda x: os.path.normpath(os.path.join(x, '..'))

SATCHMO_DIRNAME = _parent(_parent(DIRNAME)) SATCHMO_APPS = os.path.join(SATCHMO_DIRNAME, 'apps')

if not SATCHMO_APPS in sys.path: sys.path.append(SATCHMO_APPS)

if not DIRNAME in sys.path: sys.path.append(DIRNAME)


When the user copies the sample apps to a place of his liking, the relative path lookup becomes moot. So why not leave alone :)

Comments (6)

  1. Tay Ray Chuan

    Of course, this is sub-optimal, but we need to do this so that MEDIA_ROOT is found properly.

    By the way, what use do the sample apps have for you to make you copy them to somewhere else?

  2. Chris Moffitt repo owner

    The docs may say that. Personally, I think using clonesatchmo is a better approach. It is functionally the same but is a bit cleaner - it doesn't have this issue we're discussing here.

  3. Tay Ray Chuan

    Check this out.

    I spotted a reference to "copying"; this changes the line to say "use as a template" instead of outright copying.

    In any case, that line references the "base" project; copying and is ok, since we don't have any fancy code to locate the static folder.

    Again, please post references to copying of sample projects.

  4. Log in to comment