diff --git a/api/masteriq/settings.py b/api/masteriq/settings.py index 51a3184..21f6af2 100644 --- a/api/masteriq/settings.py +++ b/api/masteriq/settings.py @@ -143,6 +143,7 @@ # https://docs.djangoproject.com/en/5.0/howto/static-files/ STATIC_URL = 'static/' +STATIC_ROOT = 'static/' # Default primary key field type # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field diff --git a/config/deploy.rb b/config/deploy.rb index 8206beb..2c042fb 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -60,6 +60,19 @@ end end +after 'deploy:updating', 'django:collectstatic' + +namespace :django do + desc 'Install static files' + task :collectstatic do + on roles([:app, :web]) do |h| + within "#{release_path}/api" do + execute :python3, 'manage.py', 'collectstatic' + end + end + end +end + after 'deploy:updating', 'npm:install' namespace :npm do desc 'NPM install'