|
| 1 | +{% comment %} |
| 2 | +=============== |
| 3 | +Getting started |
| 4 | +=============== |
| 5 | + |
| 6 | +Below you'll find the steps to create a 3rd-party Django app from scratch, |
| 7 | +using the Maykin Media starting template. The ``<project_root>`` is typically |
| 8 | +placed in your home directory. |
| 9 | + |
| 10 | +.. code-block:: bash |
| 11 | +
|
| 12 | + mkdir <project_root> |
| 13 | + cd <project_root> |
| 14 | +
|
| 15 | +Create the virtual environment that holds your copy of Python and relevant |
| 16 | +libraries: |
| 17 | + |
| 18 | +.. code-block:: bash |
| 19 | +
|
| 20 | + virtualenv env or virtualenv --python=/usr/bin/python3.10 env |
| 21 | + source env/bin/activate |
| 22 | + pip install django~=4.2.0 |
| 23 | +
|
| 24 | +Start a new Django project, named ``<project_name>``, using the template. This |
| 25 | +will be your Python import path. |
| 26 | + |
| 27 | +.. code-block:: bash |
| 28 | +
|
| 29 | + django-admin startproject \ |
| 30 | + --template=https://github.com/maykinmedia/default-app/archive/main.zip \ |
| 31 | + --extension=py-tpl,rst,gitignore,in,ini,cfg,toml,yml,yaml \ |
| 32 | + -x .github \ |
| 33 | + --name LICENSE \ |
| 34 | + <project_name> . |
| 35 | +
|
| 36 | +And then set up the Github actions workflows: |
| 37 | + |
| 38 | +.. code-block:: bash |
| 39 | +
|
| 40 | + mv dotgithub .github |
| 41 | +
|
| 42 | +{% endcomment %} |
| 43 | + |
| 44 | +Welcome to {{ project_name }}'s documentation! |
| 45 | +================================================= |
| 46 | + |
| 47 | +:Version: 0.1.0 |
| 48 | +:Source: https://github.com/maykinmedia/{{ project_name }} |
| 49 | +:Keywords: ``<keywords>`` |
| 50 | +:PythonVersion: 3.10 |
| 51 | + |
| 52 | +|build-status| |code-quality| |black| |coverage| |docs| |
| 53 | + |
| 54 | +|python-versions| |django-versions| |pypi-version| |
| 55 | + |
| 56 | +<One liner describing the project> |
| 57 | + |
| 58 | +.. contents:: |
| 59 | + |
| 60 | +.. section-numbering:: |
| 61 | + |
| 62 | +Features |
| 63 | +======== |
| 64 | + |
| 65 | +* ... |
| 66 | +* ... |
| 67 | + |
| 68 | +Installation |
| 69 | +============ |
| 70 | + |
| 71 | +Requirements |
| 72 | +------------ |
| 73 | + |
| 74 | +* Python 3.10 or above |
| 75 | +* Django 4.2 or newer |
| 76 | + |
| 77 | + |
| 78 | +Install |
| 79 | +------- |
| 80 | + |
| 81 | +.. code-block:: bash |
| 82 | +
|
| 83 | + pip install {{ project_name }} |
| 84 | +
|
| 85 | +
|
| 86 | +Usage |
| 87 | +===== |
| 88 | + |
| 89 | +<document or refer to docs> |
| 90 | + |
| 91 | +Local development |
| 92 | +================= |
| 93 | + |
| 94 | +To install and develop the library locally, use:: |
| 95 | + |
| 96 | +.. code-block:: bash |
| 97 | +
|
| 98 | + pip install -e .[tests,coverage,docs,release] |
| 99 | +
|
| 100 | +When running management commands via ``django-admin``, make sure to add the root |
| 101 | +directory to the python path (or use ``python -m django <command>``): |
| 102 | + |
| 103 | +.. code-block:: bash |
| 104 | +
|
| 105 | + export PYTHONPATH=. DJANGO_SETTINGS_MODULE=testapp.settings |
| 106 | + django-admin check |
| 107 | + # or other commands like: |
| 108 | + # django-admin makemessages -l nl |
| 109 | +
|
| 110 | +
|
| 111 | +.. |build-status| image:: https://github.com/maykinmedia/{{ project_name }}/workflows/Run%20CI/badge.svg |
| 112 | + :alt: Build status |
| 113 | + :target: https://github.com/maykinmedia/{{ project_name }}/actions?query=workflow%3A%22Run+CI%22 |
| 114 | + |
| 115 | +.. |code-quality| image:: https://github.com/maykinmedia/{{ project_name }}/workflows/Code%20quality%20checks/badge.svg |
| 116 | + :alt: Code quality checks |
| 117 | + :target: https://github.com/maykinmedia/{{ project_name }}/actions?query=workflow%3A%22Code+quality+checks%22 |
| 118 | + |
| 119 | +.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg |
| 120 | + :target: https://github.com/psf/black |
| 121 | + |
| 122 | +.. |coverage| image:: https://codecov.io/gh/maykinmedia/{{ project_name }}/branch/main/graph/badge.svg |
| 123 | + :target: https://codecov.io/gh/maykinmedia/{{ project_name }} |
| 124 | + :alt: Coverage status |
| 125 | + |
| 126 | +.. |docs| image:: https://readthedocs.org/projects/{{ project_name }}/badge/?version=latest |
| 127 | + :target: https://{{ project_name }}.readthedocs.io/en/latest/?badge=latest |
| 128 | + :alt: Documentation Status |
| 129 | + |
| 130 | +.. |python-versions| image:: https://img.shields.io/pypi/pyversions/{{ project_name }}.svg |
| 131 | + |
| 132 | +.. |django-versions| image:: https://img.shields.io/pypi/djversions/{{ project_name }}.svg |
| 133 | + |
| 134 | +.. |pypi-version| image:: https://img.shields.io/pypi/v/{{ project_name }}.svg |
| 135 | + :target: https://pypi.org/project/{{ project_name }}/ |
0 commit comments