Skip to content

Instantly share code, notes, and snippets.

@galarant
Last active August 29, 2015 14:27
Show Gist options
  • Save galarant/192bd560bc7cde45880b to your computer and use it in GitHub Desktop.
Save galarant/192bd560bc7cde45880b to your computer and use it in GitHub Desktop.
localhost web development in OSX
  1. open a terminal:
    Command-Spacebar to bring up Spotlight, then search for "terminal" and hit Enter
    When terminal opens, click the maximize button to fullscreen it (I will call this Terminal 1 from now on)

  2. in your first terminal tab, start your local web server and leave it running:
    cd ~/pixi_sandbox
    ./manage.py runserver

  3. open a new terminal tab and leave it open on the frontend package root:
    Command-T to create a new terminal tab (I will call this Terminal 2 from now on)
    In the new terminal tab, type:
    cd ~/pixi_sandbox/frontend

  4. open a third terminal tab and navigate to the frontend app root:
    Command-t to create a new terminal tab (I will call this Terminal 3 from now on)
    In the new terminal tab, type:
    cd ~/pixi_sandbox/frontend/app

  5. Open Chrome and navigate to localhost:8000 in the url bar. You should see the main page of our app show up.

  6. Now you're all set up to write code and test it.
    In Terminal 3, you will edit html, js and scss files in the app directory tree. The command to edit is:
    vim <filename>

  7. Once you have edited a file and saved it, you can test it out. In Terminal 2, rebuild the frontend:
    gulp clean-build to clean out the old build
    Control-C to kill it once it's finished running
    gulp build to build the new frontend with your recent changes
    Control-C to kill it once it's finished running

  8. In Chrome, do a hard refresh with Command-Shift-R and you should see your changes.

  9. Profit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment