Giter Site home page Giter Site logo

ponee's Introduction

ponee

A lightweight Django template ready for Heroku

Motivation

Loosely inspired by the beloved django-cookiecutter, ponee is a lightweight Django template without too many assumptions.

What's included

  • Custom user
  • 12-Factor based setting via django-environ
  • Requirements for production and development
  • Django REST framework
  • Django CORS headers
  • Security settings
  • Heroku support with django-heroku
  • Testing and coverage

Ponee uses sqlite3 for development but you can easily switch to PostgreSQL by tweaking settings.base.py.

Installation

Prepare a virtual environment in a folder of choice and install Django:

mkdir mynewproject && cd $_
python3 -m venv venv
source venv/bin/activate
pip install django

Then install the template:

django-admin startproject \ 
    --template https://github.com/valentinogagliardi/ponee/archive/master.zip \
    --name=Procfile \
    --extension=py,example yournewproject .

Install the dependencies:

pip install -r ./requirements/dev.txt

Copy the example env to .env and adjust the variables as needed:

cp .env.example .env

Before starting off make the migrations for the custom User:

python manage.py makemigrations
python manage.py migrate

and your good to run the development server!

Deploy on Heroku

Before starting off you should have a Git repo in your project folder:

git init

Login on Heroku with the Heroku CLI:

heroku login

Create a new app (you can change its name later):

heroku apps:create --region eu

Copy .env.prod.example to .env.prod and adjust the variables as needed. Now run:

python configure_prod_envs.py

The script reads all the env variables from .env.prod and runs heroku config:set for each.

Finally make a commit and push the code:

git add .
git commit -m "First commit"
git push heroku master

Test

Running tests:

python manage.py test

Running tests with coverage:

coverage run --omit='*/venv/*' manage.py test
coverage report

ponee's People

Contributors

valentinogagliardi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.