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)
Simple boilerplate ready for development

StartApp Simple boilerplate ready for development Notes Currently supported frameworks are: FastApi, Flask 🔨 Installation $ sudo pip3 install starta

Sabuhi 16 Oct 16, 2022
Get a Django app up and running in dev, test, and production with best practices in 10 minutes

Django template for Docker + Heroku This is how I set up Django projects to get up and running as quick as possible. In includes a few neat things: De

Ben Firshman 30 Oct 13, 2022
A command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, VueJS projects.

Cookiecutter A command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python

18.7k Jan 08, 2023
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
Template for creating PyPI project

template-for-creating-pypi-project Template for creating PyPI project Hello there! This is a template for creating a PyPI project. Fork or clone this

4 Apr 25, 2022
Template to quickly start your playwright-python project

Playwright-python template 🍪 Template to quickly start your playwright-python project Getting started • Demo • Configuration Getting started Clone th

Constantin 1 Dec 13, 2021
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
King is a simple boilerplate from a bigger Discord Bot project created for my Discord Server.

King A simple Discord bot boilerplate. King is a simple boilerplate from a bigger Discord Bot project created for my Discord Server. I intend to showc

Xminent 0 Aug 21, 2021
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
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
Starter project for python based lambda project.

Serverless Python Starter Starter project for python based lambda project. Features FastAPI - Frontend dev with Hot Reload API Gateway Integration (+r

4 Feb 22, 2022
Boilerplate code for a Python Flask API

MrMat :: Python :: API :: Flask Boilerplate code for a Python Flask API This variant of a Python Flask API is code-first and using native Flask Featur

0 Dec 26, 2021
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 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
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 04, 2022
A platform for developers 👩‍💻 who wants to share their programs and projects.

Hacktoberfest-2021 A platform for developers 👩‍💻 who wants to share their projects and programs. Hacktoberfest has updated their rules and now this

Mayank Choudhary 40 Nov 07, 2022
PyPC is a very simple tool that creates Python projects from templates.

PyPC (Python Project Creator) PyPC is a very simple tool that creates Python projects from templates. In 0.1v#alpha, custom template creation will be

art3m1s 1 Nov 26, 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

0 Jan 14, 2022
A full stack boilerplate for FastAPI

A full stack boilerplate for FastAPI

Tyler M. Kontra 94 Dec 13, 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