https://github.com/klen/dealer
Make some staff
https://github.com/klen/dealer
Last synced: 11 months ago
JSON representation
Make some staff
- Host: GitHub
- URL: https://github.com/klen/dealer
- Owner: klen
- License: other
- Created: 2012-09-13T13:50:15.000Z (almost 14 years ago)
- Default Branch: develop
- Last Pushed: 2019-09-06T09:54:30.000Z (almost 7 years ago)
- Last Synced: 2025-06-17T10:13:17.207Z (about 1 year ago)
- Language: Python
- Size: 93.8 KB
- Stars: 62
- Watchers: 3
- Forks: 13
- Open Issues: 6
-
Metadata Files:
- Readme: README.rst
- Changelog: Changelog
- License: LICENSE
Awesome Lists containing this project
README
|logo| Dealer
#############
.. _description:
Dealer — SCM_ revision helper in your projects. Just add SCM_ revision to
your static paths and get automatic control at client browser caches:
Somewhere in templates: ::
Middleware
^^^^^^^^^^
Append to your settings: ::
MIDDLEWARE = ['dealer.contrib.django.Middleware']
And use in your views: ::
def view(request):
return request.revision
Or in your templates by `request.revision` var.
Flask support
-------------
Settings
^^^^^^^^
*DEALER_TYPE* — Type of SCM_ repository ('auto', 'git', 'mercurial', 'simple', 'env', 'null'). By default 'auto'
*DEALER_PARAMS* — Params for backend
Usage
^^^^^
In views::
from flask import Flask, g
from dealer.contrib.flask import Dealer
app = Flask('test')
Dealer(app)
assert app.revision
@app.route('/')
def usage_in_view():
return g.revision
In templates: ::
Pyramid support
---------------
::
config.include('dealer.contrib.pyramid')
::
def myview(request):
revision = request.registry.dealer.revision
tag = request.registry.dealer.tag
In templates
::
Revision: {{DEALER_REVISION}}
Tag: {{DEALER_TAG}}
Heroku support
-------------
Settings
^^^^^^^^
*DEALER_TYPE* = 'env'
*DEALER_PARAMS*:
*revision_env_keyname* - Variable name for revision (default: DEALER_REVISION)
*tag_env_keyname* - Variable name for tag (default: DEALER_TAG)
Usage
^^^^^
Setup your revision and tag value in envirement variables.
For example in Heroku.com:
::
heroku config:set DEALER_REVISION='3ffb6b6'
heroku config:set DEALER_TAG=v1_1
After that use dealer as described above.
.. _bagtracker:
Bug tracker
===========
If you have any suggestions, bug reports or
annoyances please report them to the issue tracker
at https://github.com/klen/Dealer/issues
.. _contributing:
Contributing
============
Development of dealer happens at github: https://github.com/klen/dealer
.. _contributors:
Contributors
=============
* klen_ (Kirill Klenov)
.. _license:
License
=======
Licensed under a `BSD license`_.
.. _links:
.. _BSD license: http://www.linfo.org/bsdlicense.html
.. _klen: http://klen.github.com/
.. _SCM: http://en.wikipedia.org/wiki/Source_Control_Management
.. _Git: http://en.wikipedia.org/wiki/Git_(oftware)
.. _Mercurial: http://en.wikipedia.org/wiki/Mercurial
.. |logo| image:: https://raw.github.com/klen/dealer/develop/docs/_static/logo.png
:width: 100