0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00
wagtail/docs/reference/project_template.rst
Tim Heap bc6b5a8a6c Normalise all code blocks in the docs
All `.. code::` instances have been changed to use `.. code-block::`,
and have been properly formatted. The syntax names have been normalised,
so all django templates use the `html+django` syntax, shell commands use
`sh`, and plain text uses `text`.
2015-10-05 16:55:58 +01:00

81 lines
2.6 KiB
ReStructuredText

The project template
====================
.. code-block:: text
mysite/
core/
static/
templates/
base.html
404.html
500.html
mysite/
settings/
base.py
dev.py
production.py
manage.py
vagrant/
provision.sh
Vagrantfile
readme.rst
requirements.txt
The "core" app
----------------
Location: ``/mysite/core/``
This app is here to help get you started quicker by providing a ``HomePage`` model with migrations to create one when you first setup your app.
Default templates and static files
----------------------------------
Location: ``/mysite/core/templates/`` and ``/mysite/core/static/``
The templates directory contains ``base.html``, ``404.html`` and ``500.html``. These files are very commonly needed on Wagtail sites to they have been added into the template.
The static directory contains an empty JavaScript and SASS file. Wagtail uses ``django-compressor`` for compiling and compressing static files. For more information, see: `Django Compressor Documentation <http://django-compressor.readthedocs.org/en/latest/>`_
Vagrant configuration
---------------------
Location: ``/Vagrantfile`` and ``/vagrant/``
If you have Vagrant installed, these files let you easily setup a development environment with PostgreSQL and Elasticsearch inside a virtual machine.
If you do not want to use Vagrant, you can just delete these files.
Django settings
---------------
Location: ``/mysite/mysite/settings/``
The Django settings files are split up into ``base.py``, ``dev.py``, ``production.py`` and ``local.py``.
.. glossary::
``base.py``
This file is for global settings that will be used in both development and production. Aim to keep most of your configuration in this file.
``dev.py``
This file is for settings that will only be used by developers. For example: ``DEBUG = True``
``production.py``
This file is for settings that will only run on a production server. For example: ``DEBUG = False``
``local.py``
This file is used for settings local to a particular machine. This file should never be tracked by a version control system.
.. tip::
On production servers, we recommend that you only store secrets in ``local.py`` (such as API keys and passwords). This can save you headaches in the future if you are ever trying to debug why a server is behaving badly. If you are using multiple servers which need different settings then we recommend that you create a different ``production.py`` file for each one.