AWS Elastic Beanstalk和Django模板目录

时间:2013-09-30 06:24:16

标签: django amazon-web-services django-templates elastic-beanstalk

模板目录应放在项目树中的哪个位置以及要为TEMPLATE_DIRS设置什么,以便AWS beanstalk可以读取它?

如果我在项目根目录中有/ template,我认为它是os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'template')

2 个答案:

答案 0 :(得分:0)

第1步:  您提供了指向'模板的正确代码行。夹。  只需将它放在TEMPLATE_DIRS下的project-name / settings.py中。

第2步: 创建'模板'项目根目录下的文件夹。 例如(项目:mysite):mysite / template /

答案 1 :(得分:0)

os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'template')