Django, React, Bootstrap 4 with Python 3 and webpack project boilerplate
chocoelho Merge pull request #244 from vintasoftware/greenkeeper/monorepo.react…
…-16.6.3

Greenkeeper/monorepo.react 16.6.3
Latest commit 2479e0a Nov 13, 2018
Permalink
Failed to load latest commit information.
.circleci Manually generate checksum to avoid conflict with Django template Jun 29, 2018
.github Add issue templates May 4, 2018
assets Update ColorChanger snapshots Sep 24, 2018
bin Fixes collectstatic environment variables Jun 15, 2018
common Made proper adjustments to send SIGTERM instead of SIGKILL Jun 5, 2018
exampleapp Added other hooks Feb 13, 2017
project_name Merge remote-tracking branch 'origin/master' into fix-csrf-cookie-htt… Oct 26, 2018
templates fixes #131, closes #34 Sep 20, 2017
users Changed __unicode__ to __str__ on user model Mar 7, 2017
.bandit Updated proj_circle build command Jun 26, 2018
.bootstraprc Alphabetically order bootstraprc file Nov 20, 2017
.coveragerc Fixing .coveragerc Aug 30, 2016
.editorconfig Update .editorconfig Mar 21, 2017
.env.example Easier setup Aug 25, 2017
.eslintignore fixes generated project CI build Dec 14, 2017
.eslintrc.js Adding fixes for ESLint to support Jest tests. Nov 5, 2017
.gitignore PR: added test watch, coverage and fixed a few issues. Nov 11, 2017
.isort.cfg Merge remote-tracking branch 'origin/master' into fix-isort-skips Oct 30, 2018
.pre-commit-config.yaml Set failfast on pre-commit Sep 1, 2018
.prospector.yaml Updated proj_circle build command Jun 26, 2018
CONTRIBUTING.md Update CONTRIBUTING.md Sep 10, 2018
LICENSE.txt Some small changes introduced by #96. May 11, 2017
Makefile updates makefile to support pipenv Nov 23, 2017
Pipfile Remove fixmydjango dependency to enable Django upgrade Jun 8, 2018
Procfile Production features and Heroku deployment Aug 26, 2016
README.md Merge pull request #199 from pdrmtaheri/extract-contributing-section Sep 10, 2018
app.json Fixes collectstatic environment variables Jun 15, 2018
babel.config.js Migrate configuration from Babel 6 to 7 Oct 29, 2018
jest-setup.js Add enzyme and update jest configuration Sep 24, 2018
jest.config.js Moved jest configuration from package.json to jest.config.js Oct 29, 2018
manage.py Easier setup Aug 25, 2017
package.json chore(package): update react-dom to version 16.6.3 Nov 13, 2018
postcss.config.js Updating dependencies, fixes autoprefixer and add polyfills Jun 28, 2017
proj_circle.yml Fix report output Aug 17, 2018
runtime.txt Updates python version to python-3.6.0 Mar 9, 2017
server.js fix: bug in hot reload Jun 26, 2017
webpack.base.config.js Fix babel-loader and @babel/polyfill setup inside webpack Oct 29, 2018
webpack.local.config.js Fix babel-loader and @babel/polyfill setup inside webpack Oct 29, 2018
webpack.prod.config.js Fix babel-loader and @babel/polyfill setup inside webpack Oct 29, 2018

README.md

License: MIT

Django React Boilerplate

About

A Django project boilerplate/template with lots of state of the art libraries and tools like:

For continuous integration, a CircleCI configuration .circleci/config.yml is included.

Also, includes a Heroku app.json and a working Django production.py settings, enabling easy deployments with 'Deploy to Heroku' button. Those Heroku plugins are included in app.json:

  • PostgreSQL, for DB
  • Redis, for Celery
  • Sendgrid, for e-mail sending
  • Papertrail, for logs and platform errors alerts (must set them manually)

This is a good starting point for modern Python/JavaScript web projects.

Project bootstrap CircleCI Greenkeeper badge

  • Open the command line and go to the directory you want to start your project in.
  • Start your project using:
django-admin startproject theprojectname --extension py,yml,json --name Procfile,README.md,.env.example --template=https://github.com/vintasoftware/django-react-boilerplate/archive/boilerplate-release.zip
  • Above: don't forget the --extension and --name params! (also don't forget to change theprojectname to your project's name).
  • Navigate to the project's directory through your command line.
  • Install pipenv if not installed yet: pip install pipenv (maybe you'll have to run this command as an OS superuser).
  • Make sure you have Python 3.6 installed.
  • pipenv install --dev
  • Activate the newly created virtualenv with pipenv shell
  • npm update --save
  • npm update --save-dev
  • Check for outdated npm dependencies with npm outdated and update them.
  • Change the first line of README to the name of the project.
  • Add an email address to the ADMINS settings variable in {{project_name}}/{{project_name}}/settings/base.py
  • Change the SERVER_EMAIL to the email address used to send e-mails in {{project_name}}/{{project_name}}/settings/production.py

After completing ALL of the above, remove this Project bootstrap section from the project README. Then follow Running below.

Running

Setup

  • On project root, do the following:
  • Create a copy of {{project_name}}/settings/local.py.example:
     cp {{project_name}}/settings/local.py.example {{project_name}}/settings/local.py (remembering you should replace {{project_name}} with your project's name!).
  • Create a copy of .env.example:
    cp .env.example .env
  • Create the migrations for users app (do this, then remove this line from the README):
    python manage.py makemigrations
  • Run the migrations:
    python manage.py migrate

Tools

Running the project

  • Open a command line window and go to the project's directory.
  • pipenv install --dev
  • npm install
  • npm run start
  • Open another command line window and go to the project's directory.
  • pipenv shell
  • python manage.py runserver

Celery

  • Open a command line window and go to the project's directory
  • pipenv shell
  • python manage.py celery

Testing

make test

Will run django tests using --keepdb and --parallel. You may pass a path to the desired test module in the make command. E.g.:

make test someapp.tests.test_views

Adding new pypi libs

Just run pipenv install LIB_NAME_ON_PYPI and then pipenv lock to lock the version in Pipfile.lock file

Linting

  • Manually with prospector and npm run lint on project root.
  • During development with an editor compatible with prospector and ESLint.

Pre-commit hooks

  • Run pre-commit install to enable the hook into your git repo. The hook will run automatically for each commit.
  • Run git commit -m "Your message" -n to skip the hook if you need.

Commercial Support

This project, as other Vinta open-source projects, is used in products of Vinta clients. We are always looking for exciting work, so if you need any commercial support, feel free to get in touch: contact@vinta.com.br

Copyright (c) 2018 Vinta Serviços e Soluções Tecnológicas Ltda. MIT License