Skip to content

Releases: GriceTurrble/django-bootstrap-template

2021-12-09 - Django 4.0

09 Dec 17:06
Compare
Choose a tag to compare

What's Changed

  • This repo has been renamed from django3-site-template to django-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

01 Nov 15:44
6a7668a
Compare
Choose a tag to compare

Bumped Django dependency to 3.2.9 (Django release notes).

Release v2021-10-05

05 Oct 15:50
29c2e3e
Compare
Choose a tag to compare
  • Django bumped to v3.2.8
  • pytz dependency removed. Django is migrating away from pytz in favor of zoneinfo (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

14 Sep 13:25
af5eae7
Compare
Choose a tag to compare
  • django-environ bumped to v0.7.0.

Release v2021-09-08

09 Sep 02:35
Compare
Choose a tag to compare

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

20 Apr 20:11
a0b6e3a
Compare
Choose a tag to compare

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 to settings.py
  • Project files have been moved one level down
  • ProjectBaseModel renamed to MyBaseModel.
    • I figure this is an easier name to conceptualize.
    • Associated ProjectBaseQuerySet and ProjectBaseManager also renamed to MyBaseQuerySet and MyBaseManager, respectively.
    • You'll find these objects in the core directory (see next change).
  • The base project directory, containing settings.py and root urls.py files, has been renamed to core.
    • By default, new Django projects using the startproject command create directories by the same name, such that you'd find settings.py at my_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.
  • The base_objects app has been removed. The objects that were defined there now live in the core 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 in settings.py. This has been corrected, so new projects should be able to start up smoothly.

Release v2020-09-01

01 Sep 12:57
Compare
Choose a tag to compare

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

14 Aug 13:29
Compare
Choose a tag to compare

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 uses env(...) calls to get settings like DEBUG and SECRET_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 between sqlite3 (Django's default, enough for small prototype projects) and postgres.
    • When postgres is selected as the backend:
      • environment variables are added to the generated .env file for POSTGRES_NAME, POSTGRES_USER, etc.
      • settings.py is adjusted to use the postgres backend and the environment variables specified above.
      • requirements.txt is updated to include psycopg2, which is needed for Python to interact with a Postgres database.
  • 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.

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

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!)