GithubHelp home page GithubHelp logo

hhy5277 / django-reactjs-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mbrochh/django-reactjs-boilerplate

0.0 1.0 0.0 795 KB

An example how you can use ReactJS with your Django project.

Python 43.22% HTML 5.56% JavaScript 51.23%

django-reactjs-boilerplate's Introduction

Django ReactJS Boilerplate

This repository was used for my talk at the Python User Group Singapore March Meetup 2016

I gave the talk a second time at a PyLadies meetup and it was recorded by Engineers.SG.

The goal is to show how you can use ReactJS in your existing Django apps today.

This is far from perfect. This approach is not universal, so it only works for components that don't need to be indexed by Google (and thus need to be pre-rendered on your server). However, the highly interactive stuff usually happens behind a login form anyways (think Trello: They have a few static pages to advertise their product but the real app is behind a login).

Credit where credit is due:

This awesome blog post by Owais Lone finally pushed me into the right direction: http://owaislone.org/blog/webpack-plus-reactjs-and-django/

Try this on your machine

You can clone this repository, install all dependencies and try it in your browser quite easily:

git clone https://github.com/mbrochh/django-reactjs-boilerplate.git
cd django-reactjs-boilerplate/django
mkvirtualenv djreact
pip install -r requirements.txt
npm install
./manage.py migrate
./manage.py runserver

# in another terminal:
node server.js

Follow my train of thought

If you want to learn how I came up with this repository, you can follow my train of thought by going into all those branches.

The README.md in each branch will tell you what you need to do in order to get to a state that is (hopefully) equal to that branch. If anything doesn't work, just compare your files to the ones in the branch. If your really can't figure it out, just checkout that branch and run it locally and play with it for a while, then move on to the next branch.

Start with Step 1: Create your Django project

django-reactjs-boilerplate's People

Contributors

chakas avatar matiasherranz-santex avatar mbrochh avatar

Watchers

 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.