diff options
author | Nikolay Zamotaev <nzamotaev@luxoft.com> | 2020-01-29 18:17:51 +0300 |
---|---|---|
committer | Nikolay Zamotaev <nzamotaev@luxoft.com> | 2020-02-14 14:33:57 +0000 |
commit | 25b6532ee24b51300a794589acf0058c9f8f5d60 (patch) | |
tree | 9124bc419cab42f3f7338a24f5362ccac5a4433f | |
parent | 811ff184e3cd925791cd3b68eb8e744db38c9653 (diff) |
Documentation and settings update for use with static files served separately
Task-number: AUTOSUITE-1429
Change-Id: Ib670d8c41f617808db742289a4ae4ab1d77a1919
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
(cherry picked from commit 2c6654413f952eecb3ce81579d27908438f3a507)
Reviewed-by: Nikolay Zamotaev <nzamotaev@luxoft.com>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | appstore/settings.py | 1 | ||||
-rw-r--r-- | doc/src/deployment-server-http-server-setup.qdoc | 14 |
3 files changed, 16 insertions, 0 deletions
@@ -5,3 +5,4 @@ media/ certificates/ .idea/* venv/* +static/* diff --git a/appstore/settings.py b/appstore/settings.py index 8e67698..5babd8d 100644 --- a/appstore/settings.py +++ b/appstore/settings.py @@ -149,6 +149,7 @@ STATIC_URL = '/static/' # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = os.path.join(BASE_DIR, 'media/') +STATIC_ROOT = os.path.join(BASE_DIR, 'static') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). diff --git a/doc/src/deployment-server-http-server-setup.qdoc b/doc/src/deployment-server-http-server-setup.qdoc index 677ab80..a293931 100644 --- a/doc/src/deployment-server-http-server-setup.qdoc +++ b/doc/src/deployment-server-http-server-setup.qdoc @@ -125,4 +125,18 @@ The code that needs to be added is: Where \e{<url_prefix>} is the same as in \e{settings.py} file, and \e{<port>} is the port on which the deployment server instance is running. +\section1 Serving static files outside of django app + +It is possible to speed up working of the admin pages of deployment server by serving static files +separately. In order to achieve that, webserver should be configured to serve \e{static/} subdirectory of +deployment server installation as \e{static/} subdirectory of the instance. (If deployment server is +hosted as \e{http://deployment.server.name/}, then \e{static/} directory in the sources should be redirected +to \e{http://deployment.server.name/static/}, while bypassing the django app.) + +After configuring that, static files collection should be performed with this command: + +\code + ./venv/bin/python manage.py collect static +\endcode + */ |