Code Monkey home page Code Monkey logo

dankyrank's Introduction

django-react-multi-page-on-heroku

Running locally

You'll need two terminal windows open - one to run the React compilation toolchain, and another to run Django to actually serve the site.

# In terminal one
./manage.py runserver

# In terminal two
npm run start

Running on Heroku

If you push this directly to a new app on Heroku, it will fail, because the Python buildpack will try to run before the Node buildpack. After creating the new application:

  1. Add the Node buildpack
  2. Add the Python buildpack
  3. Set the DJANGO_DEBUG environment variable to False

Then push your project via git push heroku master. It should download NPM and install your dependencies for you.

Once it finishes that, it will download Python and do the typical Django build process. Unfortunately the bin/post_compile script runs after the collectstatic step, so we call python manage.py collectstatic again after we generate the compiled React code.

Once you've done that, it should be running.

dankyrank's People

Contributors

zachmccormick avatar dependabot-support avatar sreenuyedavalli avatar mattdisipio avatar

Stargazers

 avatar

Watchers

James Cloos 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.