diff --git a/LICENSE b/LICENSE index 40a2d20..53a6601 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2016, Christian Kreuzberger. +Copyright (c) 2016-2020, Christian Kreuzberger, Anexia Internetdienstleistungs GmbH All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -24,4 +24,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 61c8939..f5fac5d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Django Rest Multi Token Auth + This django app is an extension for the Django Rest Framework (Version 3.4+). It tries to overcome the limitation of Token Authentication, which only uses a single token per user. @@ -73,6 +74,7 @@ tox ``` ## Cache Backend + If you want to use a cache for the session store, you can install [django-memoize](https://pythonhosted.org/django-memoize/) and add `'memoize'` to `INSTALLED_APPS`. Then you need to use ``CachedMultiTokenAuthentication`` instead of ``MultiTokenAuthentication``. @@ -92,10 +94,12 @@ If your project uses an older verison of Django or Django Rest Framework, you ca ## Changelog / Releases -All releases should be listed in the [releases tab on github](https://github.com/anx-ckreuzberger/django-rest-multiauthtoken/releases). + +All releases should be listed in the [releases tab on github](https://github.com/anexia-it/django-rest-multitokenauth/releases). See [CHANGELOG.md](CHANGELOG.md) for a more detailed listing. ## License + This project is published with the [BSD 3 Clause License](LICENSE). See [https://choosealicense.com/licenses/bsd-3-clause-clear/](https://choosealicense.com/licenses/bsd-3-clause-clear/) for more information about what this means. diff --git a/setup.py b/setup.py index 80ad339..36590fd 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,58 @@ +import io import os +import sys +from shutil import rmtree -from setuptools import find_packages, setup +from setuptools import find_packages, setup, Command -with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: - README = readme.read() +VERSION = '1.3.2' + +here = os.path.abspath(os.path.dirname(__file__)) +with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f: + README = '\n' + f.read() + + +class UploadCommand(Command): + """Support setup.py upload.""" + + description = 'Build and publish the package.' + user_options = [] + + @staticmethod + def status(s): + """Prints things in bold.""" + print('\033[1m{0}\033[0m'.format(s)) + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + try: + self.status('Removing previous builds...') + rmtree(os.path.join(here, 'dist')) + except OSError: + pass + + self.status('Building Source and Wheel (universal) distribution...') + os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable)) + + self.status('Uploading the package to PyPI via Twine...') + os.system('twine upload dist/*') + + self.status('Pushing git tags...') + os.system('git tag {0}'.format(VERSION)) + os.system('git push --tags') + + sys.exit() -# allow setup.py to be run from any path -os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-rest-multitokenauth', - version='1.4.0alpha1', - packages=find_packages(), + version=VERSION, + packages=find_packages(exclude=["tests", "*.tests", "*.tests.*", "tests.*"]), install_requires=[ 'django-ipware==2.1.*', ], @@ -20,9 +61,10 @@ description='An extension of django rest frameworks token auth, providing multiple authentication tokens per user', long_description=README, long_description_content_type='text/markdown', - url='https://github.com/anx-ckreuzberger/django-rest-multiauthtoken', - author='Christian Kreuzberger', - author_email='ckreuzberger@anexia-it.com', + url='https://github.com/anexia-it/django-rest-multitokenauth', + author='Harald Nezbeda', + author_email='hnezbeda@anexia-it.com', + python_requires='>=3.4.0', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', @@ -45,4 +87,8 @@ 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], + # $ setup.py upload support. + cmdclass={ + 'upload': UploadCommand, + }, )