Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Django Cookiecutter short walk

Django Cookiecutter short walk

It's a lightning walk showing cookiecutter-django.

More detail in doc:
Cookiecutter https://cookiecutter.readthedocs.io/
Cookiecutter Django https://cookiecutter-django.readthedocs.io/

Avatar for Keith Yang

Keith Yang

June 18, 2020
Tweet

More Decks by Keith Yang

Other Decks in Programming

Transcript

  1. Agenda 順利的話 1. What is Cookiecutter 2. Demo 3. What

    then Cookiecutter-Django features 4. Demo
  2. Cookiecutter Created by Audrey Roy A command-line utility that creates

    projects from cookiecutters (project templates), e.g. creating a Python package project from a Python package project template. https:!//github.com/cookiecutter/cookiecutter
  3. Features of Cookiecutter 有⼈的常⾒需求,想必你也可有需要 • Cross-platform: Windows, Mac, and Linux

    are officially supported. • You don't have to know/write Python code to use Cookiecutter • Works with Python 3.6, 3.7, 3.8 and PyPy3. (2… • Project templates can be in any programming language or markup format: Python, JavaScript, Ruby, CoffeeScript, RST, Markdown, CSS, HTML, you name it. You can use multiple languages in the same project template. • Simple command line usage:
  4. Sample run • 不過⾸先當然 pip install --user cookiecutter • 然後就挑⼀個

    GitHub 上的 repo 跑跑看 cookiecutter gh:audreyr/ cookiecutter-pypackage 它會問你⼀些問題,回答它啊
  5. • For Django 3.0 • Works with Python 3.8 •

    Renders Django projects with 100% starting test coverage • Twitter Bootstrap v4 (maintained Foundation fork also available) • 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
  6. Cookiecutter-Django features - part 1 • For Django 3.0 •

    Works with Python 3.8 • Renders Django projects with 100% starting test coverage • Twitter Bootstrap v4 (maintained Foundation fork also available)
  7. Cookiecutter-Django features - part 2 • 12-Factor based settings via

    django-environ • Secure by default. We believe in SSL. • Registration via django-allauth • Comes with custom user model ready to go • Optional basic ASGI setup for Websockets
  8. Cookiecutter-Django features - part 3 • 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)
  9. Cookiecutter-Django features - part 4 • Procfile for deploying to

    Heroku • Instructions for deploying to PythonAnywhere • Run tests with unittest or pytest • Customizable PostgreSQL version