Skip to content

Commit

Permalink
Moved to .rst file, and minor adjustments to setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mawkee committed Jan 2, 2018
1 parent 81c0a99 commit 5ffa4d9
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 60 deletions.
57 changes: 0 additions & 57 deletions README.md

This file was deleted.

84 changes: 84 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
Django DupRequests
==================

Middleware for dropping duplicated requests

Getting Started
---------------

Just install, register the middleware and enjoy. You can adjust the
timeout for duplicated requests on your settings.py file.

Prerequisites
~~~~~~~~~~~~~

You need Django >= 1.9 for this to work. It may work on previous
versions, but I haven’t tested it. I also tested with Django 2.0, but it
may still break before it’s released.

Installing
~~~~~~~~~~

::

pip install django-duprequests

Add the middleware to your MIDDLEWARE or MIDDLEWARE_CLASSES (depending
on your Django version)

::

MIDDLEWARE_CLASSES = [
(...)
'duprequests.middleware.DropDuplicatedRequests',
(...)
]

Customizing
~~~~~~~~~~~

Also on ``settings.py`` you can set up a few variables:

``DUPLICATED_REQUESTS_CACHE_NAME`` - the name of the cache (default
value is ``default``) ``DUPLICATED_REQUESTS_CACHE_TIMEOUT`` - cache
timeout (default value is ``5``; in seconds)
``DUPLICATED_REQUESTS_COOKIE_NAME`` - name of the cookie set on the
user’s session (default value is ``dj-request-id``)
``DUPLICATED_REQUESTS_COOKIE_PREFIX`` - cookie prefix, combined with a
random UUID to set the response cookie (default value is
``request-id-``)

Running the tests
-----------------

The test suite runs outside of a django app (it simulates a very simple
one). Just run tests.py and you’re golden.

Contributing
------------

Feel free to contribute to this project! Documentation is close to
non-existant. Bug reports and enhancement requests can be submitted on
https://github.com/CraveFood/django-duprequests/issues – Pull Requests
are also welcome!

Authors
-------

- **Sergio Oliveira** - *Initial work* -
`Seocam <https://github.com/seocam>`__
- **Danilo Martins** - *Packaging and distribution* -
`Mawkee <https://github.com/mawkee>`__

License
-------

This project is licensed under the BSD License - see the
`LICENSE <LICENSE>`__ file for details

Acknowledgments
---------------

- The simple test suite was copied from project Django CORS Middleware
by @zestedesavoir –
https://github.com/zestedesavoir/django-cors-middleware
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import os

from setuptools import setup

here = os.path.abspath(os.path.dirname(__file__))

# Readme description
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()

setup(
name='django-duprequests',
version=open('VERSION', 'r').read(),
version='0.1.3',
packages=['duprequests'],
install_requires=['Django'],
url='https://github.com/CraveFood/django-duprequests',
license='BSD',
author='Sergio Oliveira',
author_email='[email protected]',
description='Drop duplicated requests',
long_description=open('README.md', 'r').read(),
long_description=long_description,
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
Expand Down

0 comments on commit 5ffa4d9

Please sign in to comment.