All Projects → vintasoftware → Django React Boilerplate

vintasoftware / Django React Boilerplate

Licence: mit
Django, React, Bootstrap 4 with Python 3 and webpack project boilerplate

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django React Boilerplate

Vue Django
@Django integrated with a full-featured @Webpack + (@vuejs / vue-loader) setup with hot reload, linting, testing & css extraction.
Stars: ✭ 495 (-57.47%)
Mutual labels:  webpack, django
Django Photoblog
Photographer portfolio website powered by Django Framework. Features photo gallery with infinite scrolling, tagging, thumbnail generation and CMS for creating pages. Configured for Heroku and S3.
Stars: ✭ 19 (-98.37%)
Mutual labels:  django, bootstrap4
Flask Vuejs Madblog
基于 Flask 和 Vue.js 前后端分离的微型博客项目,支持多用户、Markdown文章(喜欢/收藏文章)、粉丝关注、用户评论(点赞)、动态通知、站内私信、黑名单、邮件支持、管理后台、权限管理、RQ任务队列、Elasticsearch全文搜索、Linux VPS部署、Docker容器部署等
Stars: ✭ 541 (-53.52%)
Mutual labels:  webpack, bootstrap4
Qikqiak.com
关注容器、kubernetes、devops、python、golang、微服务等技术 🎉🎉🎉
Stars: ✭ 394 (-66.15%)
Mutual labels:  webpack, django
Django Webpacker
A django compressor tool that bundles css, js files to a single css, js file with webpack and updates your html files with respective css, js file path.
Stars: ✭ 69 (-94.07%)
Mutual labels:  webpack, django
Cc
一个基于angular5.0.0+ng-bootstrap1.0.0-beta.8+bootstrap4.0.0-beta.2+scss的后台管理系统界面(没基础的同学请先自学基础,谢谢!)
Stars: ✭ 416 (-64.26%)
Mutual labels:  webpack, bootstrap4
Honoka
Honoka is one of the original Bootstrap theme.
Stars: ✭ 634 (-45.53%)
Mutual labels:  webpack, bootstrap4
React Starter Kit
React, Redux, Webpack, Material UI, Boostrap 4, Code Splitting, HMR
Stars: ✭ 229 (-80.33%)
Mutual labels:  webpack, bootstrap4
Adfs managers
This is site (web-app) to manage teams and statistic for ADFS
Stars: ✭ 10 (-99.14%)
Mutual labels:  webpack, django
Subnode.org
SubNode: Social Media App
Stars: ✭ 25 (-97.85%)
Mutual labels:  webpack, bootstrap4
Coderedcms
A content management system for marketing websites based on Django and Wagtail.
Stars: ✭ 386 (-66.84%)
Mutual labels:  django, bootstrap4
E Commerce 2 django
Guest register, user register, user login, user logout, account home page, product view history, change password, reset password, change name, send activation email when register, resend activation email, add shipping address, add billing address, add nickname to the addresses, edit shipping address, edit billing address, view list of your addresses, reuse shipping addresses when order products, reuse billing addresses when ordeer products, show sales analytics if staff or admin only using -chart.js-, get analytics data with Ajax, receive marketing email, change if user will receive marketing email or not by admin, send contact message with Ajax, products list, product detail, download product detail as a PDF file, download digital product files -if the user purchased that digital product only-, orders list, list of digital products files, order detail, download order detail as a PDF file, verify order ownership with Ajax -to secure order detail page-, show cart products, add or remove product from cart, checkout page, thanks page when order placed successfully, add or reuse payment method, add or reuse payment method with Ajax, search products by title, search products by description, search products by price, search products by tag title, write tags for products -by admin only-, auto fill contact email, full name if user logged in.
Stars: ✭ 20 (-98.28%)
Mutual labels:  django, bootstrap4
Estoque
Controle de estoque
Stars: ✭ 292 (-74.91%)
Mutual labels:  django, bootstrap4
Cookiecutter Django Vue
Cookiecutter Django Vue is a template for Django-Vue projects.
Stars: ✭ 462 (-60.31%)
Mutual labels:  webpack, django
21 Points
❤️ 21-Points Health is an app you can use to monitor your health.
Stars: ✭ 244 (-79.04%)
Mutual labels:  webpack, bootstrap4
Ngx Admin
Customizable admin dashboard template based on Angular 10+
Stars: ✭ 23,286 (+1900.52%)
Mutual labels:  webpack, bootstrap4
Docker Django Webpack Skeleton
Django Skeleton W/ Docker Dev & Production W/ Webpack 2 W/ BabelJS W/ Sass W/ PostgreSQL
Stars: ✭ 191 (-83.59%)
Mutual labels:  webpack, django
Django Webpack Loader
Transparently use webpack with django
Stars: ✭ 2,327 (+99.91%)
Mutual labels:  webpack, django
React Webpack Django
De-coupled ReactJS client for greater flexibility and less black-box Django magic
Stars: ✭ 24 (-97.94%)
Mutual labels:  webpack, django
Django Bootstrap4
Bootstrap 4 integration with Django.
Stars: ✭ 877 (-24.66%)
Mutual labels:  django, bootstrap4

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

  • [ ] Make sure you have Python 3.8 installed
  • [ ] Install Django with pip install django, to have the django-admin command available.
  • [ ] 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,Dockerfile,README.md,.env.example,.gitignore,Makefile --template=https://github.com/vintasoftware/django-react-boilerplate/archive/boilerplate-release.zip
    
    Alternatively, you may start the project in the current directory by placing a . right after the project name, using the following command:
    django-admin startproject theprojectname . --extension py,yml,json --name Procfile,Dockerfile,README.md,.env.example,.gitignore,Makefile --template=https://github.com/vintasoftware/django-react-boilerplate/archive/boilerplate-release.zip
    

In the next steps, always remember to replace theprojectname with your project's name

  • [ ] Above: don't forget the --extension and --name params!
  • [ ] Change the first line of README to the name of the project
  • [ ] Add an email address to the ADMINS settings variable in {{project_name}}/backend/{{project_name}}/settings/base.py
  • [ ] Change the SERVER_EMAIL to the email address used to send e-mails in {{project_name}}/backend/{{project_name}}/settings/production.py
  • [ ] Rename the folder circleci to .circleci with the command mv circleci .circleci

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

Running

Tools

Setup

  • Inside the backend folder, 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
  • Create a copy of .env.example: cp .env.example .env

If you are using Docker:

  • Open a new command line window and go to the project's directory.
  • Create the migrations for users app:
    docker-compose run --rm backend python manage.py makemigrations
  • Run the migrations: docker-compose run --rm backend python manage.py migrate
  • Run the project: docker-compose up -d
  • To access the logs for each service run docker-compose logs -f service_name (either backend, frontend, etc)

If you are not using Docker:

Setup the frontend

  • Open a new command line window and go to the project's directory.
  • npm install
  • npm run start

Setup the backend

  • Open a new command line window and go to the project's directory.

  • Create a new virtualenv with either virtualenvwrapper or only virtualenv: mkvirtualenv {{project_name}} or python -m venv {{project_name}}-venv

    If you're using Python's virtualenv (the latter option), make sure to create the environment with the suggested name, otherwise it will be added to version control.

  • Make sure the virtualenv is activated workon {{project_name}} or source {{project_name}}-venv/bin/activate

  • Run make compile_install_requirements to install the requirements

    Please make sure you have already setup PostgreSQL on your environment before installing the requirements

    In case you wish to use a Conda virtual environment, please remove the line export PIP_REQUIRE_VIRTUALENV=true; \ from Makefile

  • Go to the backend directory.

  • Create the migrations for users app: python manage.py makemigrations

  • Run the migrations: python manage.py migrate

  • Run the project: python manage.py runserver

Setup Celery

  • Open a command line window and go to the project's directory
  • workon {{project_name}} or source {{project_name}}-venv/bin/activate depending on if you are using virtualenvwrapper or just virtualenv.
  • python manage.py celery

Mailhog

  • For development, we use Mailhog to test our e-mail workflows, since it allows us to inspect the messages to validate they're correctly built
    • Docker users already have it setup and running once they start the project
    • For non-Docker users, please have a look here for instructions on how to setup Mailhog on specific environments

The project expects Mailhog SMTP server to be running on port 1025, you may alter that by changing EMAIL_PORT on settings

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

Add the libname to either requirements.in or dev-requirements.in, then either upgrade the libs with make upgrade or manually compile it and then, install. pip-compile requirements.in > requirements.txt or make upgrade pip install -r requirements.txt

Cleaning example code

Before you start creating your own apps remove the example:

  • Run the command make clean_examples in order to clean up the example apps from the front and backend.
  • Deregister the example app by removing 'exampleapp.apps.ExampleappConfig' from backend/{{project_name}}/settings/base.py.
  • Adjust backend/{{project_name}}/urls.py to point to your newly created Django app and remove the path configuration that redirects to the deleted example app.

Deployment

Setup

This project comes with an app.json file, which can be used to create an app on Heroku from a GitHub repository.

After setting up the project, you can init a repository and push it on GitHub. If your repository is public, you can use the following button:

Deploy

If you are in a private repository, access the following link replacing $YOUR_REPOSITORY_LINK$ with your repository link.

  • https://heroku.com/deploy?template=$YOUR_REPOSITORY_LINK$

Remember to fill the ALLOWED_HOSTS with the URL of your app, the default on heroku is appname.herokuapp.com. Replace appname with your heroku app name.

Sentry

Sentry is already set up on the project. For production, add SENTRY_DSN environment variable on Heroku, with your Sentry DSN as the value.

You can test your Sentry configuration by deploying the boilerplate with the sample page and clicking on the corresponding button.

Sentry source maps for JS files

The bin/post_compile script has a step to push Javascript source maps to Sentry, however some environment variables need to be set on Heroku.

You need to enable Heroku dyno metadata on your Heroku App. Use the following command on Heroku CLI:

  • heroku labs:enable runtime-dyno-metadata -a <app name>

The environment variables that need to be set are:

After enabling dyno metadata and setting the environment variables, your next Heroku Deploys will create a release on Sentry where the release name is the commit SHA, and it will push the source maps to it.

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.

Opinionated Settings

Some settings defaults were decided based on Vinta's experiences. Here's the rationale behind them:

CELERY_ACKS_LATE = True

We believe Celery tasks should be idempotent. So for us it's safe to set CELERY_ACKS_LATE = True to ensure tasks will be re-queued after a worker failure. Check Celery docs on "Should I use retry or acks_late?" for more info.

Contributing

If you wish to contribute to this project, please first discuss the change you wish to make via an issue.

Check our contributing guide to learn more about our development process and how you can test your changes to the boilerplate.

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: [email protected]

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

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].