我创建了一个虚拟环境并安装了最新的django。接下来我创建一个项目。现在,我想要做的是在项目目录中创建一个文件夹,以便在我进行开发服务器部署时使用浏览器访问其内容。我怎样才能做到这一点?我需要为此创建一个应用程序吗?
答案 0 :(得分:1)
我认为你的意思是,是为了提供静态文件:
https://docs.djangoproject.com/en/1.8/howto/static-files
基本上您需要做的是在{productfamily -> {productfeature, productfeature},
-> {productfeature1, productfeature1},
-> {productfeature1synonym, productfeature1},
-> {productfeature1synonym2, productfeature1}
}
中定义2个设置:
例如:
settings.py
现在您可以访问localhost:8000 / static / image.jpg
访问/var/www/static/image.jpg