Skip to content

Commit 94e3e89

Browse files
committed
docs(readme): modify according to standard structure
1 parent 4db7d05 commit 94e3e89

File tree

1 file changed

+95
-13
lines changed

1 file changed

+95
-13
lines changed

docs/README.rst

Lines changed: 95 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,59 @@
1-
======
1+
.. _readme:
2+
23
django
34
======
45

6+
|img_travis| |img_sr|
7+
8+
.. |img_travis| image:: https://travis-ci.com/saltstack-formulas/django-formula.svg?branch=master
9+
:alt: Travis CI Build Status
10+
:scale: 100%
11+
:target: https://travis-ci.com/saltstack-formulas/django-formula
12+
.. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
13+
:alt: Semantic Release
14+
:scale: 100%
15+
:target: https://github.com/semantic-release/semantic-release
16+
517
Set up and configure the Django web application framework.
618

7-
.. note::
19+
.. contents:: **Table of Contents**
20+
21+
General notes
22+
-------------
23+
24+
See the full `SaltStack Formulas installation and usage instructions
25+
<https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
26+
27+
If you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section
28+
<https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#writing-formulas>`_.
29+
30+
If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``,
31+
which contains the currently released version. This formula is versioned according to `Semantic Versioning <http://semver.org/>`_.
832

9-
See the full `Salt Formulas installation and usage instructions
10-
<http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
33+
See `Formula Versioning Section <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#versioning>`_ for more details.
34+
35+
If you need (non-default) configuration, please pay attention to the ``pillar.example`` file and/or `Special notes`_ section.
36+
37+
Contributing to this repo
38+
-------------------------
39+
40+
**Commit message formatting is significant!!**
41+
42+
Please see `How to contribute <https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst>`_ for more details.
43+
44+
Special notes
45+
-------------
46+
47+
None
1148

1249
Available states
13-
================
50+
----------------
1451

1552
.. contents::
16-
:local:
53+
:local:
1754

1855
``django``
19-
----------
56+
^^^^^^^^^^
2057

2158
Install Django from the system package manager. Note, the Django version
2259
available varies by platform.
@@ -35,7 +72,7 @@ Example usage::
3572
- pkg: django
3673

3774
``django.pip``
38-
--------------
75+
^^^^^^^^^^^^^^
3976

4077
Install Django via pip.
4178

@@ -54,7 +91,7 @@ Example usage::
5491

5592

5693
Full-stack App Deployment
57-
=========================
94+
-------------------------
5895

5996
This formula also provides an example of how Salt can be used to deploy a
6097
Django app in a single command, using the `OverState System`_. It installs
@@ -148,10 +185,10 @@ following command:
148185

149186

150187
Other Tips
151-
==========
188+
----------
152189

153190
Create ``settings.py`` using data from Pillar
154-
---------------------------------------------
191+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
155192

156193
The easiest way to create Django's ``settings.py`` file using data from Pillar
157194
is to simply transform a dictionary in YAML into a dictionary in Python.
@@ -199,7 +236,7 @@ is to simply transform a dictionary in YAML into a dictionary in Python.
199236
STATIC_ROOT: /var/www/mysite/django-tutorial/staticroot
200237

201238
Create ``settings.py`` with a template file
202-
-------------------------------------------
239+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
203240

204241
A more traditional (and flexible) method of creating the ``settings.py`` file
205242
is to actually create the file as a template.
@@ -263,7 +300,7 @@ is to actually create the file as a template.
263300
STATIC_ROOT = /var/www/mysite/django-tutorial/staticroot
264301

265302
Run ``syncdb`` or ``collectstatic`` automatically
266-
-------------------------------------------------
303+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
267304

268305
A wait state can be used to trigger ``django-admin.py syncdb`` or
269306
``django-admin.py collectstatic`` automatically. The following example runs
@@ -302,3 +339,48 @@ project is updated.
302339
- pythonpath: /path/to/mysite_project # optional
303340
- watch:
304341
- git: mysite
342+
343+
Testing
344+
-------
345+
346+
Linux testing is done with ``kitchen-salt``.
347+
348+
Requirements
349+
^^^^^^^^^^^^
350+
351+
* Ruby
352+
* Docker
353+
354+
.. code-block:: bash
355+
356+
$ gem install bundler
357+
$ bundle install
358+
$ bin/kitchen test [platform]
359+
360+
Where ``[platform]`` is the platform name defined in ``kitchen.yml``,
361+
e.g. ``debian-9-2019-2-py3``.
362+
363+
``bin/kitchen converge``
364+
^^^^^^^^^^^^^^^^^^^^^^^^
365+
366+
Creates the docker instance and runs the ``django.pip`` main state, ready for testing.
367+
368+
``bin/kitchen verify``
369+
^^^^^^^^^^^^^^^^^^^^^^
370+
371+
Runs the ``inspec`` tests on the actual instance.
372+
373+
``bin/kitchen destroy``
374+
^^^^^^^^^^^^^^^^^^^^^^^
375+
376+
Removes the docker instance.
377+
378+
``bin/kitchen test``
379+
^^^^^^^^^^^^^^^^^^^^
380+
381+
Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.
382+
383+
``bin/kitchen login``
384+
^^^^^^^^^^^^^^^^^^^^^
385+
386+
Gives you SSH access to the instance for manual testing.

0 commit comments

Comments
 (0)