Skip to content

Commit e489913

Browse files
authored
Merge pull request #1 from maykinmedia/setup
startproject with template
2 parents 374e453 + 9a8124d commit e489913

22 files changed

+101
-191
lines changed

.github/workflows/ci.yml

+39-26
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,54 @@ on:
1313
jobs:
1414
tests:
1515
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python: ['3.10', '3.11', '3.12']
19+
django: ['4.2']
1620

17-
name: Test the creation of a Django project from the template
21+
name: Run the test suite (Python ${{ matrix.python }}, Django ${{ matrix.django }})
1822

1923
steps:
2024
- uses: actions/checkout@v4
2125
- uses: actions/setup-python@v5
2226
with:
23-
python-version: '3.10'
27+
python-version: ${{ matrix.python }}
2428

25-
- name: Install Django 4.2
26-
run: pip install django~=4.2.0
29+
- name: Install dependencies
30+
run: pip install tox tox-gh-actions
2731

28-
- name: Run the startproject command
29-
run: |
30-
mkdir tmp
31-
django-admin startproject \
32-
--template . \
33-
--extension=py-tpl,rst,gitignore,in,ini,cfg,toml,yml,yaml \
34-
--name LICENSE \
35-
-x tmp \
36-
-x .github \
37-
defaultapp tmp/
38-
39-
- name: Run basic checks (following README instructions)
40-
run: |
41-
pip install -e .[tests]
42-
django-admin check
43-
pytest
32+
- name: Run tests
33+
run: tox
4434
env:
45-
PYTHONPATH: .
46-
DJANGO_SETTINGS_MODULE: testapp.settings
47-
working-directory: tmp
35+
PYTHON_VERSION: ${{ matrix.python }}
36+
DJANGO: ${{ matrix.django }}
37+
38+
- name: Publish coverage report
39+
uses: codecov/codecov-action@v4
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
43+
publish:
44+
name: Publish package to PyPI
45+
runs-on: ubuntu-latest
46+
needs: tests
47+
environment: release
48+
permissions:
49+
id-token: write
50+
51+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
4852

49-
- name: Run dummy package build
53+
steps:
54+
- uses: actions/checkout@v4
55+
- uses: actions/setup-python@v5
56+
with:
57+
python-version: '3.10'
58+
59+
- name: Build sdist and wheel
5060
run: |
51-
pip install build
61+
pip install build --upgrade
5262
python -m build
53-
working-directory: tmp
63+
64+
- name: Publish a Python distribution to PyPI
65+
uses: pypa/gh-action-pypi-publish@release/v1
66+

dotgithub/workflows/code_quality.yml .github/workflows/code_quality.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
run: pip install tox
3131
- run: tox
3232
env:
33-
TOXENV: ${% templatetag openvariable %} matrix.toxenv {% templatetag closevariable %}
33+
TOXENV: ${{ matrix.toxenv }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ coverage.xml
4646
*.cover
4747
.hypothesis/
4848
.pytest_cache/
49+
reports/*
4950

5051
# Translations
5152
*.mo

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright {% now "Y" %} Maykin Media
1+
Copyright 2025 Maykin Media
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

MANIFEST.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
include *.rst
22
include LICENSE
3-
include {{ project_name }}/py.typed
4-
recursive-include {{ project_name }} *.html
5-
recursive-include {{ project_name }} *.txt
6-
recursive-include {{ project_name }} *.po
3+
include maykin_django_utils/py.typed
4+
recursive-include maykin_django_utils *.html
5+
recursive-include maykin_django_utils *.txt
6+
recursive-include maykin_django_utils *.po
77
global-exclude __pycache__
88
global-exclude *.py[co]

README.rst

+15-56
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,10 @@
1-
{% comment %}
2-
===============
3-
Getting started
4-
===============
51

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.
92

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!
3+
Welcome to maykin-django-utils's documentation!
454
=================================================
465

476
:Version: 0.1.0
48-
:Source: https://github.com/maykinmedia/{{ project_name }}
7+
:Source: https://github.com/maykinmedia/maykin-django-utils
498
:Keywords: ``<keywords>``
509
:PythonVersion: 3.10
5110

@@ -80,7 +39,7 @@ Install
8039

8140
.. code-block:: bash
8241
83-
pip install {{ project_name }}
42+
pip install maykin-django-utils
8443
8544
8645
Usage
@@ -108,28 +67,28 @@ directory to the python path (or use ``python -m django <command>``):
10867
# django-admin makemessages -l nl
10968
11069
111-
.. |build-status| image:: https://github.com/maykinmedia/{{ project_name }}/workflows/Run%20CI/badge.svg
70+
.. |build-status| image:: https://github.com/maykinmedia/maykin-django-utils/workflows/Run%20CI/badge.svg
11271
:alt: Build status
113-
:target: https://github.com/maykinmedia/{{ project_name }}/actions?query=workflow%3A%22Run+CI%22
72+
:target: https://github.com/maykinmedia/maykin-django-utils/actions?query=workflow%3A%22Run+CI%22
11473

115-
.. |code-quality| image:: https://github.com/maykinmedia/{{ project_name }}/workflows/Code%20quality%20checks/badge.svg
74+
.. |code-quality| image:: https://github.com/maykinmedia/maykin-django-utils/workflows/Code%20quality%20checks/badge.svg
11675
:alt: Code quality checks
117-
:target: https://github.com/maykinmedia/{{ project_name }}/actions?query=workflow%3A%22Code+quality+checks%22
76+
:target: https://github.com/maykinmedia/maykin-django-utils/actions?query=workflow%3A%22Code+quality+checks%22
11877

11978
.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
12079
:target: https://github.com/psf/black
12180

122-
.. |coverage| image:: https://codecov.io/gh/maykinmedia/{{ project_name }}/branch/main/graph/badge.svg
123-
:target: https://codecov.io/gh/maykinmedia/{{ project_name }}
81+
.. |coverage| image:: https://codecov.io/gh/maykinmedia/maykin-django-utils/branch/main/graph/badge.svg
82+
:target: https://codecov.io/gh/maykinmedia/maykin-django-utils
12483
:alt: Coverage status
12584

126-
.. |docs| image:: https://readthedocs.org/projects/{{ project_name }}/badge/?version=latest
127-
:target: https://{{ project_name }}.readthedocs.io/en/latest/?badge=latest
85+
.. |docs| image:: https://readthedocs.org/projects/maykin-django-utils/badge/?version=latest
86+
:target: https://maykin-django-utils.readthedocs.io/en/latest/?badge=latest
12887
:alt: Documentation Status
12988

130-
.. |python-versions| image:: https://img.shields.io/pypi/pyversions/{{ project_name }}.svg
89+
.. |python-versions| image:: https://img.shields.io/pypi/pyversions/maykindjango_utils.svg
13190

132-
.. |django-versions| image:: https://img.shields.io/pypi/djversions/{{ project_name }}.svg
91+
.. |django-versions| image:: https://img.shields.io/pypi/djversions/maykin-django-utils.svg
13392

134-
.. |pypi-version| image:: https://img.shields.io/pypi/v/{{ project_name }}.svg
135-
:target: https://pypi.org/project/{{ project_name }}/
93+
.. |pypi-version| image:: https://img.shields.io/pypi/v/maykin-django-utils.svg
94+
:target: https://pypi.org/project/maykin-django-utils/
File renamed without changes.

docs/conf.py-tpl docs/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
from pathlib import Path
1515

1616
current_dir = Path(__file__).parents[1]
17-
code_directory = current_dir / "{{ project_name|lower }}"
17+
code_directory = current_dir / "maykin_django_utils"
1818

1919
sys.path.insert(0, str(code_directory))
2020

2121

2222
# -- Project information -----------------------------------------------------
2323

24-
project = "{{ project_name }}"
25-
copyright = "{% now 'Y' %}, Maykin Media"
24+
project = "maykin_django_utils"
25+
copyright = "2025, Maykin Media"
2626
author = "Maykin Media"
2727

2828
# The full version, including alpha/beta/rc tags

docs/index.rst

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
.. {{ project_name }} documentation master file, created by startproject.
1+
.. maykin-django-utils documentation master file, created by startproject.
22
You can adapt this file completely to your liking, but it should at least
33
contain the root `toctree` directive.
44
5-
Welcome to {{ project_name }}'s documentation!
5+
Welcome to maykin-django-utils's documentation!
66
=================================================
77

8-
|build-status| |code-quality| |black| |coverage| |docs|
8+
|build-status| |code-quality| |black| |coverage|
9+
10+
..
11+
|docs|
912
1013
|python-versions| |django-versions| |pypi-version|
1114

@@ -33,28 +36,28 @@ Indices and tables
3336
* :ref:`search`
3437

3538

36-
.. |build-status| image:: https://github.com/maykinmedia/{{ project_name }}/workflows/Run%20CI/badge.svg
39+
.. |build-status| image:: https://github.com/maykinmedia/maykin-django-utils/workflows/Run%20CI/badge.svg
3740
:alt: Build status
38-
:target: https://github.com/maykinmedia/{{ project_name }}/actions?query=workflow%3A%22Run+CI%22
41+
:target: https://github.com/maykinmedia/maykin-django-utils/actions?query=workflow%3A%22Run+CI%22
3942

40-
.. |code-quality| image:: https://github.com/maykinmedia/{{ project_name }}/workflows/Code%20quality%20checks/badge.svg
43+
.. |code-quality| image:: https://github.com/maykinmedia/maykin-django-utils/workflows/Code%20quality%20checks/badge.svg
4144
:alt: Code quality checks
42-
:target: https://github.com/maykinmedia/{{ project_name }}/actions?query=workflow%3A%22Code+quality+checks%22
45+
:target: https://github.com/maykinmedia/maykin-django-utils/actions?query=workflow%3A%22Code+quality+checks%22
4346

4447
.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
4548
:target: https://github.com/psf/black
4649

47-
.. |coverage| image:: https://codecov.io/gh/maykinmedia/{{ project_name }}/branch/master/graph/badge.svg
48-
:target: https://codecov.io/gh/maykinmedia/{{ project_name }}
50+
.. |coverage| image:: https://codecov.io/gh/maykinmedia/maykin-django-utils/branch/master/graph/badge.svg
51+
:target: https://codecov.io/gh/maykinmedia/maykin-django-utils
4952
:alt: Coverage status
53+
..
54+
.. |docs| image:: https://readthedocs.org/projects/django-json-schema-model/badge/?version=latest
55+
:target: https://django-json-schema-model.readthedocs.io/en/latest/?badge=latest
56+
:alt: Documentation Status
5057
51-
.. |docs| image:: https://readthedocs.org/projects/{{ project_name }}/badge/?version=latest
52-
:target: https://{{ project_name }}.readthedocs.io/en/latest/?badge=latest
53-
:alt: Documentation Status
54-
55-
.. |python-versions| image:: https://img.shields.io/pypi/pyversions/{{ project_name }}.svg
58+
.. |python-versions| image:: https://img.shields.io/pypi/pyversions/maykin-django-utils.svg
5659

57-
.. |django-versions| image:: https://img.shields.io/pypi/djversions/{{ project_name }}.svg
60+
.. |django-versions| image:: https://img.shields.io/pypi/djversions/maykin-django-utils.svg
5861

59-
.. |pypi-version| image:: https://img.shields.io/pypi/v/{{ project_name }}.svg
60-
:target: https://pypi.org/project/{{ project_name }}/
62+
.. |pypi-version| image:: https://img.shields.io/pypi/v/maykin-django-utils.svg
63+
:target: https://pypi.org/project/maykin-django-utils/

docs/quickstart.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Install from PyPI with pip:
99

1010
.. code-block:: bash
1111
12-
pip install {{ project_name }}
12+
pip install maykin-django-utils
1313
1414
1515
Usage

dotgithub/workflows/ci.yml

-66
This file was deleted.
File renamed without changes.

maykin_django_utils/apps.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class MaykinDjangoUtilsConfig(AppConfig):
5+
name = "maykin_django_utils"
File renamed without changes.

project_name/apps.py-tpl

-5
This file was deleted.

0 commit comments

Comments
 (0)