semvec/pypi-packages huggingface dataset:
django-icase 0.1.1
A few tools for helping with case-insensitvity in Django URLs.
License: BSD
Keywords: django-icase

=============================
django-icase
=============================

.. image:: https://badge.fury.io/py/django-icase.svg
    :target: https://badge.fury.io/py/django-icase

.. image:: https://travis-ci.org/bennylope/django-icase.svg?branch=master
    :target: https://travis-ci.org/bennylope/django-icase

.. image:: https://coveralls.io/repos/bennylope/django-icase/badge.svg?branch=master
    :target: https://coveralls.io/r/bennylope/django-icase?branch=master

A few tools for helping with case-insensitvity in Django URLs.

- 404 handler that redirects non-matched, non-lowercase URLs. E.g. if `/About/`
  is not matched, the handler will redirect to `/about/` before returning a 404
- Middleware that enforces lower-cased URLs. E.g. all non-lowercased URLs will
  be redirected to their lowercased form.

Overview
--------

If you only need to match URL patterns, then it's simple to add
case-insensitivity to your regular expressions.::

    urlpatterns = patterns('',
        (r'^(?i)admin/(.*)', admin.site.root),
        (r'^(?i)static/(?P<path>.*)$', 'django.views.static.serve',
            {'document_root': settings.STATIC_DOC_ROOT, 'show_indexes': True}),
        (r'^(?i)login/$', 'django.contrib.auth.views.login'),
        (r'^(?i)logout/$', do_logout),
    )

From Alex Martelli's `Stack Overflow explanation <http://stackoverflow.com/a/1515657/122291>`_.

However this doesn't do anything to match slugs, which are often case-sensitive
matched by default - it's up to the app. If the app uses a straightforward `=`
expression, e.g.::

    object = MyModel.objects.get(slug=slug)

Then `MySlug` won't match `myslug`.

There are also instances where you want to enforce URL casing for other reasons
(or a client does!).

Installation
------------

Install django-icase::

    pip install django-icase

To use the custom 404 handler, simply specify this in your project `urls.py`
configuration.::

    handler404 = 'icase.views.icase_404_handler'

To use the lowercasing middleware, add it to your
`INSTALLED_MIDDLEWARE`.::

    INSTALLED_MIDDLEWARE = (
        'icase.middleware.LowerCased',
        ...
    )

Django & Python support
-----------------------

Actively supported versions of Django are supported by this app,
although there is little reason it should not work on others.

Tested against Python 3 and Python 2.7.9.




History
-------

0.1.1 (2015-05-06)
++++++++++++++++++

* Update django-nose reference to support Django 1.7+

0.1.0 (2015-03-25)
++++++++++++++++++

* First release on PyPI.
django-canvas-api-token 0.2.0
Django app for generating Canvas API user oauth tokens
License: BSD

=======================
django-canvas-api-token
=======================

A reusable django app for handling the workflow of generating per-user
Canvas API oauth tokens. The app assumes that your django project is using the
`django_auth_lti <https://github.com/Harvard-University-iCommons/django-auth-lti>`_
middleware.

Install
-------

.. code-block:: bash

    pip install django-canvas-api-token

Setup
-----

1. Add ``"canvas_api_token"`` to your ``INSTALLED_APPS`` settings
2. Insert the url configuration into your project/app urls.py

.. code-block:: python

    url(r'^canvas_api_token/', include('canvas_api_token.urls'))

3. Run `python manage.py migrate` to ensure db tables are initialized.
4. Use the admin site to create a `canvas_dev_key` entry using the `consumer_key` and developer key values from your Canvas consumer where ...

* ``client_id`` is the integer client id value of your Canvas `developer key <https://canvas.instructure.com/doc/api/file.oauth.html>`_
* ``client_secret`` is the random string 'secret' value of your Canvas developer key

License
-------
django-canvas-api-token is licensed under the BSD license

Copyright
---------
2015 President and Fellows of Harvard College


.. :changelog:

Release History
---------------

0.1.0 (2014-12-17)
++++++++++++++++++

* Birth!

0.1.1 (2014-12-18)
++++++++++++++++++

* fixed ``download_url`` in setup.py

0.1.2 (2015-01-07)
++++++++++++++++++

* fixed bug in utils.canvas_uri use of urlunparse
* added unique index to CanvasApiToken.user_id

0.2.0 (2015-04-28)
++++++++++++++++++

DB storage of canvas developer keys

* New model: CanvasDeveloperKey
* enable admin site
* make CanvasApiToken.user a foreign key into user model