Skip to main content

Opinionated version of `startproject` with some popular third-party packages. Starter pack includes: whitenoise, django-environ, logging, GitHub Scripts to Rule Them All, basic Dockerfile and Makefile.

Project description

django-spinproject

Opinionated version of django-admin startproject that intends to go further and do things that startproject can't do but most people will do anyway. Here's what you can get:

  • ⚛️ Whitenoise: for serving static files in production (usually you don't want to set up a separate server for this).
  • 🔧 settings.py: slightly modified to also understand environment variables and .env files. This functionality requires the django-environ package. Also, app logger is mostly pre-configured for you.
  • 🔑 Minimal login/logout pages so you can set this up without reading the guide again.
  • 🔒 Support for marking PostgreSQL databases as read-only to prevent accidental modification of critical data.
  • 🧰 script/bootstrap and other scripts to rule them all so your fellow developers and maintainers don't ask you how to run this thing. Current versions of these scripts optimized for use with uv, but you can easily adapt them for any Python package manager.
  • 🏗️ Dockerfile and .dockerignore: one day your app will go to production, and we've got you covered.
  • 🏛️ Gitlab CI config.
  • ⚕️ Pre-configured linter so you can find some common problems automagically.
  • 🏃 Pre-configured pytest because you are going to need unit tests one day.
  • 🗃️ Auto-checks if you forgot to create migrations whenever you run tests or CI.
  • *️⃣ .gitignore: well, you know why.

Requirements

  • *nix system;
  • django-admin installed and available from $PATH.

Generated files will work fine in Django >= 2.0, not tested in earlier versions.

How to use

  • Install the package: pip install django-spinproject
  • Create a new project: django-spinproject --create <path>
  • OR initialize spinproject in your existing project's folder: django-spinproject --init

You're all set. Now you can take a look at the list of available modules: django-spinproject --help

Use django-spinproject --enable to enable a module, django-spinproject --upgrade to apply changes.

CLI commands

  • --create PATH: create django project in specified path
  • --init: create spinproject.json file
  • --enable MODULE_TO_ENABLE: enable specified module; use 'all' to enable most common modules; use 'ALL' to enable all available modules;
  • --disable MODULE_TO_DISABLE: disable specified module
  • --upgrade [MODULE_TO_UPGRADE]: upgrade (specified or all) enabled modules

Available modules

  • gitignore — Creates .gitignore file suitable for most Django projects.
  • srta — Creates Scripts to Rule Them All (simplifies life a lot, you should check it out).
  • pytest — Creates pytest.ini and .coveragerc files.
  • dockerfile — Creates a Dockerfile.
  • dockerignore — Creates .dockerignore (you should totally do that).
  • docker-scripts — Creates additional SRTA scripts for building and pushing your Docker image.
  • gitlab-ci — Creates GitLab CI config, .gitlab-ci.yml.
  • pg-readonly — Creates a DatabaseWrapper class for readonly connection to PostgreSQL.
  • settings — Improves the default settings.py, adding support for envvars and .env files. Also enables Whitenoise and CLI logger.
  • login-template — Creates minimal login/logout pages.

Planned features

(for requests, create an issue or drop me a line at m1kc@yandex.ru)

Changelog

See the Releases page.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_spinproject-3.0.0.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_spinproject-3.0.0-py3-none-any.whl (75.4 kB view details)

Uploaded Python 3

File details

Details for the file django_spinproject-3.0.0.tar.gz.

File metadata

  • Download URL: django_spinproject-3.0.0.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.2","id":"zara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_spinproject-3.0.0.tar.gz
Algorithm Hash digest
SHA256 7ad3265bce6331f721c287eedb28f43f6123452b444d0ba31b7eef921a35fc8a
MD5 9a92fdfa24ca1962dbf873b0b7cc9c6b
BLAKE2b-256 635209ef3411c970d4653c8ced67bf50223db4a5f9c3083b8f1c97b995d46169

See more details on using hashes here.

File details

Details for the file django_spinproject-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: django_spinproject-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 75.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.2","id":"zara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_spinproject-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25f4af07266719a71179b66b35bcc367f8ab4b9fef794309a1ebe640260e1036
MD5 19b0ac5390c15d22fc269cf22cddea3c
BLAKE2b-256 d2059f9b3fddcf7ab8c9a3c5daeb322247b2862142078390e165d2b6425caae5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page