Bleeding edge django template focused on code quality and security.

Overview

wemake-django-template

wemake.services Awesome Build status Documentation Status Dependencies Status wemake-python-styleguide

Bleeding edge django2.2 template focused on code quality and security.


Purpose

This project is used to scaffold a django project structure. Just like django-admin.py startproject but better.

Features

Installation

Firstly, you will need to install dependencies:

pip install cookiecutter jinja2-git

Then, create a project itself:

cookiecutter gh:wemake-services/wemake-django-template

Who is using this template?

If you use our template, please add yourself or your company in the list.

We offer free email support for anyone who is using this. If you have any problems or questions, drop us a line at [email protected]. And we will try to help you.

Here's a nice list of real-life open-source usages of this template.

License

MIT. See LICENSE for more details.

Comments
  • Make the Dockerfile multi-stage for dev and prod

    Make the Dockerfile multi-stage for dev and prod

    We thus separate what concerns python dependencies install, and the work-in-progress code to be mounted inside the VM.

    Having a COPY of the whole code and THEN a mountpoint on same folder is dangerous, because mount failure would be a silent error, and lead to hard-to-debug wrong behaviour.

    opened by pakal 12
  • Keeping Django database migrations backward compatible

    Keeping Django database migrations backward compatible

    After reading this post: https://medium.com/3yourmind/keeping-django-database-migrations-backward-compatible-727820260dbb

    Maybe we should add next libraries:

    • https://github.com/3YOURMIND/django-add-default-value
    • https://github.com/3YOURMIND/django-deprecate-fields
    • https://github.com/3YOURMIND/django-migration-linter
    feature dependencies pr-merged 
    opened by DmytroLitvinov 12
  • Update django to 2.2

    Update django to 2.2

    It is just released: https://docs.djangoproject.com/en/2.2/releases/2.2/

    Let's do it!

    • [x] Check libraries compatibility with django>=2.2
    • [ ] Upgrade source code at project
    feature dependencies python 
    opened by sobolevn 11
  • pytest not run

    pytest not run

    I launched a project. After creating the model, I'm trying to run tests. But I get an error.

    ERROR collecting server/apps/main/admin.py 
    server/apps/main/admin.py:12: in <module>
        admin.site.register(File, Dd)
    .venv/lib/python3.7/site-packages/django/contrib/admin/sites.py:110: in register
        raise AlreadyRegistered('The model %s is already registered' % model.__name__)
    E   django.contrib.admin.sites.AlreadyRegistered: The model File is already registered
    
    ERROR collecting server/apps/main/models.py 
    server/apps/main/models.py:28: in <module>
        class File(AbstractDefaultModel):
    .venv/lib/python3.7/site-packages/django/db/models/base.py:118: in __new__
        "INSTALLED_APPS." % (module, name)
    E   RuntimeError: Model class main.models.File doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
    

    my code models.py

    class AbstractDefaultModel(models.Model):
        is_active = models.BooleanField(
            verbose_name=_('is_active'),
            default=True)
    
        created_at = models.DateTimeField(
            verbose_name=_('created at'),
            auto_now_add=True)
    
        updated_at = models.DateTimeField(
            verbose_name=_('updated at'),
            auto_now=True)
    
        def __str__(self):
            return '{id}'.format(id=self.id)
    
        class Meta:
            abstract = True
    
    class File(AbstractDefaultModel):
        code = models.PositiveIntegerField(
            verbose_name='code',
            unique=True,
            editable=True)
    
        profile = models.CharField(
            verbose_name='name',
            max_length=100,
            blank=True,
            null=True)
    
        class Meta:
            verbose_name = 'file'
            verbose_name_plural = 'files'
    

    my code admin.py

    from server.apps.main.models import File
    class FileAdmin(admin.ModelAdmin):
        list_display = ['id', 'profile']
    
    admin.site.register(File, FileAdmin)
    
    pr-merged 
    opened by folt 10
  • Trying to run docker-compose build && docker-compose up gives an error:  test_project exited with code 127

    Trying to run docker-compose build && docker-compose up gives an error: test_project exited with code 127

    Trying to run docker-compose build && docker-compose up gives an error: test_project exited with code 127. I see ': No such file or directory'sh in the console output and since the error code 127 also is related to unknown command there seem to be something wrong with the dockerfile related to django.

    I'm testing this on Windows 10.

    pr-available pr-rejected 
    opened by weholt 10
  • Bump ipython from 7.31.0 to 8.0.0 in /{{cookiecutter.project_name}}

    Bump ipython from 7.31.0 to 8.0.0 in /{{cookiecutter.project_name}}

    Bumps ipython from 7.31.0 to 8.0.0.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 8
  • makemigrations permission denied.

    makemigrations permission denied.

    Hello,

    When I run in the following command in development mode.

    docker-compose -f docker-compose.yml -f docker-compose.dev.yml run --rm web python manage.py makemigrations
    

    I get in the following error; "Permission denied: '/code/server/apps/main/migrations/0002_blogpost_is_ok.py'"

    I'm using Linux.

    opened by mazlum 8
  • Database engine variables in a more general way

    Database engine variables in a more general way

    opened by folt 8
  • Bump flake8-pytest-style from 1.4.0 to 1.4.1 in /{{cookiecutter.project_name}}

    Bump flake8-pytest-style from 1.4.0 to 1.4.1 in /{{cookiecutter.project_name}}

    Bumps flake8-pytest-style from 1.4.0 to 1.4.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Automerge options (never/patch/minor, and dev/runtime dependencies)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies python 
    opened by dependabot-preview[bot] 7
  • Add note about `kira-setup`

    Add note about `kira-setup`

    We have this awesome little tool to setup Gitlab projects that perfectly matches this template. It is called kira-setup and it is a part of kira bots family.

    We can mention it in the docs. Maybe someone will find it useful. Link: https://github.com/wemake-services/kira-setup

    feature documentation 
    opened by sobolevn 7
  • Default site URL announced by docker should not be trusted

    Default site URL announced by docker should not be trusted

    Docker on start announces Starting development server at http://0.0.0.0:8000/. It is wrong and it is available under http://127.0.0.1:8000/. This should be reflected somewhere in documentation.

    bug documentation 
    opened by Hiyorimi 7
  • Update postgres Docker tag to v15

    Update postgres Docker tag to v15

    Mend Renovate

    This PR contains the following updates:

    | Package | Update | Change | |---|---|---| | postgres | major | 14-alpine -> 15-alpine |


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 2
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Open

    These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

    Detected dependencies

    docker-compose
    {{cookiecutter.project_name}}/docker-compose.override.yml
    {{cookiecutter.project_name}}/docker-compose.yml
    • postgres 14-alpine
    {{cookiecutter.project_name}}/docker/docker-compose.prod.yml
    • caddy 2.6.2

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
  • Use `pytest-modified-env` plugin

    Use `pytest-modified-env` plugin

    Yesterday I found that a single django test case in my private project was modifying os.environ without a clean up.

    It was the root cause of flaky CI builds that happened like once a week (because of random test order).

    Now, this won't happen: https://github.com/wemake-services/pytest-modified-env

    opened by sobolevn 0
Releases(django-one)
  • django-one(Jun 5, 2019)

  • goodbye-pipenv(Nov 16, 2018)

    This is the last pipenv release.

    We do not want to maintain any it any further. We are switching to poetry on all our projects.

    See #549 for more details. See "Migration guide" for more information.

    Source code(tar.gz)
    Source code(zip)
A Django project skeleton that is modern and cutting edge.

{% comment "This comment section will be deleted in the generated project" %} Edge A Fantastic Django project starter. Features Ready Bootstrap-themed

Arun Ravindran 827 Dec 15, 2022
Django Webpack starter template for using Webpack 5 with Django 3.1 & Bootstrap 4. Yes, it can hot-reload.

Django Webpack Starter Hello fellow human. The repo uses Python 3.9.* Django 3.1.* Webpack 5.4.* Bootstrap 4.5.* Pipenv If you have any questions twe

Ganesh Khade 56 Nov 28, 2022
Project template layout for Django 3.0+

Django 3.0+ project template This is a simple Django 3.0+ project template with my preferred setup. Most Django project templates make way too many as

José Padilla 649 Dec 30, 2022
A Django starter template with a sound foundation.

SOS Django Template SOS Django Tempalate is a Django starter template that has opinionated and good solutions while starting your new Django project.

Eray Erdin 19 Oct 30, 2022
Um template para quem quiser usar o Docker + PGSQL + Django.

Um template para quem quiser usar o Docker + PGSQL + Django.

Drack 2 Mar 11, 2022
Code Kata Python Template

Code Kata Python Template This is the code kata template for python created by Aula de Software Libre de la Universidad de Córdoba Step 1. Use this re

Sergio Gómez 2 Nov 30, 2021
A template repo for use in the Advent of Code

AoC-Template A template repo for use in the Advent of Code The README_template.md must contain "STATS_TABLE" to be replaced by the generated table, an

null 0 Jan 14, 2022
Vue + Django with no compromises. Django Templates and Vue SFCs in harmony without sacrificing the full power of either.

Cookiecutter Vue Django Vue + Django with no compromise. Cookiecutter Vue Django is a framework for jumpstarting production-ready Django + Vue project

Mike Hoolehan 122 Dec 22, 2022
Basic Docker Compose template application with Flask, Celery, Redis, MySQL, SocketIO, Nginx and Gunicorn.

Nginx / Gunicorn / Flask ?? / Celery / SocketIO / MySQL / Redis / Docker ?? sample application Basic Docker Compose template application for orchestat

Alex Oarga 8 Aug 6, 2022
A low dependency and really simple to start project template for Python Projects.

Python Project Template A low dependency and really simple to start project template for Python Projects. HOW TO USE THIS TEMPLATE DO NOT FORK this is

Yurii Dubinka 5 Jan 21, 2022
Django sample app with users including social auth via Django-AllAuth

demo-allauth-bootstrap Simple, out-of-the-box Django all-auth demo app A "brochure" or visitor (no login required) area A members-only (login required

Andrew E 215 Dec 20, 2022
Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.

Cookiecutter Django Powered by Cookiecutter, Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly. Documentati

Daniel Roy Greenfeld 10k Jan 1, 2023
Ultimate Django3.2 Template for starting any project from not zero!

Ultimate Django3.2 Template for starting any project from not zero!

TheAliBigdeli 37 Dec 20, 2022
Generic template for python service

Cookie cutter template example Technology stack Flask Gevent UWSGI Poetry Docker Docker-compose Installation pip install cookiecutter cookiecutter git

Churkin Oleg 11 Oct 22, 2022
Template repository to build PyTorch projects from source on any version of PyTorch/CUDA/cuDNN.

Template repository to build PyTorch projects from source on any version of PyTorch/CUDA/cuDNN.

Joonhyung Lee/이준형 651 Dec 12, 2022
A template repository implementing HTML5 Boilerplate 8.0 in Sanic using the Domonic framework.

sanic-domonic-h5bp A template repository implementing HTML5 Boilerplate 8.0 in Sanic using the Domonic framework. If you need frontend interactivity,

PyXY 3 Dec 12, 2022
A template for some new Python tool or package with a reasonable basic setup.

python-app-template A template with a reasonable basic setup, including: black (formatting) flake8 (linting) mypy (type checking) isort (import sortin

Anton Pirogov 3 Jul 19, 2022
Generic python project template

generic-python-project-template generic-python-project-template STEPS - STEP 01- Create a repository by using template repository STEP 02- Clone the n

SUNNY BHAVEEN CHANDRA 3 Oct 3, 2022
A python starter package to be used as a template for creating your own python packages.

Python Starter Package This is a basic python starter package to be used as a template for creating your own python packages. Github repo: https://git

Mystic 1 Apr 4, 2022