Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.

Overview

Cookiecutter Django

Build Status Documentation Status Updates Join our Discord Code Helpers Badge Code style: black

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

Features

  • For Django 3.2
  • Works with Python 3.9
  • Renders Django projects with 100% starting test coverage
  • Twitter Bootstrap v5
  • 12-Factor based settings via django-environ
  • Secure by default. We believe in SSL.
  • Optimized development and production settings
  • Registration via django-allauth
  • Comes with custom user model ready to go
  • Optional basic ASGI setup for Websockets
  • Optional custom static build using Gulp and livereload
  • Send emails via Anymail (using Mailgun by default or Amazon SES if AWS is selected cloud provider, but switchable)
  • Media storage using Amazon S3 or Google Cloud Storage
  • Docker support using docker-compose for development and production (using Traefik with LetsEncrypt support)
  • Procfile for deploying to Heroku
  • Instructions for deploying to PythonAnywhere
  • Run tests with unittest or pytest
  • Customizable PostgreSQL version
  • Default integration with pre-commit for identifying simple issues before submission to code review

Optional Integrations

These features can be enabled during initial project setup.

  • Serve static files from Amazon S3, Google Cloud Storage or Whitenoise
  • Configuration for Celery and Flower (the latter in Docker setup only)
  • Integration with MailHog for local email testing
  • Integration with Sentry for error logging

Constraints

  • Only maintained 3rd party libraries are used.
  • Uses PostgreSQL everywhere (10.19 - 14.1)
  • Environment variables for configuration (This won't work with Apache/mod_wsgi).

Support this Project!

This project is run by volunteers. Please support them in their efforts to maintain and improve Cookiecutter Django:

  • Daniel Roy Greenfeld, Project Lead (GitHub, Patreon): expertise in Django and AWS ELB.
  • Nikita Shupeyko, Core Developer (GitHub): expertise in Python/Django, hands-on DevOps and frontend experience.

Projects that provide financial support to the maintainers:


Two Scoops of Django

Two Scoops of Django 3.x is the best ice cream-themed Django reference in the universe!

PyUp

pyup

PyUp brings you automated security and dependency updates used by Google and other organizations. Free for open source projects!

Usage

Let's pretend you want to create a Django project called "redditclone". Rather than using startproject and then editing the results to include your name, email, and various configuration issues that always get forgotten until the worst possible moment, get cookiecutter to do all the work.

First, get Cookiecutter. Trust me, it's awesome:

$ pip install "cookiecutter>=1.7.0"

Now run it against this repo:

$ cookiecutter https://github.com/cookiecutter/cookiecutter-django

You'll be prompted for some values. Provide them, then a Django project will be created for you.

Warning: After this point, change 'Daniel Greenfeld', 'pydanny', etc to your own information.

Answer the prompts with your own desired options. For example:

Cloning into 'cookiecutter-django'...
remote: Counting objects: 550, done.
remote: Compressing objects: 100% (310/310), done.
remote: Total 550 (delta 283), reused 479 (delta 222)
Receiving objects: 100% (550/550), 127.66 KiB | 58 KiB/s, done.
Resolving deltas: 100% (283/283), done.
project_name [Project Name]: Reddit Clone
project_slug [reddit_clone]: reddit
author_name [Daniel Roy Greenfeld]: Daniel Greenfeld
email [[email protected]]: [email protected]
description [Behold My Awesome Project!]: A reddit clone.
domain_name [example.com]: myreddit.com
version [0.1.0]: 0.0.1
timezone [UTC]: America/Los_Angeles
use_whitenoise [n]: n
use_celery [n]: y
use_mailhog [n]: n
use_sentry [n]: y
use_pycharm [n]: y
windows [n]: n
use_docker [n]: n
use_heroku [n]: y
use_compressor [n]: y
Select postgresql_version:
1 - 14.1
2 - 13.5
3 - 12.9
4 - 11.14
5 - 10.19
Choose from 1, 2, 3, 4, 5 [1]: 1
Select js_task_runner:
1 - None
2 - Gulp
Choose from 1, 2 [1]: 1
Select cloud_provider:
1 - AWS
2 - GCP
3 - None
Choose from 1, 2, 3 [1]: 1
custom_bootstrap_compilation [n]: n
Select open_source_license:
1 - MIT
2 - BSD
3 - GPLv3
4 - Apache Software License 2.0
5 - Not open source
Choose from 1, 2, 3, 4, 5 [1]: 1
keep_local_envs_in_vcs [y]: y
debug[n]: n

Enter the project and take a look around:

$ cd reddit/
$ ls

Create a git repo and push it there:

$ git init
$ git add .
$ git commit -m "first awesome commit"
$ git remote add origin [email protected]:pydanny/redditclone.git
$ git push -u origin master

Now take a look at your repo. Don't forget to carefully look at the generated README. Awesome, right?

For local development, see the following:

Community

  • Have questions? Before you ask questions anywhere else, please post your question on Stack Overflow under the cookiecutter-django tag. We check there periodically for questions.
  • If you think you found a bug or want to request a feature, please open an issue.
  • For anything else, you can chat with us on Discord.

For Readers of Two Scoops of Django

You may notice that some elements of this project do not exactly match what we describe in chapter 3. The reason for that is this project, amongst other things, serves as a test bed for trying out new ideas and concepts. Sometimes they work, sometimes they don't, but the end result is that it won't necessarily match precisely what is described in the book I co-authored.

For PyUp Users

If you are using PyUp to keep your dependencies updated and secure, use the code cookiecutter during checkout to get 15% off every month.

"Your Stuff"

Scattered throughout the Python and HTML of this project are places marked with "your stuff". This is where third-party libraries are to be integrated with your project.

Releases

Need a stable release? You can find them at https://github.com/cookiecutter/cookiecutter-django/releases

Not Exactly What You Want?

This is what I want. It might not be what you want. Don't worry, you have options:

Fork This

If you have differences in your preferred setup, I encourage you to fork this to create your own version. Once you have your fork working, let me know and I'll add it to a 'Similar Cookiecutter Templates' list here. It's up to you whether or not to rename your fork.

If you do rename your fork, I encourage you to submit it to the following places:

  • cookiecutter so it gets listed in the README as a template.
  • The cookiecutter grid on Django Packages.

Submit a Pull Request

We accept pull requests if they're small, atomic, and make our own project development experience better.

Articles

Have a blog or online publication? Write about your cookiecutter-django tips and tricks, then send us a pull request with the link.

Code of Conduct

Everyone interacting in the Cookiecutter project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the PyPA Code of Conduct.

Comments
  • Update to Django 1.11

    Update to Django 1.11

    I've told the bot to stay on 1.10.x for now (https://github.com/pydanny/cookiecutter-django/commit/f62e05b95e60c043cb463c66b40ca69c1f2d9c26) and merged the latest security release.

    I believe @luzfcb was working on a release checklist. Let's put this here.

    opened by jayfk 49
  • Local Docker: python: can't open file 'manage.py': [Errno 2] No such file or directory

    Local Docker: python: can't open file 'manage.py': [Errno 2] No such file or directory

    What happened?

    I get this error message python: can't open file 'manage.py': [Errno 2] No such file or directory after running the following commands:

    docker-compose -f local.yml build
    docker-compose -f local.yml up -d
    

    What should've happened instead?

    Django should have been running on my local docker-machine

    Steps to reproduce

    
    # cookiecutter https://github.com/pydanny/cookiecutter-django
    You've downloaded C:\Users\ph\.cookiecutters\cookiecutter-django before. Is it okay to delete and re-download it? [yes]: yes
    project_name [My Awesome Project]: mytestproject.nu
    project_slug [mytestproject_nu]:
    description [Behold My Awesome Project!]: My Test Project
    author_name [Daniel Roy Greenfeld]: Philip
    domain_name [example.com]: mytestproject.nu
    email [[email protected]]: [email protected]
    version [0.1.0]:
    Select open_source_license:
    Choose from 1, 2, 3, 4, 5 [1]: 1
    timezone [UTC]: Europe/Copenhagen
    windows [n]: y
    use_pycharm [n]: y
    use_docker [n]: y
    Select postgresql_version:
    Choose from 1, 2, 3, 4, 5, 6, 7, 8 [1]: 1
    Select js_task_runner:
    Choose from 1, 2 [1]: 1
    Select cloud_provider:
    Choose from 1, 2 [1]: 2
    custom_bootstrap_compilation [n]: n
    use_compressor [n]: y
    use_celery [n]: y
    use_mailhog [n]: y
    use_sentry [n]: y
    use_whitenoise [n]: n
    use_heroku [n]: n
    use_travisci [n]: n
    keep_local_envs_in_vcs [y]: y
    debug [n]: n
     [SUCCESS]: Project initialized, keep up the good work!
    

    docker-compose -f local.yml build docker-compose -f local.yml up -d

    # docker-machine --version
    Docker-machine version 0.16.1, build cce350d7
    
    # docker --version
    Docker version 18.09.2, build 6247962
    

    Microsoft Windows 10 Pro Version 10.0.17134 Build 17134

    # docker-compose -f local.yml logs
     Attaching to mytestproject_nu_celeryworker_1, mytestproject_nu_django_1, mytestproject_nu_flower_1, mytestproject_nu_celerybeat_1, mytestproject_nu_postgres_1, mytestproject_nu_mailhog_1, mytestproject_nu_redis_1
    celeryworker_1  | Waiting for PostgreSQL to become available...
    celeryworker_1  | Waiting for PostgreSQL to become available...
    celeryworker_1  | PostgreSQL is available
    celeryworker_1  | Error:
    celeryworker_1  | Unable to load celery application.
    celeryworker_1  | The module config was not found.
    celeryworker_1  |
    django_1        | Waiting for PostgreSQL to become available...
    postgres_1      | The files belonging to this database system will be owned by user "postgres".
    postgres_1      | This user must also own the server process.
    postgres_1      |
    django_1        | Waiting for PostgreSQL to become available...
    postgres_1      | The database cluster will be initialized with locale "en_US.utf8".
    django_1        | PostgreSQL is available
    postgres_1      | The default database encoding has accordingly been set to "UTF8".
    postgres_1      | The default text search configuration will be set to "english".
    postgres_1      |
    postgres_1      | Data page checksums are disabled.
    postgres_1      |
    postgres_1      | fixing permissions on existing directory /var/lib/postgresql/data ... ok
    postgres_1      | creating subdirectories ... ok
    postgres_1      | selecting default max_connections ... 100
    postgres_1      | selecting default shared_buffers ... 128MB
    postgres_1      | selecting dynamic shared memory implementation ... posix
    postgres_1      | creating configuration files ... ok
    postgres_1      | running bootstrap script ... ok
    postgres_1      | performing post-bootstrap initialization ... ok
    postgres_1      | syncing data to disk ... ok
    postgres_1      |
    postgres_1      | WARNING: enabling "trust" authentication for local connections
    django_1        | python: can't open file 'manage.py': [Errno 2] No such file or directory
    postgres_1      | You can change this by editing pg_hba.conf or using the option -A, or
    postgres_1      | --auth-local and --auth-host, the next time you run initdb.
    postgres_1      |
    postgres_1      | Success. You can now start the database server using:
    postgres_1      |
    postgres_1      |     pg_ctl -D /var/lib/postgresql/data -l logfile start
    postgres_1      |
    postgres_1      | waiting for server to start....2019-05-19 09:32:59.577 UTC [40] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
    postgres_1      | 2019-05-19 09:32:59.596 UTC [41] LOG:  database system was shut down at 2019-05-19 09:32:59 UTC
    postgres_1      | 2019-05-19 09:32:59.601 UTC [40] LOG:  database system is ready to accept connections
    mailhog_1       | 2019/05/19 09:32:57 Using in-memory storage
    postgres_1      |  done
    postgres_1      | server started
    mailhog_1       | 2019/05/19 09:32:57 [SMTP] Binding to address: 0.0.0.0:1025
    mailhog_1       | [HTTP] Binding to address: 0.0.0.0:8025
    mailhog_1       | 2019/05/19 09:32:57 Serving under http://0.0.0.0:8025/
    postgres_1      | CREATE DATABASE
    mailhog_1       | Creating API v1 with WebPath:
    postgres_1      |
    mailhog_1       | Creating API v2 with WebPath:
    postgres_1      |
    postgres_1      | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
    postgres_1      |
    postgres_1      | 2019-05-19 09:33:00.080 UTC [40] LOG:  received fast shutdown request
    postgres_1      | waiting for server to shut down....2019-05-19 09:33:00.087 UTC [40] LOG:  aborting any active transactions
    postgres_1      | 2019-05-19 09:33:00.090 UTC [40] LOG:  worker process: logical replication launcher (PID 47) exited with exit code 1
    postgres_1      | 2019-05-19 09:33:00.090 UTC [42] LOG:  shutting down
    postgres_1      | 2019-05-19 09:33:00.110 UTC [40] LOG:  database system is shut down
    postgres_1      |  done
    postgres_1      | server stopped
    postgres_1      |
    postgres_1      | PostgreSQL init process complete; ready for start up.
    postgres_1      |
    postgres_1      | 2019-05-19 09:33:00.191 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
    redis_1         | 1:C 19 May 09:32:57.284 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
    postgres_1      | 2019-05-19 09:33:00.191 UTC [1] LOG:  listening on IPv6 address "::", port 5432
    redis_1         |                 _._
    postgres_1      | 2019-05-19 09:33:00.197 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
    postgres_1      | 2019-05-19 09:33:00.212 UTC [58] LOG:  database system was shut down at 2019-05-19 09:33:00 UTC
    postgres_1      | 2019-05-19 09:33:00.217 UTC [1] LOG:  database system is ready to accept connections
    redis_1         |            _.-``__ ''-._
    redis_1         |       _.-``    `.  `_.  ''-._           Redis 3.2.12 (00000000/0) 64 bit
    redis_1         |   .-`` .-```.  ```\/    _.,_ ''-._
    redis_1         |  (    '      ,       .-`  | `,    )     Running in standalone mode
    redis_1         |  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
    redis_1         |  |    `-._   `._    /     _.-'    |     PID: 1
    redis_1         |   `-._    `-._  `-./  _.-'    _.-'
    redis_1         |  |`-._`-._    `-.__.-'    _.-'_.-'|
    redis_1         |  |    `-._`-._        _.-'_.-'    |           http://redis.io
    redis_1         |   `-._    `-._`-.__.-'_.-'    _.-'
    redis_1         |  |`-._`-._    `-.__.-'    _.-'_.-'|
    redis_1         |  |    `-._`-._        _.-'_.-'    |
    redis_1         |   `-._    `-._`-.__.-'_.-'    _.-'
    redis_1         |       `-._    `-.__.-'    _.-'
    redis_1         |           `-._        _.-'
    redis_1         |               `-.__.-'
    redis_1         |
    redis_1         | 1:M 19 May 09:32:57.288 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
    redis_1         | 1:M 19 May 09:32:57.288 # Server started, Redis version 3.2.12
    celerybeat_1    | Waiting for PostgreSQL to become available...
    celerybeat_1    | Waiting for PostgreSQL to become available...
    redis_1         | 1:M 19 May 09:32:57.288 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
    redis_1         | 1:M 19 May 09:32:57.288 * The server is now ready to accept connections on port 6379
    celerybeat_1    | PostgreSQL is available
    celerybeat_1    | Error:
    celerybeat_1    | Unable to load celery application.
    celerybeat_1    | The module config was not found.
    celerybeat_1    |
    flower_1        | Waiting for PostgreSQL to become available...
    flower_1        | Waiting for PostgreSQL to become available...
    flower_1        | PostgreSQL is available
    flower_1        | Error:
    flower_1        | Unable to load celery application.
    flower_1        | The module config was not found.
    flower_1        |
    
    docker bug windows 
    opened by philiphoyos 43
  • Update to Django 1.10

    Update to Django 1.10

    Checklist:

    • [x] Before update to Django 1.10, create a git tag to current version of cookiecuter-django
    • [ ] Check if all dependencies officialy work with Django 1.10( if not, wait)
    • [x] Check that the tests pass on Django 1.10
    • [ ] Check that the tests pass on Django 1.10 with zero deprecation warnings messages: https://docs.djangoproject.com/en/1.10/howto/upgrade-version/#resolving-deprecation-warnings
    • [ ] Update to Django 1.10 and update other dependencies and:
      • [x] Check if all possible generated project layout still works on deploy on Heroku.
      • [ ] Check if all possible generated project layout still works on deploy on Docker.
      • [ ] Check PyCharm 2016.2 compatibility, with and widout docker
      • [x] Update the README.rst
      • [x] Update version on setup.py
      • [x] Update changelog.
      • [x] after update, create a git tag

    related: https://github.com/pydanny/cookiecutter-django/pull/702

    opened by luzfcb 41
  • WIP: Pycharm Support (including debugging in Docker!)

    WIP: Pycharm Support (including debugging in Docker!)

    The goal of this PR is to introduce a "ready to go" configuration for PyCharm.

    Moreover, this PR introduce debuggable dockercontainer, which can be build by debug.yml using docker-compass. Take a look on description in file:{{cookiecutter.repo_name}}/docs/docker_remote_debugging.rst

    Please Read: docker_remote_debugging.rst

    For PyCharm users, this PR provides more than 20 Run/Debug Configurations, which can be very easily activated in two easy steps.

    Instructions for other IDEs are more than welcome!

    ~~This PR has still status "Work in progress", because few other things has to be done:~~

    ToDo

    • [x] - pycharm and docker are now optional
      • [x] - if user decide not to use pycharm or docker, proper files are removed in post_gen_project.py hook
    • [x] - posibility of login into docker container with compose/pycharm/.ssh_keys_to_docker/id_rsa
    • [x] - user can compile scss file inside a docker container. Compass doesn't have to be installed on host machine
    • [x] - cleaning in /compose/pycharm/ directory. Directory should be renamed to /compose/debug/, pycharm related stuff should be moved somewhere else.
    • [x] - ~~move node to separate container, and building assets process to entrypoint script~~
    • [x] - fix problem with Fatal error: Unable to find local grunt. inside docker
    • [x] - dev.yml and debug.yml should use this same user. Note: django user is renamed (only in debug container!) to docker_{{ cookiecutter.repo_name }}, to improve visibility during debugging multiple containers.
    • [x] - improve .gitignore
    • [x] - rebase
    • [x] - write documentation in section Configure Remote Python Interpreter based on deployment settings in docs/docker_remote_debugging.rst
      • [x] - Add screenshots
    • [x] - ~~some tests~~, PoC prepared: https://github.com/pydanny/cookiecutter-django/issues/309
    opened by noisy 39
  • Consider removing Webpack/React option

    Consider removing Webpack/React option

    We are getting a lot of support requests for our Webpack integration. Unfortunately, it doesn't work with all setups configurations all the time. None of the core devs of this project are that knowledgable of the toolchain, and have difficulty helping users. Community assistance with the issue has also been negligible, and we're not even sure who understands the toolchain.

    Please share your opinions.

    Paging @goldhand, @jayfk, @luzfcb, @audreyr, @theskumar

    opened by pydanny 37
  • Replace Caddy with Traefik

    Replace Caddy with Traefik

    Description

    Replace Caddy with Traefik

    Rationale

    There is some trouble with the Caddy license (https://github.com/pydanny/cookiecutter-django/pull/1282#issuecomment-329617536)

    @drdaeman suggested using Traefik (https://github.com/pydanny/cookiecutter-django/pull/1282#issuecomment-353655273) which supports ACME and also plays very nice with Docker.

    Use case(s) / visualization(s)

    Comments

    I am currently using the proposed setup on a live site and it working great so far. If this PR is of interest to the maintainers, then I could commit more changes and take care of the documentation. Of course, any suggestions by the more experienced people around here, are welcome!

    opened by demestav 33
  • Enable user app routes when DEBUG is True only

    Enable user app routes when DEBUG is True only

    Description

    The user app exposes all users' details to any registered user. This was of course intentional, since the purpose of the user app is to demonstrate the functionality and not to be deployed in production as-is. However, a developer who is not familiar with the cookiecutter-django's structure, may overlook this and expose user information.

    Therefore, the user app should only be enabled when DEBUG == True in the settings.

    Closes #1739, Closes #1752.

    Rationale

    Since DEBUG = False in production settings, even if the user app is left as-is, it will not be enabled and users' information will not be exposed.

    ready for review 
    opened by demestav 29
  • Can't access admin site after deploy production.

    Can't access admin site after deploy production.

    When i deploy project in dev mode i can access admin site(127.0.0.0:8000/admin), but when I deploy project in production mode I can't access admin site(docker-machine-ip/admin). Note: other function still work fine,.env setting: DJANGO_ADMIN_URL=admin Any idea to enable admin site on production mode.

    opened by cunhuvan 28
  • Adding fields to the User model

    Adding fields to the User model

    Please excuse me if the answer to my question is painfully obvious but I'm new to Django and I'm not very familiar with custom user models.

    If I wanted to add another field to the user model (for example, "department" - the users are employees), where would I add it?

    I figured I could add a department variable to models.py but it doesn't seem to work. When I login to the admin site, I don't see a "department" field when I add a user. Similarly, I don't see a "name" field in the admin site - I only see First Name, Last Name, and Email Address.

    # models.py
    # -*- coding: utf-8 -*-
    from __future__ import unicode_literals, absolute_import
    
    from django.contrib.auth.models import AbstractUser
    from django.core.urlresolvers import reverse
    from django.db import models
    from django.utils.encoding import python_2_unicode_compatible
    
    
    @python_2_unicode_compatible
    class User(AbstractUser):
    
        # First Name and Last Name do not cover name patterns
        # around the globe.
        name = models.CharField(blank=True, max_length=255)
        department = models.CharField(blank=True, max_length=5)
    
        def __str__(self):
            return self.username
    
        def get_absolute_url(self):
            return reverse('users:detail', kwargs={'username': self.username})
    
    duplicate docs 
    opened by benjaminsingleton 26
  • Migrate to Pipfile

    Migrate to Pipfile

    • **I'm submitting a ... **
      • [ ] bug report
      • [X] feature request
      • [ ] support request => Please do not submit support request here, see note at the top of this template.

    It might be good if the project migrated from requirements.txt to a Pipfile/pipenv, which is a better method of tracking requirements and is the official Python replacement for requirements.txt as well.

    opened by skorokithakis 25
  • No support for python3? I am getting: invalid syntax: raise ValueError,

    No support for python3? I am getting: invalid syntax: raise ValueError, "No frame marked with %s." % fname

    File "/home/user/hosting/cookiecutter/lib/python3.6/site-packages/environ.py", line 114 raise ValueError, "No frame marked with %s." % fname ^ SyntaxError: invalid syntax

    Edited by maintainer:

    A possible solution is: https://github.com/cookiecutter/cookiecutter-django/issues/2106#issuecomment-553089821

    opened by emanresu92 24
  • Update sphinx to 6.1.2

    Update sphinx to 6.1.2

    This PR updates sphinx from 5.3.0 to 6.1.2.

    Changelog

    6.1.2

    =====================================
    
    Bugs fixed
    ----------
    
    * 11101: LaTeX: ``div.topic_padding`` key of sphinxsetup documented at 5.1.0 was
    implemented with name ``topic_padding``
    * 11099: LaTeX: ``shadowrule`` key of sphinxsetup causes PDF build to crash
    since Sphinx 5.1.0
    * 11096: LaTeX: ``shadowsize`` key of sphinxsetup causes PDF build to crash
    since Sphinx 5.1.0
    * 11095: LaTeX: shadow of :dudir:`topic` and contents_ boxes not in page
    margin since Sphinx 5.1.0
    
    .. _contents: https://docutils.sourceforge.io/docs/ref/rst/directives.html#table-of-contents
    * 11100: Fix copying images when running under parallel mode.
    

    6.1.1

    =====================================
    
    Bugs fixed
    ----------
    
    * 11091: Fix ``util.nodes.apply_source_workaround`` for ``literal_block`` nodes
    with no source information in the node or the node's parents.
    

    6.1.0

    =====================================
    
    Dependencies
    ------------
    
    * Adopted the `Ruff`_ code linter.
    
    .. _Ruff: https://github.com/charliermarsh/ruff
    
    Incompatible changes
    --------------------
    
    * 10979: gettext: Removed support for pluralisation in ``get_translation``.
    This was unused and complicated other changes to ``sphinx.locale``.
    
    Deprecated
    ----------
    
    * ``sphinx.util`` functions:
    
    * Renamed ``sphinx.util.typing.stringify()``
      to ``sphinx.util.typing.stringify_annotation()``
    * Moved ``sphinx.util.xmlname_checker()``
      to ``sphinx.builders.epub3._XML_NAME_PATTERN``
    
    Moved to ``sphinx.util.display``:
    
    * ``sphinx.util.status_iterator``
    * ``sphinx.util.display_chunk``
    * ``sphinx.util.SkipProgressMessage``
    * ``sphinx.util.progress_message``
    
    Moved to ``sphinx.util.http_date``:
    
    * ``sphinx.util.epoch_to_rfc1123``
    * ``sphinx.util.rfc1123_to_epoch``
    
    Moved to ``sphinx.util.exceptions``:
    
    * ``sphinx.util.save_traceback``
    * ``sphinx.util.format_exception_cut_frames``
    
    Features added
    --------------
    
    * Cache doctrees in the build environment during the writing phase.
    * Make all writing phase tasks support parallel execution.
    * 11072: Use PEP 604 (``X | Y``) display conventions for ``typing.Optional``
    and ``typing.Optional`` types within the Python domain and autodoc.
    * 10700: autodoc: Document ``typing.NewType()`` types as classes rather than
    'data'.
    * Cache doctrees between the reading and writing phases.
    
    Bugs fixed
    ----------
    
    * 10962: HTML: Fix the multi-word key name lookup table.
    * Fixed support for Python 3.12 alpha 3 (changes in the ``enum`` module).
    * 11069: HTML Theme: Removed outdated "shortcut" link relation keyword.
    * 10952: Properly terminate parallel processes on programme interuption.
    * 10988: Speed up ``TocTree.resolve()`` through more efficient copying.
    * 6744: LaTeX: support for seealso directive should be via an environment
    to allow styling.
    * 11074: LaTeX: Can't change sphinxnote to use sphinxheavybox starting with
    5.1.0
    

    6.0.1

    =====================================
    
    Dependencies
    ------------
    
    * Require Pygments 2.13 or later.
    
    Bugs fixed
    ----------
    
    * 10944: imgmath:  Fix resolving image paths for files in nested folders.
    

    6.0.0

    =====================================
    
    Dependencies
    ------------
    
    * 10468: Drop Python 3.6 support
    * 10470: Drop Python 3.7, Docutils 0.14, Docutils 0.15, Docutils 0.16, and
    Docutils 0.17 support. Patch by Adam Turner
    
    Incompatible changes
    --------------------
    
    * 7405: Removed the jQuery and underscore.js JavaScript frameworks.
    
    These frameworks are no longer be automatically injected into themes from
    Sphinx 6.0. If you develop a theme or extension that uses the
    ``jQuery``, ``$``, or ``$u`` global objects, you need to update your
    JavaScript to modern standards, or use the mitigation below.
    
    The first option is to use the sphinxcontrib.jquery_ extension, which has been
    developed by the Sphinx team and contributors. To use this, add
    ``sphinxcontrib.jquery`` to the ``extensions`` list in ``conf.py``, or call
    ``app.setup_extension("sphinxcontrib.jquery")`` if you develop a Sphinx theme
    or extension.
    
    The second option is to manually ensure that the frameworks are present.
    To re-add jQuery and underscore.js, you will need to copy ``jquery.js`` and
    ``underscore.js`` from `the Sphinx repository`_ to your ``static`` directory,
    and add the following to your ``layout.html``:
    
    .. code-block:: html+jinja
    
      {%- block scripts %}
          <script src="{{ pathto('_static/jquery.js', resource=True) }}"></script>
          <script src="{{ pathto('_static/underscore.js', resource=True) }}"></script>
          {{ super() }}
      {%- endblock %}
    
    .. _sphinxcontrib.jquery: https://github.com/sphinx-contrib/jquery/
    
    Patch by Adam Turner.
    * 10471, 10565: Removed deprecated APIs scheduled for removal in Sphinx 6.0. See
    :ref:`dev-deprecated-apis` for details. Patch by Adam Turner.
    * 10901: C Domain: Remove support for parsing pre-v3 style type directives and
    roles. Also remove associated configuration variables ``c_allow_pre_v3`` and
    ``c_warn_on_allowed_pre_v3``. Patch by Adam Turner.
    
    Features added
    --------------
    
    * 10924: LaTeX: adopt better looking defaults for tables and code-blocks.
    See :confval:`latex_table_style` and the ``pre_border-radius`` and
    ``pre_background-TeXcolor`` :ref:`additionalcss` for the former defaults
    and how to re-enact them if desired.
    
    Bugs fixed
    ----------
    
    * 10984: LaTeX: Document :confval:`latex_additional_files` behavior for files
    with ``.tex`` extension.
    
    Links
    • PyPI: https://pypi.org/project/sphinx
    • Changelog: https://pyup.io/changelogs/sphinx/
    update 
    opened by pyup-bot 0
  • Add dump.rdb to gitignore

    Add dump.rdb to gitignore

    Description

    After running Redis locally, I noticed dump.rdb show up in my repository, which is apparently the Redis dump file. This PR adds dump.rdb to gitignore. I thought about putting it behind a "use_celery = y" guard, but realized Redis is also the caching mechanism, so it seems relevant for all configurations.

    Checklist:

    • [X] I've made sure that tests are updated accordingly (especially if adding or updating a template option)
    • [X] I've updated the documentation or confirm that my change doesn't require any updates

    Rationale

    I don't believe the dump file belongs in version control.

    opened by pamelafox 0
  • Update Celery instructions

    Update Celery instructions

    Description

    I got confused when I first followed the Celery instructions as I'm new to Celery and didn't know that I needed to explicitly queue the task. I've modified the instructions to show how to do that with the built-in get_users_count task.

    Checklist:

    • [X] I've made sure that tests are updated accordingly (especially if adding or updating a template option)
    • [X] I've updated the documentation or confirm that my change doesn't require any updates

    Rationale

    Hopefully this makes Celery setup more clear for other celery noobs.

    opened by pamelafox 0
  • Error with staticfiles collection and missing source map files

    Error with staticfiles collection and missing source map files

    What happened?

    When I ran collectstatic on my production server, I get this error:

    Traceback (most recent call last):
      File "/tmp/8daedd4f753e458/manage.py", line 31, in <module>
        execute_from_command_line(sys.argv)
      File "/tmp/8daedd4f753e458/antenv/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
        utility.execute()
      File "/tmp/8daedd4f753e458/antenv/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/tmp/8daedd4f753e458/antenv/lib/python3.10/site-packages/django/core/management/base.py", line 414, in run_from_argv
        self.execute(*args, **cmd_options)
      File "/tmp/8daedd4f753e458/antenv/lib/python3.10/site-packages/django/core/management/base.py", line 460, in execute
        output = self.handle(*args, **options)
      File "/tmp/8daedd4f753e458/antenv/lib/python3.10/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle
        collected = self.collect()
      File "/tmp/8daedd4f753e458/antenv/lib/python3.10/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 154, in collect
        raise processed
    whitenoise.storage.MissingFileError: The file 'js/popper.js.map' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7851a54578b0>.
    
    The JS file 'js/vendors.js' references a file which could not be found:
    
      js/popper.js.map
    
    Please check the URL references in this JS file, particularly any
    relative paths which might be pointing to the wrong location.
    

    The error comes because popper.js has this comment:

    //# sourceMappingURL=popper.min.js.map
    

    But popper.min.js.map is not copied into the static files directory.

    This general issue is reported as an issue in Django 4.1: https://code.djangoproject.com/ticket/33353#comment:15 And there was a fix to django-rest-framework to add source map files: https://github.com/encode/django-rest-framework/pull/8591

    I am not sure why I am seeing this in Django 4.0.8, since it's supposedly a 4.1 issue, but perhaps 4.0.8 manifests an earlier version of the issue.

    Proposed fix

    This is the change I made to my repo: https://github.com/pamelafox/cookiecutter-django-output/commit/c5e8166e40fb8c87f1ce11849ef246f98a52b6f5

    I modified the gulpfile to copy over the *.map files for the vendor files, and add *.map to the gitignore file.

    I can submit that as a pull request to this repository if it seems like a helpful change.

    Additional details

    This is the repository I deployed: https://github.com/pamelafox/cookiecutter-django-output/tree/961a1ebfd226ec1aa0726760e4c2fd46b7bc0840

    I deployed using the 'azd up' command to Azure App Service (using infrastructure files I wrote myself), and I found the error in the deployment center logs.

    I do not seem to get the error when I run manage.py collectstatic locally.

    bug 
    opened by pamelafox 5
  • Revisiting the project root vs project_slug folder for creating apps

    Revisiting the project root vs project_slug folder for creating apps

    Description

    This issue is in the vein of #1725 and #3803, and discussions elsewhere e.g. https://stackoverflow.com/questions/39838290/is-there-a-command-for-creating-an-app-using-cookiecutter-django

    The basic question is where is the canonical place to create an app?

    • The most natural thing to do, ./manage.py startapp <app_name>, creates it at the root level which looks yucky.
    • Moving it manually and tinkering with apps.py aesthetically looks nice (except the LOCAL_APPS in settings) but seems to not work in edge cases. e.g., I use a lot of Django's lazy loading of ForeignKey models (using strings) to avoid circular imports. In this situation I'm now forced to say project_slug.app_name.ModelName which is not an allowed thing to do.

    My proposal is that we consider (the inner, as in not project root) {{cookiecutter.project_slug}} folder the root folder you'd get if you did django-admin.py startproject project_slug, and possibly even call it src.

    Then you'd have something like:

    {{cookiecutter.project_slug}}
    ├── compose
    ├── docs
    ├── locale
    ├── requirements
    └── src
        ├── manage.py
        ├── app1
        ├── app2
        ├── {{cookiecutter.project_slug}}
        │   ├── config
        │   │   └── settings
        │   ├── contrib
        │   │   └── sites
        │   │       └── migrations
        │   ├── static
        │   │   ├── css
        │   │   ├── fonts
        │   │   ├── images
        │   │   │   └── favicons
        │   │   ├── js
        │   │   └── sass
        │   ├── templates
        │   │   ├── account
        │   │   ├── pages
        │   │   └── users
        │   └── utils
        └── users
            ├── api
            ├── migrations
            └── tests
    

    In the above, the users app is no longer special, and doesn't need to be imported as {{cookiecutter.project_slug}}.users in the settings file. The config folder is also moved, but is perhaps not even necessary as it might be more vanilla Django to simply have.

    └── src
        ├── manage.py
        ├── app1
        ├── app2
        ├── {{cookiecutter.project_slug}}
        │   ├── settings
    
    

    I am a fan of this project and I try to use it and get caught up on this specific aspect of where to create an app every time I try. I would be willing to implement these proposed changes as an experiment if others agree with the general thought process.

    enhancement 
    opened by hnarayanan 4
  • Upgrade to Django 4.1

    Upgrade to Django 4.1

    With the merge of https://github.com/django-extensions/django-extensions/pull/1775 we are close to upgrading to Django 4.1. The new release of django-extensions will resolve #3941.

    This pull request gets everything ready for upgrading tot Django 4.1 and can be merged after the release of django-extensions and will close issue #3826.

    opened by foarsitter 0
Releases(2023.01.07)
Django CRUD REST API Generator

Django CRUD REST API Generator This is a simple tool that generates a Django REST API with the given models. Specs: Authentication, DRF generic views,

Mehmet Alp Sümer 57 Nov 24, 2022
Yummy Django API, it's the exclusive API used for the e-yummy-ke vue web app

Yummy Django API, it's the exclusive API used for the e-yummy-ke vue web app

Am.Chris_KE 1 Feb 14, 2022
Agenda feita usando o django para adicionar eventos

Agenda de Eventos Projeto Agenda com Django Inicio O projeto foi iniciado no Django, usando o models.py foi adicionado os dados dos eventos e feita as

Bruno Fernandes 1 Apr 14, 2022
Projeto onde podes inserir notícias, ver todas as notícias guardas e filtrar por tag. A base de dados usada é o mongoDB.

djangoProject Projeto onde podes inserir notícias, ver todas as notícias guardas e filtrar por tag. A base de dados usada é o mongoDB. packages utiliz

Sofia Rocha 1 Feb 22, 2022
Dynamic Django settings.

Constance - Dynamic Django settings A Django app for storing dynamic settings in pluggable backends (Redis and Django model backend built in) with an

Jazzband 1.5k Jan 07, 2023
A Student/ School management application built using Django and Python.

Student Management An awesome student management app built using Django.! Explore the docs » View Demo · Report Bug · Request Feature Table of Content

Nishant Sethi 1 Feb 10, 2022
A pickled object field for Django

django-picklefield About django-picklefield provides an implementation of a pickled object field. Such fields can contain any picklable objects. The i

Gintautas Miliauskas 167 Oct 18, 2022
A UUIDField for Django

django-uuidfield Provides a UUIDField for your Django models. Installation Install it with pip (or easy_install): pip install django-uuidfield Usage

David Cramer 265 Nov 30, 2022
An opinionated Django CMS setup bundled as an Aldryn Addon

Aldryn CMS |PyPI Version| An opinionated django CMS setup bundled as an Aldryn Addon. This package will auto configure django CMS including some extra

Vladimir Bezrukov 1 Nov 12, 2021
Django datatables and widgets, both AJAX and traditional. Display-only ModelForms.

Django datatables and widgets, both AJAX and traditional. Display-only ModelForms. ModelForms / inline formsets with AJAX submit and validation. Works with Django templates.

Dmitriy Sintsov 132 Dec 14, 2022
A simple REST API to manage postal addresses, written in Python/Django.

A simple REST API to manage postal addresses, written in Python/Django.

Attila Bagossy 2 Feb 14, 2022
Example project demonstrating using Django’s test runner with Coverage.py

Example project demonstrating using Django’s test runner with Coverage.py Set up with: python -m venv --prompt . venv source venv/bin/activate python

Adam Johnson 5 Nov 29, 2021
TinyMCE integration for Django

django-tinymce django-tinymce is a Django application that contains a widget to render a form field as a TinyMCE editor. Quickstart Install django-tin

Jazzband 1.1k Dec 26, 2022
Use minify-html, the extremely fast HTML + JS + CSS minifier, with Django.

django-minify-html Use minify-html, the extremely fast HTML + JS + CSS minifier, with Django. Requirements Python 3.8 to 3.10 supported. Django 2.2 to

Adam Johnson 60 Dec 28, 2022
Учебное пособие по основам Django и сопутствующим технологиям

Учебный проект для закрепления основ Django Подробный разбор проекта здесь. Инструкция по запуску проекта на своей машине: Скачиваем репозиторий Устан

Stanislav Garanzha 12 Dec 30, 2022
Django app for handling the server headers required for Cross-Origin Resource Sharing (CORS)

django-cors-headers A Django App that adds Cross-Origin Resource Sharing (CORS) headers to responses. This allows in-browser requests to your Django a

Adam Johnson 4.8k Jan 03, 2023
Django API creation with signed requests utilizing forms for validation.

django-formapi Create JSON API:s with HMAC authentication and Django form-validation. Version compatibility See Travis-CI page for actual test results

5 Monkeys 34 Apr 04, 2022
An API was build with Django to store and retrieve information about various musical instruments.

The project is meant to be a starting point, an experimentation or a basic example of a way to develop an API with Django. It is an exercise on using Django and various python technologies and design

Kostas Ziovas 2 Dec 25, 2021
Comparing Database performance with Django ORM

Comparing Database performance with Django ORM Postgresql MySQL MariaDB SQLite Comparing database operation performance using django ORM. PostgreSQL v

Sarath ak 21 Nov 14, 2022
Django Course Project - TextCorrector

Django-TextUtils Django Course Project A tool for analyzing text data in Django backend. It is a project where you can do some of the things with you

1 Oct 29, 2021