If you want to run this project in a virtualenv to isolate it from
other Python projects on your system, create a virtualenv and activate
it. Then run
bin/install-reqs to install the dependencies for this
project into your Python environment.
In order to run Portfoliyo (or its tests), you'll need a PostgreSQL database. By default, Portfoliyo will look for a PostgreSQL database named "portfoliyo" on localhost.
You may need to create a
portfoliyo/settings/local.py file with some
details of your local configuration. See
portfoliyo/settings/local.sample.py for a sample that can be copied to
portfoliyo/settings/local.py and modified.
Once this configuration is done, you should be able to run
syncdb --migrate, then
./manage.py runserver and access the site
in your browser at
You can run the tests with
grunt pytest), or the
Selenium tests with
To install the necessary Ruby gems for Compass/Sass development (only
necessary if you plan to modify Sass files and re-generate CSS), install
gem install bundler) and then run
Local development on this project requires Node.js >= 0.8.0 for JS linting
and handlebars template compilation. To install the necessary Node
npm install -g grunt-cli (once per system), then
You can lint the project's JS with
You can compile Handlebars templates in the
jstemplates/ directory to the
compiled-templates file (
You can compile Sass to CSS with
grunt compass. This requires first
installing Bundler (
gem install bundler) and then running
install to get the necessary Ruby gems installed.
grunt will perform all of the above tasks.
grunt dev will watch for changes to local files and automatically perform
an appropriate selection of the above tasks whenever changes are detected
to relevant files.
Refer to the Gruntfile.js source and Grunt documentation for more info.
In addition to the above configuration, in any production deployment this entire app should be served exclusively over HTTPS (since serving authenticated pages over HTTP invites session hijacking attacks). Ideally, the non-HTTP URLs should redirect to the HTTPS version.
portfoliyo/settings/prod.py should be used as the settings module in a
production deployment in place of
DJANGO_SETTINGS_MODULE=portfoliyo.settings.prod). Site-specific overrides
can still be placed in
You can run
./manage.py checksecure to verify that settings are correctly
configured for a secure deployment.
This app also uses the staticfiles contrib app in Django for
collecting static assets from reusable components into a single
directory for production serving. Under "runserver" in development this
is handled automatically. In production, run
collectstatic to collect all static assets into the
collected-assets directory (or whatever
STATIC_ROOT is set to in
settings_local.py), and make those collected assets available by
HTTP at the