Skip to content

Commit

Permalink
Add settings to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
codeinthehole committed Jan 14, 2015
1 parent ba1e0bc commit 0e940c4
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 15 deletions.
4 changes: 3 additions & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ subclassing but rather take the model class as a ``__init__`` parameter.
.. autoclass:: cacheback.queryset.QuerySetGetJob
:members:

Example usage::
Example usage:

.. sourcecode:: python

from django.contrib.auth import models
from django.shortcuts import render
Expand Down
22 changes: 11 additions & 11 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributing

Get set up by cloning, creating a virtualenv and running::

make develop
$ make develop

to install the testing dependencies.

Expand All @@ -13,33 +13,33 @@ Running tests

Use::

./runtests.py
$ ./runtests.py

Sandbox VM
==========

There is a VagrantFile for setting up a sandbox VM where you can play around
with the functionality. Bring up the Vagrant box::

vagrant up
$ vagrant up

then provision:
then provision::

cd /vagrant/sandbox
./provision.sh
$ cd /vagrant/sandbox
$ ./provision.sh

This may take a while but will set up a Ubuntu Precise64 VM with RabbitMQ
installed and configured. You can then SSH into the machine and run the Django
development server::

vagrant ssh
cd /vagrant/sandbox
./manage.py loaddata/fixture.json
./manage.py runserver 0.0.0.0:8000
$ vagrant ssh
$ cd /vagrant/sandbox
$ ./manage.py loaddata/fixture.json
$ ./manage.py runserver 0.0.0.0:8000

The dummy site will be available at ``localhost:8080``. There are some sample
views in ``sandbox/dummyapp/views.py`` that exercise django-cacheback.

Run a Celery worker using::

./manage.py celery worker --loglevel=INFO
$ ./manage.py celery worker --loglevel=INFO
5 changes: 4 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ shortcomings of this approach are:
.. _`cache stampede`: http://en.wikipedia.org/wiki/Cache_stampede

Now, consider an alternative implementation that uses a Celery task to repopulate the
cache asynchronously instead of during the request/response cycle::
cache asynchronously instead of during the request/response cycle:

.. sourcecode:: python

import datetime
from django.shortcuts import render
Expand Down Expand Up @@ -187,6 +189,7 @@ Contents
installation
usage
api
settings
advanced
contributing

Expand Down
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Installation

You need to do four things:

1. Install Cacheback
~~~~~~~~~~~~~~~~~~~~
1. Install django-cacheback
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Run::

Expand Down
16 changes: 16 additions & 0 deletions docs/settings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
========
Settings
========

``CACHEBACK_CACHE_ALIAS``
-------------------------

This specifies which cache to use from your ``CACHES`` setting. It defaults to
``default``.


``CACHEBACK_VERIFY_CACHE_WRITE``
--------------------------------

This verifies the data is correctly written to memcache. If not, then a
``RuntimeError`` is raised. Defaults to ``True``.

0 comments on commit 0e940c4

Please sign in to comment.