Changeset - 7dc7e0c7bed9
[Not reviewed]
0 1 1
Branko Majic (branko) - 9 years ago 2016-10-27 16:28:21
branko@majic.rs
MDT-3: Use empty static directory to avoid errors from collectstatic command. Added some docs about project-specific static files.
2 files changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
docs/usage.rst
Show inline comments
 
@@ -143,24 +143,29 @@ directories ``assets/static/`` and ``assets/media/``.
 
As an example, in case you create project in ``~/tmp/``, you would have
 
structure similar to:
 

	
 
- ``~/tmp/myproject/``
 
- ``~/tmp/myproject/manage.py``
 
- Many other files and directories under ``~/tmp/myproject/``
 
- ``~/tmp/assets/static/``
 
- ``~/tmp/assets/media/``
 

	
 
This way you can keep the assets (static and media files) outside of the project
 
code tree.
 

	
 
If you ever need to have some static files as part of the project itself, you
 
can easily do so by putting the files into project's static directory
 
(i.e. ``~/tmp/myproject/static/``). This is helpful when you want to overrides a
 
specific static file from some other application.
 

	
 

	
 
Working with the project
 
------------------------
 

	
 
When running ``manage.py`` commands for a project, Django by default expects all
 
settings to be found within the project's settings module. Specifically, it
 
expects them all to be present in the ``settings.py`` file.
 

	
 
As mentioned before, when using *Majic Django Templates*, this file is
 
split-up. When Django attempts to load all settings from the project's
 
``settings`` module, it will fail (since it will effectively be loading settings
 
from an empty ``__init__.py`` file).
project-django-1.8/project_name/static/.keep
Show inline comments
 
new file 100644
0 comments (0 inline, 0 general)