PROJECT_ROOT path seems wrong. What am I missing?

Based on the code snippet Kenneth provided, the PROJECT_ROOT seems to point to the wrong directory. I'm sure I'm missing something here, but I'm not sure what.

here = lambda * x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x) This is inside microblog/microblog/settings/base.py, so here() would return microblog/microblog/settings/.

PROJECT_ROOT = here("..") PROJECT_ROOT is one directory up from here(), so that would make it microblog/microblog.

root = lambda * x: os.path.join(os.path.abspath(PROJECT_ROOT), *x) root then just starts with PROJECT_ROOT which, again, is microblog/microblog.

Later on, we create the templates directory directly inside microblog (first level), but the value we've added to TEMPLATE_DIRS is root('templates') which should return microblog/microblog/templates/, right?

I think I could easily fix this with PROJECT_ROOT = here('..', '..'), but that doesn't match the tutorial. Where have I lost my way?

Sorry You must be a logged in, registered user to answer a question.

Answers

IIRC, later in the video, TEMPLATE_DIRS changes to root('..', 'templates'). Yes, you could do PROJECT_ROOT = here('..', '..') if you wanted.

OK. I should have just kept watching. Thanks for clearing that up.
Devon Campbell on