2015-02-11 17:15:52 +01:00
The project template
====================
2015-02-11 18:30:03 +01:00
.. code-block :: text
2015-02-11 17:15:52 +01:00
mysite/
2015-10-14 22:45:58 +02:00
home/
migrations/
__init__.py
0001_initial.py
0002_create_homepage.py
2015-02-11 17:15:52 +01:00
templates/
2015-10-14 22:45:58 +02:00
home/
home_page.html
__init__.py
models.py
search/
templates/
search/
search.html
__init__.py
views.py
2015-02-11 17:15:52 +01:00
mysite/
settings/
2015-10-14 22:45:58 +02:00
__init__.py
2015-02-11 17:15:52 +01:00
base.py
dev.py
production.py
2015-10-14 22:45:58 +02:00
static/
css/
mysite.css
js/
mysite.js
templates/
404.html
500.html
base.html
__init__.py
urls.py
wsgi.py
2015-02-11 17:15:52 +01:00
manage.py
requirements.txt
2015-10-14 22:45:58 +02:00
The "home" app
2015-02-11 17:15:52 +01:00
----------------
2015-10-14 22:45:58 +02:00
Location: `` /mysite/home/ ``
2015-02-11 17:15:52 +01:00
2018-04-03 18:07:53 +02:00
This app is here to help get you started quicker by providing a `` HomePage `` model with migrations to create one when you first set up your app.
2015-02-11 17:15:52 +01:00
Default templates and static files
----------------------------------
2015-10-15 10:21:47 +02:00
Location: `` /mysite/mysite/templates/ `` and `` /mysite/mysite/static/ ``
2015-02-11 17:15:52 +01:00
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.
2015-10-15 10:21:47 +02:00
The static directory contains an empty JavaScript and CSS file.
2015-02-11 17:15:52 +01:00
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 ::
2015-04-19 11:53:34 +02:00
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.