From 923f8fca1f1ac4378cf52887ccaa479884fdf453 Mon Sep 17 00:00:00 2001 From: skywalker Date: Thu, 14 Mar 2024 17:54:36 +0800 Subject: [PATCH] collectstatic faq --- manual/develop/translation.md | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/manual/develop/translation.md b/manual/develop/translation.md index 3a9482d1..7ad85ccf 100644 --- a/manual/develop/translation.md +++ b/manual/develop/translation.md @@ -56,4 +56,51 @@ Steps: 2. Send a request to join the language translation. 3. After accepted by the project maintainer, then you can upload your file or translate online. +## FAQ +### FileNotFoundError + +`FileNotFoundError` occurred when executing the command `manage.py collectstatic`. + +```log +FileNotFoundError: [Errno 2] No such file or directory: '/opt/seafile/seafile-server-latest/seahub/frontend/build' +``` + +Steps: + +1. Modify `STATICFILES_DIRS` in `/opt/seafile/seafile-server-latest/seahub/seahub/settings.py` manually + + ```python + STATICFILES_DIRS = ( + # Put strings here, like "/home/html/static" or "C:/www/django/static". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + '%s/static' % PROJECT_ROOT, + # '%s/frontend/build' % PROJECT_ROOT, + ) + ``` + +2. Execute the command + + ```sh + ./seahub.sh python-env python3 seahub/manage.py collectstatic --noinput -i admin -i termsandconditions --no-post-process + ``` + +3. Restore `STATICFILES_DIRS` manually + + ```python + STATICFILES_DIRS = ( + # Put strings here, like "/home/html/static" or "C:/www/django/static". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + '%s/static' % PROJECT_ROOT, + '%s/frontend/build' % PROJECT_ROOT, + ) + +4. Restart Seahub + + ```sh + ./seahub.sh restart + ``` + +This issue has been fixed since version 11.0