My heroku deployed personal page code
JavaScript Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/home_page
.gitignore
Procfile
README.rst
requirements.txt

README.rst

This document should explain in some detail the steps it took to get my site adamgh.com up and running with the included code. I won't personally say much, but I'll point you to my references in setting up the site and explain some of the things I needed to do to fill in the blanks.

You can see the results of this project up at www.adamgh.com

Note that I used django 1.3 for this (see requirements.txt)

Heroku and Directory Setup

This project is a heroku deployed and Django built home page. I purchased the url through namecheap.com. I got started on this project with http://v3.mike.tig.as/blog/2012/02/13/deploying-django-on-heroku/ He has a much more detailed approach than I took. You can go through this tutorial without installing a version of postgress locally to run a testing server, but this will end up screwing up your git syncing if you decide to install south.

Setting up the settings files

I really liked the settings directory structure suggested by this guy: http://www.deploydjango.com/django_project_structure/index.html

That being said, he left out some detail about how to get those settings files to be accessed appropriatley come deploy time. I'm not sure if this was the best way to do it, but I ended up needing to make approprate modifications to home_page.manager.py to detect the settings file appropriatley. Moreover this relies on setting a

#.bash_profile LOCAL_MACHINE=true export LOCAL_MACHINE

And on heroku: $ heroku config:add LOCAL_MACHINE=FALSE

The settings files (dev.py and prod.py) are accordingly chosen.

What's more, you need to adjust your Procfile to:

--preload src/home_page/settings/prod.py

What's more, I copied my SECRET_KEY variable from common.py into my .bash_profile, so that when linking up to this public repository it remained secret.

Accessing Static Assets (And making them work with your django site)

The heroku dev center gives essentially all that you need. Be sure to install the requirements mentioned by http://v3.mike.tig.as/blog/2012/02/13/deploying-django-on-heroku/ when considering https://devcenter.heroku.com/articles/s3

I found that the following stack-overflow response also helped: http://stackoverflow.com/questions/11569144/proper-way-to-handle-static-files-and-templates-for-django-on-heroku

Then whenever you push new static content to your heroku site, you'll need to do the following:

$ heroku run python src/home_page/manage.py collectstatic

When developing locally with the defaults, be sure to make a /static/ directory beneath the app_name directory. You templates should know to grab things from there.

See my settings files for more granular detail.

TODO

*Create a separate remote for staging *Up the anti to DNSimple *Add memcaching (profile how it improves performance (if at all)) *Upload optical flow lit review to projects page with a breif abstract *Add title block, and base.html template for pretty layout/DRYER principles