Releases: GriceTurrble/django-bootstrap-template
2021-12-09 - Django 4.0
What's Changed
- This repo has been renamed from
django3-site-template
todjango-bootstrap-template
. This is more in line with what the template actually contains, and no longer ties it to a specific Django version. - Bumped Django from 3.2 to 4.0
- Bumped Bootstrap from 4.x to 5.1.3
- Bumped FontAwesome from 5.15.3 to 5.15.4
Full template changelog: v2021-11-01...v2021-12-09
Django 4.0 release notes: https://docs.djangoproject.com/en/4.0/releases/4.0/
v2021-11-01 - Django 3.2.9
Bumped Django dependency to 3.2.9 (Django release notes).
Release v2021-10-05
- Django bumped to v3.2.8
- pytz dependency removed. Django is migrating away from
pytz
in favor ofzoneinfo
(see Django 4.0 release notes). So, specifying this sub-dependency in the template may lead folks the wrong way moving forward.
Release v2021-09-14
django-environ
bumped to v0.7.0.
Release v2021-09-08
Dependencies have been updated to use compatible release format, setting the minimum versions for packages and allowing later patch versions to be installed more easily.
Have also changed the psycopg2
dependency (for those who might use it) to psycopg2-binary
. I find the latter easier to work with in most scenarios.
Finally, set the min version for pytz
. Can never be too careful with that one!
Release v2021-04-20
The template now starts at Django 3.2, which was released on April 6, 2021.
Details: https://docs.djangoproject.com/en/3.2/releases/3.2/
Notable changes to this template:
- Django 3.2 adds changing the type of auto-created primary keys for new models, when no field is defined with
primary_key=True
.- New setting
DEFAULT_AUTO_FIELD
has been added tosettings.py
- New setting
- Project files have been moved one level down
ProjectBaseModel
renamed toMyBaseModel
.- I figure this is an easier name to conceptualize.
- Associated
ProjectBaseQuerySet
andProjectBaseManager
also renamed toMyBaseQuerySet
andMyBaseManager
, respectively. - You'll find these objects in the
core
directory (see next change).
- The base project directory, containing
settings.py
and rooturls.py
files, has been renamed tocore
.- By default, new Django projects using the
startproject
command create directories by the same name, such that you'd findsettings.py
atmy_project/my_project/settings.py
. This can be a stumbling block for some newcomers, and the purpose of this subdirectory named the same as the project is often unclear. - Some users opt for this
core
pattern, helping distinguish the "core" of the project from the other apps contained therein. - I've opted for this latter approach, so starting new projects from this template, you will see the
core/
directory instead of a directory named after your project slug.
- By default, new Django projects using the
- The
base_objects
app has been removed. The objects that were defined there now live in thecore
directory.-
I found no reason to maintain that pseudo-app structure when it only contains abstract models and associated helper classes.
-
Using the new template, there is no need to list an extra "app" in settings: just import objects from
core
like any other Python package. For instance:from core.models import MyBaseModel class MyModel(MyBaseModel): ...
-
Other changes
- Bootstrap bumped to 4.6.0
- FontAwesome bumped to 5.15.3
- Generated README.rst changed to README.md (Markdown).
- I figure most folks are more familiar with Markdown, anyway, so better to start there.
- Content of generated README.md updated with project installation instructions.
- Bug: the
.env
file was not being read by django-environs properly due to a missing line insettings.py
. This has been corrected, so new projects should be able to start up smoothly.
Release v2020-09-01
Django security release v3.1.1
Increases minimum version for Django to 3.1.1, based on a security release.
Details: https://docs.djangoproject.com/en/3.1/releases/3.1.1/
Release v2020-08-14
The project template has been updated with the following helpful features:
Environment variable support
django-environ
has been added as a project requirement, in order to easily inject environment variables to the project settings.
<project>/settings.py
now usesenv(...)
calls to get settings likeDEBUG
andSECRET_KEY
.- These settings and the environment file are automatically generated when the template is run through
cookiecutter
.
Database and license selection
Two new cookiecutter options are available, database_backend
and open_source_license
.
database_backend
, provides a selection betweensqlite3
(Django's default, enough for small prototype projects) andpostgres
.- When
postgres
is selected as the backend:- environment variables are added to the generated
.env
file forPOSTGRES_NAME
,POSTGRES_USER
, etc. settings.py
is adjusted to use the postgres backend and the environment variables specified above.requirements.txt
is updated to includepsycopg2
, which is needed for Python to interact with a Postgres database.
- environment variables are added to the generated
- When
open_source_license
, allows selection of the type of license to use, instead of forcing the MIT license.- This option and code for it borrowed from
pydanny/cookiecutter-django
- Selecting
Not open source
will remove all open-source license files from the project.
- This option and code for it borrowed from
Development requirements file
Added requirements-dev.txt
to template project. This includes pytest
and pytest-django
for testing (with a pytest.ini
file included that should help you get started), and black
for code formatting (recommended, though not required).
- See docs for
pytest-django
. - Tests for the
base_objects
app will be added in a future update.
Template README
README.rst
added to the template project. Partly borrowed from pydanny/cookiecutter-django
, adjusted to point to this site template. :)
.gitignore
A full .gitignore
file is included with the template project, as a copy of this project's .gitignore
. This helps get your new project going while keeping safe from committing the wrong types of content (like the new .env
file with all your secrets!)