{ "info": { "author": "Mohab Usama", "author_email": "mohab.usama@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "================\nDjango Users API\n================\n\n.. image:: https://travis-ci.org/mohabusama/django-users-api.svg?branch=master\n :target: https://travis-ci.org/mohabusama/django-users-api\n\n\nDjango users RESTful API using `Tastypie `_. This django app provides RESTful interface to:\n\n- `Django User `_\n- `Django Group `_\n- `Django Permission `_\n\n\nInstall\n=======\n\n::\n\n pip install django-users-api\n\n\nor from cloned repo\n\n::\n\n python setup.py install\n\n\nDevelopment\n===========\n\nRun tests:\n\n::\n\n $ virtualenv venv\n $ . venv/bin/activate\n $ pip install -r requirements.txt\n $ python setup.py test\n\n\nIntegration\n===========\n\nYou can integrate **django-users-api** app within your django app in various ways.\n\nURLConfig (default)\n-------------------\n\nAdd **django-users-api** default urls to your projects urls. In the following example, we will include our *users_api.urls* prefixed with 'auth/'.\n\nIn project urls.py:\n\n::\n\n from django.conf.urls import patterns, include, url\n\n urlpatterns = patterns(\n '',\n # ...,\n url(r'^auth/', include('users_api.urls')),\n # ...\n )\n\nThe **users_api** URLs will be accessible via:\n\n::\n\n /auth/users/\n /auth/groups/\n /auth/permissions/\n ...\n\nSelected Resources\n------------------\n\nIn some cases you might need to exclude some resources from your project urls. In this case you will have to add the *required* resource(s) yourself.\n\nAssuming you only require the **UsersResource** to be available (i.e. excluding **GroupsResource** & **PermissionsResource**)\n\nIn project urls.py:\n\n::\n\n from django.conf.urls import patterns, include, url\n\n from users_api.common import UsersApi\n from users_api.api.users import UsersResource\n\n django_users_api = UsersApi()\n django_users_api.register(UsersResource())\n\n urlpatterns = patterns(\n '',\n # ...\n url(r'', include(django_users_api.urls)),\n # ...\n )\n\nThe **UsersResource** url will be accessible via:\n\n::\n\n /users/\n\n\nResources\n=========\n\nUsersResource\n-------------\n\nA tastypie ModelResource for **django.contrib.auth.models.User**.\n\n**GET**\n\n- List all users: ``/users/``\n- List user 1: ``/users/1/``\n\nUser JSON response example:\n\n::\n\n {\n \"dateJoined\": \"2014-12-24T13:04:36\",\n \"email\": \"admin@admin.com\",\n \"firstName\": \"\",\n \"isActive\": true,\n \"isStaff\": true,\n \"isSuperuser\": true,\n \"lastLogin\": \"2015-01-03T14:19:41.060600\",\n \"lastName\": \"\",\n \"resourceUri\": \"/users/1/\",\n \"username\": \"admin\"\n }\n\n**POST**\n\n- Create new user: ``/users/``\n\n*Important*: Creating user requires a **password** field to be submitted with data.\n\nUser JSON request payload example:\n\n::\n\n {\n \"email\": \"new-user@admin.com\",\n \"firstName\": \"New\",\n \"lastName\": \"User\",\n \"username\": \"new_user\"\n \"password\": \"us3rP@sswd\"\n }\n\n**PUT**\n\n- Update existing user: ``/users/1/``\n\nSubmitting password field will change the user password.\n\n**DELETE**\n\n- Delete existing user: ``/users/2/``\n\nGroupsResource\n--------------\n\nA tastypie ModelResource for **django.contrib.auth.models.Group**.\n\n**GET**\n\n- List all groups: ``/groups/``\n- List group 1: ``/groups/1/``\n- List user 1 groups: ``/users/1/groups/``\n\nGroup JSON response example:\n\n::\n\n {\n \"name\": \"Group name\",\n \"resourceUri\": \"/groups/1/\"\n }\n\n**POST**\n\n- Create new group: ``/groups/``\n\nGroup JSON request payload example:\n\n::\n\n {\n \"name\": \"HR Group\"\n }\n\n**PUT**\n\n- Update existing group: ``/groups/1/``\n- Assign group 1 to user 1: ``/users/1/groups/1/``\n\n**DELETE**\n\n- Delete existing group: ``/groups/2/``\n- Remove group 1 from user 1: ``/users/1/groups/1/``\n\nPermissionsResource\n-------------------\n\nA tastypie ModelResource for **django.contrib.auth.models.Permission**.\n\n**GET**\n\n- List all permissions: ``/permissions/``\n- List permission 1: ``/permissions/1/``\n- List user 1 permissions: ``/users/1/permissions/``\n- List group 1 permissions: ``/groups/1/permissions/``\n\nPermission JSON response example:\n\n::\n\n {\n \"codename\": \"add_logentry\",\n \"contentTypeUri\": \"/contenttypes/1/\",\n \"name\": \"Can add log entry\",\n \"resourceUri\": \"/permissions/1/\"\n }\n\n**POST**\n\n- Create new permission: ``/permissions/``\n\n*Important*: A valid permission should reference a valid ContentType via *contentTypeUri* field (see `ContentTypesResource`_).\n\nPermission JSON request payload example (assuming we have a *Blog* model):\n\n::\n\n {\n \"codename\": \"add_blog\",\n \"contentTypeUri\": \"/contenttypes/20/\",\n \"name\": \"Can add new blog\",\n }\n\n**PUT**\n\n- Update existing permission: ``/permissions/1/``\n- Assign permission 1 to user 1: ``/users/1/permissions/1/``\n- Assign permission 1 to group 1: ``/groups/1/permissions/1/``\n\n**DELETE**\n\n- Delete existing permission: ``/permissions/2/``\n- Remove permission 1 from user 1: ``/users/1/permissions/1/``\n- Remove permission 1 from group 1: ``/groups/1/permissions/1/``\n\nContentTypesResource\n--------------------\n\nA Read-only tastypie ModelResource for **django.contrib.auth.models.ContentType**.\n\n**GET**\n\n- List all contenttypes: ``/contenttypes/``\n- List contenttype 1: ``/contenttypes/1/``\n\nContentType JSON response example:\n\n::\n\n {\n \"appLabel\": \"admin\",\n \"model\": \"logentry\",\n \"name\": \"log entry\",\n \"resourceUri\": \"/contenttypes/1/\"\n }\n\n\nAuthentication\n==============\n\nBy default, all resources use Tastypie `SessionAuthentication `_.\n\n\nAuthorization\n=============\n\nBy default, all resources use Tastypie `DjangoAuthorization `_.\n\n*Important*: DjangoAuthorization gives *Read access* to all users, which might not be the desired behavior.\n\n\nExtend\n======\n\nDjango-users-api resources are based on Tastypie `ModelResource class `_, which gives you the ability to extend and override any of the *users_api* resources.\n\n\nLicense\n=======\n\n`MIT License `_.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mohabusama/django-users-api", "keywords": null, "license": "The MIT License (MIT)\n\nCopyright (c) 2015 Mohab Usama\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "django-users-api", "package_url": "https://pypi.org/project/django-users-api/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-users-api/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/mohabusama/django-users-api" }, "release_url": "https://pypi.org/project/django-users-api/0.1/", "requires_dist": null, "requires_python": null, "summary": "Django users RESTful API using Tastypie.", "version": "0.1" }, "last_serial": 1369202, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "9fe7daefef4e3fd6a2f10b6ca81d0c65", "sha256": "3920815cdb64f015dd3a5b2e5fed98e078341fac0e326344f9cc92b0007674eb" }, "downloads": -1, "filename": "django-users-api-0.1.tar.gz", "has_sig": false, "md5_digest": "9fe7daefef4e3fd6a2f10b6ca81d0c65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11868, "upload_time": "2015-01-03T13:56:31", "url": "https://files.pythonhosted.org/packages/09/4e/157a327da914340069168b7f9e45c0f0c83e72833de7e50bb29a9b8d6e12/django-users-api-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9fe7daefef4e3fd6a2f10b6ca81d0c65", "sha256": "3920815cdb64f015dd3a5b2e5fed98e078341fac0e326344f9cc92b0007674eb" }, "downloads": -1, "filename": "django-users-api-0.1.tar.gz", "has_sig": false, "md5_digest": "9fe7daefef4e3fd6a2f10b6ca81d0c65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11868, "upload_time": "2015-01-03T13:56:31", "url": "https://files.pythonhosted.org/packages/09/4e/157a327da914340069168b7f9e45c0f0c83e72833de7e50bb29a9b8d6e12/django-users-api-0.1.tar.gz" } ] }