require => [User["$user:"], File["$caldance_app/manage.py"]],
refreshonly => true,
} ~>
- exec { "py-symlink-file":
- cwd => $caldance_app,
- user => $user,
- environment => concat(["HOME=${home}"], $shell_env),
- command => "/usr/bin/ln -sf ${home}/media www/media",
- require => [User["$user:"], File["$caldance_app/manage.py"]],
- refreshonly => true,
- } ~>
exec { "reload httpd":
command => "/usr/bin/systemctl reload httpd",
require => [User["$user:"], File["$caldance_app/manage.py"]],
path => "$caldance_app/www/static",
require => "all granted",
},
+ {
+ path => "$home/media",
+ require => "all granted",
+ options => ["-Indexes"],
+ },
{
path => "/",
provider => "location",
alias => "/static/",
path => "$caldance_app/www/static/",
},
+ {
+ alias => "/media/",
+ path => "$home/media/",
+ },
],
setenv => $apache_env,
wsgi_script_aliases => { "/" => "$caldance_app/main_app/wsgi.py" };