def comp(request, slug, directory_slug=None):
context = {}<EOL>path = settings.COMPS_DIR<EOL>comp_dir = os.path.split(path)[<NUM_LIT:1>]<EOL>template = "<STR_LIT>".format(comp_dir, slug)<EOL>if directory_slug:<EOL><INDENT>template = "<STR_LIT>".format(comp_dir, directory_slug, slug)<EOL><DEDENT>working_dir = os.path.join(path, slug)<EOL>if os.path.isdir(working_dir):<EOL><INDENT>return redirect('<STR_LIT>', directory_slug=slug)<EOL><DEDENT>try:<EOL><INDENT>t = get_template(template)<EOL><DEDENT>except TemplateDoesNotExist:<EOL><INDENT>return redirect('<STR_LIT>')<EOL><DEDENT>c = RequestContext(request, context)<EOL>return HttpResponse(t.render(c))<EOL>
View the requested comp