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 simple cookiecutter to create Python Telegram bots, wrapped with Django.

PTB Django cookiecutter A simple cookiecutter to create Python Telegram bots, wrapped with Django. Based on this cool projects python-telegram-bot (PT

Carlos Lugones 20 Nov 12, 2022
Django Boilerplate - Material Kit Design | AppSeed

Django Boilerplate - Material Kit Design | AppSeed

App Generator 45 Dec 23, 2022
Flask Boilerplate - Material Kit Design | AppSeed

Flask Boilerplate - Material Kit Design | AppSeed

App Generator 45 Nov 18, 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
Forkable, Minimal Template for Starknet Projects.

Forkable, Minimal Template for Starknet Projects.

velleity.eth 44 Oct 09, 2022
The starter for the Flask React project

Flask React Project This is the starter for the Flask React project. Getting started Clone this repository (only this branch) git clone https://github

Parker Bolick 2 May 14, 2022
Forkable, Minimal Template for Starknet Projects.

Forkable, Minimal Template for Starknet Projects.

andreas 44 Oct 09, 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 03, 2022
CRUD app to create and save code snippets, Flask/Python restful Api/backend and React/Typescript frontend

MS3 Cheat-Hub A cheatsheet hub. An app that organizes your code snippets into collections of cheat sheets and allows you to view, like and save others

Joem Elias Sanez 21 Dec 28, 2022
Combine the power of FastAPI and Django to build a production-ready application capable of utilizing all of the best features of both worlds.

FastAPI and Django Combo This projects aims to combine FastAPI and Django to build a Production ready application capable of utilizing all of the feat

Nsikak Imoh 33 Dec 27, 2022
Cookiecutter Flask OpenAPI is a template for jumpstarting production-ready Flask projects quickly.

Cookiecutter Flask OpenAPI is a template for jumpstarting production-ready Flask projects quickly. It has a well organized and scalable structure. It uses API design first

Roger Camargo 3 Nov 17, 2022
The starter repository for submissions to the GeneDisco challenge for optimized experimental design in genetic perturbation experiments

GeneDisco ICLR-22 Challenge Starter Repository The starter repository for submissions to the GeneDisco challenge for optimized experimental design in

22 Dec 06, 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
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 06, 2022
Open-source full-stack seed project that uses a React UI powered by a simple Flask API Server

React Flask Authentication Open-source full-stack seed project that uses a React UI powered by a simple Flask API Server.

App Generator 37 Dec 24, 2022
This is a boilerplate for a basic backend app using Python, Django and SQLite, as developed after tutorials with Programming with Mosh

This is a boilerplate for a basic backend app using Python, Django and SQLite, as developed after tutorials with Programming with Mosh

Gustavo Catala Sverdrup 1 Jan 07, 2022
A Boilerplate repo for Scientific Python Open Science projects

A Boilerplate repo for Scientific Python Open Science projects Installation Clone this repo If you need a fresh python environment, run $ conda env cr

Vincent Choqueuse 2 Dec 23, 2021
The Django Base Site is a Django site that is built using the best Django practices and comes with all the common Django packages that you need to jumpstart your next project.

Django Base Site The Django Base Site is a Django site that is built using the best Django practices and comes with all the common Django packages tha

Brent O'Connor 167 Jan 03, 2023
A boilerplate Django project for quickly getting started.

The Definitive Django Learning Platform. Django Project Boilerplate This repository is a boilerplate Django project for quickly getting started. Getti

Le Huynh Long 1 Nov 01, 2021
Django starter project with πŸ”‹

A batteries-included Django starter project. For a production-ready version see the book Django for Professionals. πŸš€ Features Django 3.1 & Python 3.8

William Vincent 1.5k Jan 08, 2023