All Projects → thorgate → Django Project Template

thorgate / Django Project Template

Licence: isc
Thorgate's Django project template - Django, React, Sass, optional Docker and more

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Django Project Template

Cookiecutter Django Vue
Cookiecutter Django Vue is a template for Django-Vue projects.
Stars: ✭ 462 (+407.69%)
Mutual labels:  webpack, django, cookiecutter, docker-compose
Docker Django Webpack Skeleton
Django Skeleton W/ Docker Dev & Production W/ Webpack 2 W/ BabelJS W/ Sass W/ PostgreSQL
Stars: ✭ 191 (+109.89%)
Mutual labels:  webpack, django, docker-compose
Docker Django Example
A production ready example Django app that's using Docker and Docker Compose.
Stars: ✭ 86 (-5.49%)
Mutual labels:  webpack, django, docker-compose
Eleventy Webpack
A barebone Eleventy and Webpack boilerplate 🎈
Stars: ✭ 68 (-25.27%)
Mutual labels:  webpack, template
Django Places
A django app for store places with autocomplete
Stars: ✭ 55 (-39.56%)
Mutual labels:  django, cookiecutter
React Native Template
Template React Native project to be used with Cookiecutter
Stars: ✭ 61 (-32.97%)
Mutual labels:  cookiecutter, template
Django Preserialize
Convert your model instances and querysets into dicts and list with style.
Stars: ✭ 42 (-53.85%)
Mutual labels:  django, template
Django React Boilerplate
Django, React, Bootstrap 4 with Python 3 and webpack project boilerplate
Stars: ✭ 1,164 (+1179.12%)
Mutual labels:  webpack, django
Django Webpacker
A django compressor tool that bundles css, js files to a single css, js file with webpack and updates your html files with respective css, js file path.
Stars: ✭ 69 (-24.18%)
Mutual labels:  webpack, django
Seed Quickstart Webpack
Template for web apps with Seed (Rust framework), TailwindCSS and Webpack.
Stars: ✭ 73 (-19.78%)
Mutual labels:  webpack, template
Cookietemple
A collection of best practice cookiecutter templates for all domains and languages with extensive Github support
Stars: ✭ 81 (-10.99%)
Mutual labels:  cookiecutter, template
Docker Rails React Starter
A basic docker-compose, Rails and React / Webpack starter kit
Stars: ✭ 52 (-42.86%)
Mutual labels:  webpack, docker-compose
Django Channels React Multiplayer
turn based strategy game using django channels, redux, and react hooks
Stars: ✭ 52 (-42.86%)
Mutual labels:  django, docker-compose
Wemake Django Template
Bleeding edge django template focused on code quality and security.
Stars: ✭ 1,141 (+1153.85%)
Mutual labels:  django, cookiecutter
Phaser3template
heroku deployable webpacked phaser3 template with socket.io for multi or single player games
Stars: ✭ 44 (-51.65%)
Mutual labels:  webpack, template
Rubel
Rubel is a cms built with Laravel and React.
Stars: ✭ 70 (-23.08%)
Mutual labels:  webpack, docker-compose
Nuxx
Visual Docker composer for faster development. Discover, leverage, and launch community recipes.
Stars: ✭ 79 (-13.19%)
Mutual labels:  django, docker-compose
Phaser3 Tilemap Pack
Phaser 3 Project Template with Webpack, Tilemap, and Asset Pack
Stars: ✭ 87 (-4.4%)
Mutual labels:  webpack, template
Express React Boilerplate
🚀🚀🚀 This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: ✭ 32 (-64.84%)
Mutual labels:  webpack, template
Cookiecutter Flask Pythonic
Pythonic starter boilerplate for Flask
Stars: ✭ 37 (-59.34%)
Mutual labels:  cookiecutter, template

Thorgate's Django template

Build status

Django project template that we use at Thorgate.

Best suited for medium-sized and bigger apps that use JavaScript and React for frontend or single page web applications.

(note that the primary repo is in Gitlab, with mirror in Github)

Features

  • Django-based backend

    • Django
    • Separate settings for different environments (local/staging/production)
    • Python 3.6 or later
    • [SPA] Accessible from port 3000 for local development
  • Frontend app with JavaScript (ES2015), React and Sass

    • Latest JavaScript features from ES2015 and beyond, transpiled with Babel
    • React for fast modular user interfaces
    • Sass, PostCSS and Autoprefixer for more convenient styling
    • Webpack is used to bundle and minify JavaScript and styles
    • [SPA] Razzle for preconfigured isomorphic application
    • [SPA] Accessible from port 8000 for local development
  • Batteries

    • Docker / Docker Compose integration
    • Linting of Python, JavaScript and Sass code with Prospector, ESLint and stylelint
    • Automated code-formatting using black and prettier
    • py.test and coverage integration
    • Deploy helpers, using Ansible
    • Media files are stored in a CDN like S3 or Google Cloud Storage
    • Out-of-the-box configuration for nginx, gunicorn and logrotate
    • Includes PyCharm project config

Usage

To use this template, first ensure that you have Poetry available.

After that, you should:

  1. Install the requirements of the project template by running

    poetry install
    
  2. Activate the virtualenv created by poetry:

    poetry shell
    
  3. Navigate to the directory where you'd like to create your project:

    cd /home/my-awesome-projects/
    
  4. Create a new project by executing:

    cookiecutter dir/to/django-project-template/
    

It will ask you a few questions, e.g. project's name. To create isomorphic single-page application set frontend_style == spa. Then separate node application will be created supported by Razzle

After generation completes, you should deactivate virtual environment for cookiecutter, search for any TODOs in the code and make appropriate changes where needed.

See README.md in the generated project for instructions on how to set up your development environment.

Different frontend styles

SPA

Isomorphic Javascript single-page application rendered with node and backed by Django Rest Framework. Enabled with frontend_style == spa. During development and production separate node container is used to run and serve assets if needed. Translations are done with i18next and its companion library for React.

Webapp

React powered application rendered with Django templates. This is the default option. Enabled with frontend_style == webapp. During development separate container is used to build assets. In production, node built with multi-stage image. Translations are done with Django JavaScriptCatalog.

Upgrading project template

First ensure you have a python3 interpreter with cookiecutter installed.

To upgrade an existing project, change the current working directory to the root of the project you want to upgrade. i.e. cd project-to-upgrade. Ensure your have not checked out the template branch.

Then run python ~/path/to/django-project-template/upgrade-template.py

This will make a commit to the branch template in your project with the updates to the project template. Then merge the template branch.

Applying codemods

First activate Python 3 interpreter with required dependencies and ensure docker is installed and working.

Change the current working directory to the root of the project you want to apply codemods for. i.e. cd project-to-upgrade.

Then run python ~/path/to/django-project-template/upgrade-template.py --apply-frontend-codemods

This will build custom docker image to update old frontend versions.

Docker images

The template uses our own images for CI runs. One for the template itself and a second one for generated projects. Both images are alpine based and contain python3, pip and some support packages. The images are published to repository container registry and also to docker hub.

The images are built in CI (from default branches only) and also updated every day via schedules.

Project CI Image

  • Dockerfile-ci
  • Image in repository registry: registry.gitlab.com/thorgate-public/django-project-template/ci
  • Image in docker hub: thorgate/django-template-ci

Template CI Image:

  • Dockerfile-base-ci
  • Image in repository registry: registry.gitlab.com/thorgate-public/django-project-template/base-ci
  • Image in docker hub: thorgate/django-template-base-ci
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].