This examples shows how to run Rietveld - the code review tool available at http://codereview.appspot.com/.
Requires: Django 1.4, Python 2.6+, South, django-debug-toolbar
Refer to requirements.txt for the whole list. Run
pip install -r requirements.txt to install the
Differences between Kimpine and Rietveld
What Kimpine has:
- Kimpine uses
django.db.modelsrather than App Engine's db model, and so uses a query syntax more familiar to Django developers.
- Kimpine supports syntax highlighting in side-by-side diffs through Pygments.
- Flexible deployment, choose your own webserver (apache+mod_wsgi, uwsgi, gunicorn, etc.)!
What Kimpine lacks:
- Notify by chat
- Integration with Google accounts
- Adjustable column widths in diffs
Using the Makefile
Skip down to "Manual Setup" if you don't want to use the Makefile.
This will prepare the code review app by preparing a database and gathering the static files. When it's finished run:
and point your browser to 127.0.0.1:8000.
to initialize the example database. Then run the migrations (requires South):
./manage.py migrate codereview
gather all of the static files into a single
Finally, run the development server:
will run Rietveld in development mode.
Creating and updating a code review
- Run the server (
- Make a change to a git repo (even this one! maybe just this file...). Leave the changes unstaged.
- Inside that repo
path/to/kimpine/upload.py -s 127.0.0.1:8000. If you want to include commits in your codereview, just pass the same arguments you would give to
git diff. One common usage is
upload.py -s yourCodeReviewServer.com origin/master...
- When prompted, provide your username/password and a subject line for your issue to be code reviewed.
- Navigate to the site (127.0.0.1:8000) and find your issue.
- Make comments in the diff, write a new message, etc.
- Back in your repository, make more changes to the repo and when you're ready, update the issue:
upload.py -s 127.0.0.1:8000 -i your-issue-number(providing arguments for your diff, if you have more than just unstaged changes).
- Navigate to your issue, check out the delta between your patchsets, make more comments, etc.
- Rinse, repeat.
The preferred method to deploy Django applications is to use WSGI supporting web server. Some popular ones are gunicorn, Apache+mod_wsgi, and uwsgi.
There is one important thing to remember. Django serves media (static) files only in development mode. For running Kimpine in a production environment, you need to setup your web-server to serve the /static/ alias directly.
When running in a production environment, keep in mind Django's CSRF protection is disabled in this example!
/admin URL and login as a super user. Users may change password by logging in
and clicking the 'Change Password' link at the top of the page or visiting
andialbrecht's django-gae2django also allows you to host Rietveld privately. It takes the approach of keeping the Rietveld codebase as intact as possible while providing a library that emulates the App Engine APIs. kimpine (which used gae2django as a starting point) takes the oppsite approach and tears out all code related to App Engine to replace it with native Django libraries.