Giter VIP home page Giter VIP logo

fredcoff / django-base-site Goto Github PK

View Code? Open in Web Editor NEW

This project forked from epicserve/django-base-site

0.0 0.0 0.0 4.56 MB

The Django Base Site is a Django site that is built using the best Django practices and comes with all the common Django packages that you need to jumpstart your next project.

License: MIT License

Dockerfile 1.52% Makefile 7.79% Python 34.79% HTML 35.14% Shell 14.38% JavaScript 6.29% CSS 0.10%

django-base-site's Introduction

Django Base Site

The Django Base Site is a Django site that is built using the best Django practices and comes with all the common Django packages that you need to jumpstart your next project.

Documentation

Documentation is available at http://django-base-site.readthedocs.org/.

Features

Install Requirements

Before setting up a new project make sure you have the following installed:

It's not a requirement, but it is recommended that you install Python using Pyenv with the virtualenvwrapper plugin.

Quickstart

Using the Install Script

Running the following script mostly does the same thing as manual quickstart method. The exception is that the install script has questions to customize your new project setup. Just run the following in your terminal to get started.

$ bash <(curl -s https://raw.githubusercontent.com/epicserve/django-base-site/master/start_new_site.sh)

Example output:

$ cd ~/Sites
$ bash <(curl -s https://raw.githubusercontent.com/epicserve/django-base-site/master/start_new_site.sh)

What is the project name slug [example]?
What directory do you want your project in [/Users/brento/Sites/example]?
Are going to use Docker Compose (Y/n)? Y
Are going to Heroku for deployment (Y/n)? Y

Done.

To start Docker Compose run:
$ cd /Users/brento/Sites/example
$ docker-compose up

Manual

$ curl -LOk https://github.com/epicserve/django-base-site/archive/master.zip && unzip master
$ mv django-base-site-master example
$ cd example
$ pipenv install --dev --python $(which python3)
$ export SECRET_KEY=$(python -c "import random; print(''.join(random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789%^&*(-_=+)') for i in range(50)))")
$ cat > .env <<EOF
DEBUG=on
SECRET_KEY='$SECRET_KEY'
EMAIL_HOST='smtp.planetspaceball.com'
EMAIL_HOST_USER='[email protected]'
EMAIL_HOST_PASSWORD='12345'
DEFAULT_FROM_EMAIL="President Skroob <[email protected]>"
# Uncomment the following if you're using docker-compose
# DATABASE_URL=postgres://postgres@db:5432/postgres
EOF
$ pipenv shell
$ ./manage.py migrate
$ ./manage.py createsuperuser
$ ./manage.py runserver

Deploy on Heroku

$ git init
$ git add .
$ git commit
$ heroku create
$ heroku addons:create mailgun
$ heroku addons:create rediscloud
$ heroku buildpacks:add --index 1 heroku/nodejs
$ heroku config
$ heroku config:set READ_DOT_ENV_FILE=off \
WSGI_APPLICATION=config.heroku_wsgi.application \
SECRET_KEY='random string of 50 chars' \
DEFAULT_FROM_EMAIL='$MAILGUN_SMTP_LOGIN' \
EMAIL_HOST='$MAILGUN_SMTP_SERVER' \
EMAIL_HOST_USER='$MAILGUN_SMTP_LOGIN' \
EMAIL_HOST_PASSWORD='$MAILGUN_SMTP_PASSWORD' \
ALLOWED_HOSTS='*'
$ git push --set-upstream heroku master
$ heroku run python manage.py migrate
$ heroku run python manage.py createsuperuser    
$ heroku open

Note: Before you'll be able to send email using Mailgun you'll have to setup your Heroku app on a custom domain under Heroku and Mailgun.

django-base-site's People

Contributors

collinanderson avatar epicserve 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.