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)
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
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
NHS Theme for Streamlit applications

NHS Streamlit App Template Deployment (local) The tool has been built using Stre

nhs.pycom 3 Nov 07, 2022
A framework for launching new Django Rest Framework projects quickly.

DRFx A framework for launching new Django Rest Framework projects quickly. Comes with a custom user model, login/logout/signup, social authentication

William Vincent 400 Dec 29, 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
Forkable, Minimal Template for Starknet Projects.

Forkable, Minimal Template for Starknet Projects.

andreas 44 Oct 09, 2022
Creating Templates and components so those can be reusable some time and makes workflow a lot easier!

TEMPLATES AND COMPONENTS IN ANY LANG! This is an Open Repository For Students to Contribute code in Hackoctoberfest in different Languages and Tech me

SriSravyaN 9 Feb 19, 2022
This is 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

Jami Travers 5 May 25, 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
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
Template for creating ds simple projects

ds-project-template Template for creating ds simple projects Requirements pyenv python==3.9.4 Setup For this purpose you use following commands: pytho

1 Dec 17, 2021
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
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
Forkable, Minimal Template for Starknet Projects.

Forkable, Minimal Template for Starknet Projects.

velleity.eth 44 Oct 09, 2022
Brif is a boilerplate tool based on Docker and FastAPI, designed to streamline the development and deployment of IIIF compliant platforms.

brif A boilerplate tool based on Docker, designed to streamline the development and deployment of IIIF compliant platforms. Embedded with FastAPI, Cel

Pierre 8 Sep 17, 2022
This is a FastAPI, React, MongoDB stack Boilerplate. It's as glorious as a highland coo.

Coo - F.A.R.M stack BoilerPlate F.A.R.M - FastAPI, React, MongoDB This boilerplate utilizes FastAPI to build a REST API, MongoDB for data storage, and

Peter Waters 2 Feb 06, 2022
Cookiecutter to create a Google Function. Powered by Poetry, GitHub actions, and Google Cloud Platform

Cookiecutter Google Function Cookiecutter template for a Google Function. Powered by Poetry, and GitHub actions. Quickstart Install the latest Cookiec

Arthur 1 Jan 07, 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