All Projects → Seedstars → Django React Redux Base

Seedstars / Django React Redux Base

Licence: mit
Seedstars Labs Base Django React Redux Project

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to Django React Redux Base

Ownphotos
Self hosted alternative to Google Photos
Stars: ✭ 2,587 (-1.6%)
Mutual labels:  django
Rest Api
Learn how to build your own REST API with Python, Django, and the Django Rest Framework.
Stars: ✭ 232 (-91.18%)
Mutual labels:  django
Django Colorfield
color field for django models with a nice color-picker in the admin. 🎨
Stars: ✭ 238 (-90.95%)
Mutual labels:  django
Opal
A web framework for building highly usable healthcare applications.
Stars: ✭ 227 (-91.37%)
Mutual labels:  django
Django Data Wizard
🧙⚙️ Import structured data (e.g. Excel, CSV, XML, JSON) into one or more Django models via an interactive web-based wizard
Stars: ✭ 227 (-91.37%)
Mutual labels:  django
Celery Progress
Drop in, configurable, dependency-free progress bars for your Django/Celery applications.
Stars: ✭ 230 (-91.25%)
Mutual labels:  django
Opensa
资产管理、资产采集、灰度发布、反向代理、批量任务、任务编排、计划任务、日志审计、权限管理、角色管理、部门管理、运维自动化
Stars: ✭ 220 (-91.63%)
Mutual labels:  django
Relate
RELATE is an Environment for Learning And TEaching
Stars: ✭ 239 (-90.91%)
Mutual labels:  django
Djangobb
DjangoBB mirror. DjangoBB is a quick and simple forum which uses the Django Framework (written in Python language). Abbreviation DjangoBB stands for Django Bulletin Board. DjangoBB is distributed under the BSD license.
Stars: ✭ 232 (-91.18%)
Mutual labels:  django
Django Dynamic Preferences
Dynamic global and instance settings for your django project
Stars: ✭ 238 (-90.95%)
Mutual labels:  django
Django Shop
A Django based shop system
Stars: ✭ 2,706 (+2.93%)
Mutual labels:  django
Mayan Edms
Free Open Source Document Management System (mirror, no pull request or issues)
Stars: ✭ 226 (-91.4%)
Mutual labels:  django
Zds Site
Cœur du projet technique de Zeste de Savoir
Stars: ✭ 236 (-91.02%)
Mutual labels:  django
Djangochannelsrestframework
A Rest-framework for websockets using Django channels-v3
Stars: ✭ 224 (-91.48%)
Mutual labels:  django
Tacticalrmm
A remote monitoring & management tool, built with Django, Vue and Go.
Stars: ✭ 231 (-91.21%)
Mutual labels:  django
Factory boy
A test fixtures replacement for Python
Stars: ✭ 2,712 (+3.16%)
Mutual labels:  django
Django Migration Linter
🚀 Detect backward incompatible migrations for your django project
Stars: ✭ 231 (-91.21%)
Mutual labels:  django
Pyinstrument
🚴 Call stack profiler for Python. Shows you why your code is slow!
Stars: ✭ 3,870 (+47.2%)
Mutual labels:  django
Chain
链喵 CMDB 本项目已停止开发!因长时间未对代码进行维护,可能会造成项目在不同环境上无法部署、运行BUG等问题,请知晓!项目仅供参考!
Stars: ✭ 240 (-90.87%)
Mutual labels:  django
Django Rest Passwordreset
An extension of django rest framework, providing a configurable password reset strategy
Stars: ✭ 238 (-90.95%)
Mutual labels:  django

Build Status

Django React/Redux Base Project

This repository includes a boilerplate project used for all Seedstars Labs applications. It uses Django as backend and React as frontend.

We build on the shoulders of giants with the following technologies:

Frontend

Backend

  • Django
  • Django REST framework Django REST framework is a powerful and flexible toolkit for building Web APIs
  • Django REST Knox Token based authentication for API endpoints
  • WhiteNoise to serve files efficiently from Django
  • Prospector a complete Python static analysis tool
  • Bandit a security linter from OpenStack Security
  • pytest a mature full-featured Python testing tool
  • Mock mocking and testing Library
  • Responses a utility for mocking out the Python Requests library

Readme Notes

  • If the command line starts with $, the command should run with user privileges
  • If the command line starts with #, the command should run with root privileges

Retrieve code

  • $ git clone https://github.com/seedstars/django-react-redux-base.git
  • $ cd django-react-redux-base
  • $ git submodule init
  • $ git submodule update
  • $ ./scripts/get_static_validation.sh

Remember that when you copy this repository for a new project you need to add the scripts external module using:

  • $ git submodule add https://github.com/Seedstars/culture-scripts scripts

NOTE: This is only needed in case you copy this code to a new project. If you only clone or fork the repository, the submodule is already configured

Installation

You have two ways of running this project: Using the Dockers scripts or running directly in the console.

Running NO DOCKER

NodeJS tooling

  • $ wget -qO- https://deb.nodesource.com/setup_6.x | sudo bash -
  • $ apt-get install --yes nodejs
  • $ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
  • $ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
  • $ sudo apt-get update && sudo apt-get install yarn

Compile and run project

There are commands you need to compile javascript and run project. Ideally yarn run dev should be run in another console because it blocks it.

  • $ yarn

  • $ yarn run dev # will run webpack with watch and compile code as it changes

  • $ virtualenv -p /usr/bin/python3 virtualenv

  • $ source virtualenv/bin/activate

  • $ pip install -r py-requirements/dev.txt

  • $ cd src

  • $ python manage.py migrate

  • $ python manage.py loaddata fixtures.json

  • $ python manage.py runserver

Then open your browser the page: http://localhost:8000/ If all goes ok you should see a React single page app.

Running DOCKER

We use Docker as a development environment. For production, we leave you to set it up the way you feel better, although it is trivial to extrapolate a production environment from the current docker-compose.yml.

To stop the development server:

  • $ docker-compose stop

Stop Docker development server and remove containers, networks, volumes, and images created by up.

  • $ docker-compose down

You can access shell in a container

  • $ docker ps # get the name from the list of running containers
  • $ docker exec -i -t djangoreactreduxbase_frontend_1 /bin/bash

The database can be accessed @localhost:5433

  • $ psql -h localhost -p 5433 -U djangoreactredux djangoreactredux_dev

Accessing Website

The project has CORS enabled and the URL is hard-coded in javascript to http://localhost:8000 For login to work you will to use this URL in your browser.

Testing

To make sure the code respects all coding guidelines you should run the statics analysis and test scripts before pushing any code.

Frontend (javascript tests)

  • $ ./scripts/test_local_frontend.sh

Backend (django/python tests)

  • $ ./scripts/test_local_backend.sh

Please take into account that test_local_backend.sh runs py.test with --nomigrations --reuse-db flags to allow it be performant. Any time you add a migration please remove those flags next time you run the script.

Static analysis

Frontend (javascript static analysis)

  • $ ./scripts/static_validate_frontend.sh

Backend (django/python static analysis)

  • $ ./scripts/static_validate_backend.sh

Deployment in Production

We deploy all our production code using Kubernetes. Explaining how to do deployments is beyond the scope of this boilerplate.

Here's a great article from digital ocean on how to deploy django project in a VM: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

Screenshots

Here are some screenshots of the boilerplate project.

Screenshot01

Screenshot02

Gotchas in Docker

  • This project uses NodeJS v6.x (stable) and yarn
  • The development server takes longer than the django server to start, as it has to install the javascript dependencies (if not already installed) and fire webpack. This means that after the django server starts, you should wait that webpack finishes compiling the .js files.
  • If your IDE has builtin language support for python with auto-imports (e.g. PyCharm), you can create a virtualenv and install the py-requirements.
  • If you are annoyed by docker creating files belonging to root (which is Docker's intended behaviour), you can run # chown -hR $(whoami) . before firing up the server.

Contributing

We welcome contributions from the community, given that they respect these basic guidelines:

  • All Tests & Static Analysis passing;
  • 100% code coverage;

Prior to any pull-request, we advise to open an issue. This is because, although we are happy to merge your code, we must make sure the changes don't impact our way of doing things, thus resulting on a declined PR, and your time wasted.

If you want to tackle any open issue, well..... Just go for it! :)

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].