{ "info": { "author": "Funkbit", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP" ], "description": "# Django Funky User\n\n**Django 1.5 user model enhancements**\n\n*This is a work in progress, some functionality is not finalized.*\n\n\nDjango Funky User is a Django application with various functionality\nto replace the built-in Django User model. It is compatible with Django 1.5 and\nabove.\n\nThe intention of the project is to be able to easily use (long) email addresses\nas usernames, have the reset password view send HTML email and fix other minor\nannoyances with Django's otherwise brilliant auth built-in package.\n\nIt also includes a sensible user registration/activation process and is very\nwell suited to bootstrap new projects with basic registered user functionality.\n\nBefore digging in too deep, you should be familiar with custom user models in Django:\nhttps://docs.djangoproject.com/en/1.5/topics/auth/customizing/#substituting-a-custom-user-model\n\n\n## Features\n\n* An extendable User model that utilizes email as username, and allows long email addresses\n* URL configuration (and optionally templates) for Django's built-in auth views\n* User registration and email verification functionality\n* Password reset email with HTML alternative\n\nYou are free to extend the provided User model with your own fields, and you\ncan freely choose what included functionality you want to use in your project.\n\n### Built-in Django views configuration\n\nIf you use the provided URL configuration, it sets up the following built-in Django\nviews with sensible default templates.\n\n* Login and logout\n* Password change\n* Password reset\n\n### User registration\n\nUser registration functionality and templates is also included and works as\nfollows:\n\n* User signs up for an account\n* User receives an activation email\n* User clicks activation link in mail, account is activated/email is verified\nand user is automatically logged in\n\n\n## Installation\n\nInstall `django-funky-user` (available on PyPi):\n\n pip install django-funky-user\n\nAdd it to `INSTALLED_APPS` in your `settings.py` (so Django can locate\ntemplates):\n\n INSTALLED_APPS += ['funky_user']\n\n\n### Vanilla setup\n\nIf you don't need any additional fields on the user model, and want to use all\nincluded functionality, set your project up like this:\n\nAdd to your root URL configuration (`urls.py`):\n\n urlpatterns = patterns('',\n ...\n url(r'^account/', include('funky_user.urls')),\n )\n\nDefine the bare bones user model in your settings:\n\n AUTH_USER_MODEL = 'funky_user.User'\n\nRemember to run the `syncdb` management command to create the database table.\n\n\n## Usage and customizations\n\nSee example usage of customizations in the example/demo_project/accounts\ndirectory.\n\n\n### Model references\n\nWhen refering to the user model in your code, you should avoid referencing\nthe actual model and instead do something like this (from the\n[Django docs](https://docs.djangoproject.com/en/1.5/topics/auth/customizing/#referencing-the-user-model)):\n\n from django.contrib.auth import get_user_model\n User = get_user_model()\n\n user = User.objects.get(id=1)\n\nWhen you create a relation to your user model, you should utilize the setting:\n\n from django.conf import settings\n from django.db import models\n\n class BlogPost(models.Model):\n author = models.ForeignKey(settings.AUTH_USER_MODEL)\n\n\n### Custom User model\n\nYou can easily extend the provided model with your own fields and methods.\nCreate a new application (eg. `accounts`) and create a new model:\n\n from funky_user.models import AbstractBaseUser\n\n class User(AbstractBaseUser):\n website = models.URLField(_('website'))\n twitter_handle = models.CharField(_('twitter handle'), max_length=100)\n\nWhen you create your own model, you must point the `AUTH_USER_MODEL` setting\nto it.\n\n AUTH_USER_MODEL = 'accounts.User'\n\n\n#### Permissions\n\nIf you want permissions support (per user, for groups, etc, provided by\ndefault in earlier versions of Django), you can use the `PermissionsMixin`\nprovided by Django:\n\n from django.contrib.auth.models import PermissionsMixin\n from funky_user.models import AbstractBaseUser\n\n class User(AbstractBaseUser, PermissionsMixin):\n website = models.URLField(_('website'))\n\n\n#### User model in Django admin\n\nFor the custom User model to work with the Django admin, we had to override it\nsince it depends on a `username` field. We have provided a basic admin\nconfiguration that works with the default model.\n\nIf you don't want the provided admin configuration, unregister it and add your\nown: In your application's `admin.py` file:\n\n from django.contrib import admin\n from django.contrib.auth import get_user_model\n\n admin.site.unregister(get_user_model())\n\nYou can subclass the provided admin configuration and override the things you\nneed.\n\n\n### Included views and URL configuration\n\nThe URL configuration is split into two modules: login, logout, password change\nand password reset (Django's built-in views) are located in `funky_user.urls.auth`,\nand the registration functionality is in `funky_user.urls.signup`. If you want\nto utilize both, you can import from `funky_user.urls` directly.\n\nIf you want custom functionality in the same URL namespace, you can just extend\nthe provided configuration in your own URL configuration:\n\n from django.conf.urls import patterns, url\n from funky_user.urls import urlpatterns\n\n urlpatterns += patterns('accounts.views',\n url(r'^edit/$', 'edit', name='user-edit'),\n )\n\n\n### Templates\n\nSince every project has different requirements for templates, we have chosen\nnot to include them with the `funky_user` package. Instead they are available\nseparately, in the `tests/templates/auth` folder. Just drop them in your\nproject's template folder and you should have a decent starting point.\n(They fit perfectly with Twitter's Bootstrap project.)\n\n\n## Implementation notes\n\n* We would like to know which of our registered users has logged in and have\nthe `last_login` field be nullable. But to override it, we need to duplicate\nDjango's `AbstractBaseUser` model with password functionality, etc. Instead, we\nset `last_login` to a date way back (1970-01-01) when a user registers.\n\n\n### TODO\n\n_Developer notes_\n\nThings to do:\n\n* Only send activation mail if user is inactive?\n* Email field in login as EmailField?\n* Remove dependency on django-groove, include send_html_email function?\n* Provide example User models in documentation, remove from models.py?\n* More tests\n\nRandom thoughts:\n\n* Don't include a concrete class, so we don't have to manage migrations in this project?\n* Add translations\n* Support for changing email addresses?\n* Package name: django-funky-user\n* Module name: funky_user\n* Template directory name: auth?\n* URL name prefix: user? account? accounts?", "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/funkbit/django-funky-user", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-funky-user", "package_url": "https://pypi.org/project/django-funky-user/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-funky-user/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/funkbit/django-funky-user" }, "release_url": "https://pypi.org/project/django-funky-user/0.1/", "requires_dist": null, "requires_python": null, "summary": "Django custom user model, registration and tools", "version": "0.1" }, "last_serial": 756063, "releases": { "0.1": [] }, "urls": [] }