• Stars
    star
    691
  • Rank 65,435 (Top 2 %)
  • Language
    Python
  • Created about 12 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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 assumptions or are just way too complicated. I try to make the least amount of assumptions possible while still trying provide a useful setup. Most of my projects are deployed to Heroku, so this is optimized for that but is not necessary.

Features

  • Django 3.0+
  • Uses Pipenv - the officially recommended Python packaging tool from Python.org.
  • Development, Staging and Production settings with django-configurations.
  • Get value insight and debug information while on Development with django-debug-toolbar.
  • Collection of custom extensions with django-extensions.
  • HTTPS and other security related settings on Staging and Production.
  • Procfile for running gunicorn with New Relic's Python agent.
  • PostgreSQL database support with psycopg2.

How to install

$ django-admin.py startproject \
  --template=https://github.com/jpadilla/django-project-template/archive/master.zip \
  --name=Procfile \
  --extension=py,md,env \
  project_name
$ mv example.env .env
$ pipenv install --dev

Environment variables

These are common between environments. The ENVIRONMENT variable loads the correct settings, possible values are: DEVELOPMENT, STAGING, PRODUCTION.

ENVIRONMENT='DEVELOPMENT'
DJANGO_SECRET_KEY='dont-tell-eve'
DJANGO_DEBUG='yes'

These settings(and their default values) are only used on staging and production environments.

DJANGO_SESSION_COOKIE_SECURE='yes'
DJANGO_SECURE_BROWSER_XSS_FILTER='yes'
DJANGO_SECURE_CONTENT_TYPE_NOSNIFF='yes'
DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS='yes'
DJANGO_SECURE_HSTS_SECONDS=31536000
DJANGO_SECURE_REDIRECT_EXEMPT=''
DJANGO_SECURE_SSL_HOST=''
DJANGO_SECURE_SSL_REDIRECT='yes'
DJANGO_SECURE_PROXY_SSL_HEADER='HTTP_X_FORWARDED_PROTO,https'

Deployment

It is possible to deploy to Heroku or to your own server.

Heroku

$ heroku create
$ heroku addons:add heroku-postgresql:hobby-dev
$ heroku pg:promote DATABASE_URL
$ heroku config:set ENVIRONMENT=PRODUCTION
$ heroku config:set DJANGO_SECRET_KEY=`./manage.py generate_secret_key`

License

The MIT License (MIT)

Copyright (c) 2012-2017 José Padilla

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

pyjwt

JSON Web Token implementation in Python
Python
4,883
star
2

django-rest-framework-jwt

JSON Web Token Authentication support for Django REST Framework
Python
3,185
star
3

django-dotenv

Loads environment variables from .env
Python
570
star
4

juicebox

A virtual machine designed for programming workshops.
Shell
533
star
5

redisapp

The easiest way to get started with Redis on the Mac
Objective-C
351
star
6

django-jwt-auth

JSON Web Token Authentication support for Django
Python
164
star
7

black-playground

psf/black online demo
JavaScript
160
star
8

cookiecutter-django-rest-framework

A cookiecutter template for creating reusable Django REST Framework packages quickly.
Python
90
star
9

django-rest-framework-xml

XML support for Django REST Framework
Python
86
star
10

rabbitmqapp

The easiest way to get started with RabbitMQ on the Mac
Objective-C
66
star
11

django-rest-framework-oauth

OAuth support for Django REST Framework
Python
59
star
12

ember-fastboot-docker

Dockerized Node.js server for running Ember FastBoot apps
JavaScript
42
star
13

postmark-inbound-python

Python Wrapper for Postmark Inbound
Python
37
star
14

feedleap

Your RSS feeds as Clips in a Kippt List
CSS
36
star
15

django-rest-framework-yaml

YAML support for Django REST Framework
Python
31
star
16

ember-poe

Simple Markdown editor Ember Application using localStorage
CoffeeScript
29
star
17

tumblr-to-ghost

Tumblr exporter to Ghost importer
Python
26
star
18

telegram-gate

Las 889 páginas de Telegram entre Rosselló Nevares y sus allegados
JavaScript
26
star
19

tracking-luma-outages

Record de datos de interrupciones de servicio reportados por LUMA Energy en Puerto Rico a través de el portal de Mi LUMA.
Python
25
star
20

yapf-online

google/yapf online demo
HTML
24
star
21

django-rest-framework-jsonp

JSONP support for Django REST Framework
Python
21
star
22

mandrill-inbound-python

Python Wrapper for Mandrill Inbound Email
Python
20
star
23

notaso

Conoce a tus profesores antes de llegar al salón.
JavaScript
19
star
24

dotfiles

This is a collection of my dotfiles for Mac OS X.
Shell
18
star
25

statsd-graphite-vm

Vagrant VM for StatsD + Graphite
Ruby
16
star
26

ivona-go

Go client library for IVONA Speech Cloud API
Go
15
star
27

heroku-flower

Deploy Flower to Heroku
14
star
28

tracking-status-pr

This tool scrapes status.pr every hour and keeps tracks of changing metrics in order to help visualize and measure progress.
Python
14
star
29

HackerDesignerNews

Hacker News and Designer News Aggregator and Web API
JavaScript
13
star
30

codeigniter-s3-swfupload

Uploading directly to S3 using Codeigniter and swfUpload
13
star
31

designer-news-python

Python library for the Designer News API
Python
11
star
32

barcampinator

Barcamp user registration tool + presentation display
JavaScript
10
star
33

ember-clipboard

Ember.js addon component for clipboard.js
JavaScript
8
star
34

thenews-api

Scraper and Web API for thenews.im
JavaScript
7
star
35

WallIt

A fun geolocation app powered by ACS. Inspired by Anywall(which is powered by Parse)
JavaScript
6
star
36

tracking-gov-pr

Tracking gov.pr properties
Python
6
star
37

alchemyapi-go

Go client library for AlchemyAPI
Go
6
star
38

apex-chat

Las 72 páginas del chat de APEX entre Robert Rodriguez y sus allegados
JavaScript
3
star
39

datasette-mortalidad

Herramienta para explorar la Base de Datos de Mortalidad en Puerto Rico
Python
3
star
40

better-endi

Browser extensions to bypass transition ads in endi.com
JavaScript
2
star
41

npm-repo

Redirect to an npm package's repository
JavaScript
2
star
42

bokamerki

CSS
1
star
43

oghowto

1
star
44

vagrant-example

Playing around with Vagrant and Chef
Ruby
1
star
45

email-hangman

Hangman via email
Python
1
star
46

rttm

Go
1
star
47

py-backwards-online

py-backwards online demo
HTML
1
star
48

auth0-quiz

A Quiz generator for questions regarding security, authorization and authentication. You can use this to create any quiz you want.
JavaScript
1
star
49

glimmer-electron-demo

Run glimmer in electron with the help of ember-electron
JavaScript
1
star
50

remindeat

Never forget what you've already ate at a restaurant
Python
1
star
51

ember-hn-clone

A Hacker News / Designer News clone built with Ember.js
JavaScript
1
star