Powered by Cookiecutter, inspired by Cookiecutter Django.
- Docker-based
- For Django 1.11
- Vue framework
- Works with Python 3.6
- PostgreSQL database
- Caddy server with LetsEncrypt integration
- Optimized development and production settings (12-Factor based via django-environ)
- Send emails via Anymail (using Mailgun by default, but switchable)
- Static & media files with AmazonS3 or Whitenoise + AmazonS3
- Webpack for builds and hot-development-server
- Yarn for npm-dependencies
These features can be enabled during initial project setup.
- Integration with Travis for CI
- Integration with Sentry for error logging
- Integration with MailHog for local email testing
- Integration with Google Analytics or Yandex Metrika for web-analytics
- Integration with CKeditor for rich text editing
Let's pretend you want to create a Django project called "my_awesome_website". 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
Now run it against this repo:
$ cookiecutter https://github.com/vchaptsev/cookiecutter-django-vue
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', etc to your own information.
Answer the prompts with your own desired options. For example:
======================= GENERAL ====================== [ ]: project_name [Project Name]: Website project_slug [website]: website domain [website.com]: website.com description [A short description of the project.]: My awesome website author [Daniel Roy Greenfeld]: Your Name email [admin@website.com]: admin@website.com version [0.1]: 0.1 Select 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 Select use_ckeditor: 1 - Everywhere 2 - Backend 3 - Frontend 4 - Don't use ======================= DevOps ======================= [ ]: use_celery [y]: y use_travis [y]: y use_sentry [y]: y use_mailhog [y]: y Select static_and_media: 1 - Amazon S3 for static and media 2 - Whitenoise for static, Amazon S3 for media Choose from 1, 2 [1]: 1 ====================== FRONT-END ===================== [ ]: Select analytics: 1 - Google Analytics 2 - Yandex metrika 3 - None use_progressbar [n]: n use_vue_material [n]: n
Now you can start project with docker-compose:
$ docker-compose up --build
For production you'll need to fill out .env file and use docker-compose-prod.yml file:
$ docker-compose -f docker-compose-prod.yml up --build -d
If you want to use travis + fabric ssh deployment, you'll need to set up PRODUCTION_USER and PRODUCTION_PASSWORD encrypted envs to .travis.yml:
$ travis encrypt PRODUCTION_USER=user --add env.global $ travis encrypt PRODUCTION_PASSWORD=secret --add env.global