{ "info": { "author": "Abraham Elmahrek", "author_email": "abraham@elmahrek.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries" ], "description": "# django-userpure\n\nBasic feature set for managing users in Django 1.5.\nWith the deprecation of user profiles and the growth of \ncustom user models, the need for a new user management system\nwas necessary.\n\n## Installation\n\nTo install ``django-userpure``, download django-userpure and run:\n\n python setup.py insatll\n\n## Usage\n\nThe following is an example of how to use the Activation feature:\n\n``models.py``:\n\n class UserManager(UserpureActivationManager, BaseUserManager):\n def create_user(self, email, password, **extra_fields):\n now = timezone.now()\n if not email:\n raise ValueError('The given email must be set')\n email = UserManager.normalize_email(email)\n user = self.model(email=email, is_active=True, is_superuser=False, last_login=now, **extra_fields)\n\n user.set_password(password)\n user.save(using=self._db)\n return user\n\n class User(UserpureActivationMixin, PermissionsMixin, AbstractBaseUser):\n objects = UserManager()\n\n USERNAME_FIELD = 'email'\n REQUIRED_FIELDS = []\n\n``views.py``:\n\n class Activate(View):\n \"\"\"\n Activate a user by activation key.\n \"\"\"\n activation_key = None\n user = None\n redirect_url = None\n \n def get(self, request):\n self.activation_key = request.GET.get('activation_key', None)\n if self.activation_key:\n self.user = get_user_model().objects.activate(self.activation_key)\n if self.user:\n messages.success(request, _(\"User activated successfully.\"))\n else:\n messages.error(request, _(\"Could not activate user.\"))\n return HttpResponseRedirect(self.redirect_url)\n\n## Design\nThe idea is that any amount of functionality can be mixed into managers or models.\nSince there are two types of forms, mixins can be danerous to use with forms.\nThis is largely why forms are left out of the picture for now.\n\n### Available models\n1. ``UserpureActivationMixin`` enables activation of a user.\n\n### Available managers\n1. ``UserpureActivationManager`` enables activation of a user through a manager.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/abec/django-userpure/tarball/0.1", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/abec/django-userpure", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-userpure", "package_url": "https://pypi.org/project/django-userpure/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-userpure/", "project_urls": { "Download": "https://github.com/abec/django-userpure/tarball/0.1", "Homepage": "https://github.com/abec/django-userpure" }, "release_url": "https://pypi.org/project/django-userpure/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Basic user proerties and user ability for django 1.5.", "version": "0.1.0" }, "last_serial": 790964, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5156cf847c14b478a0b41f9165a1fea8", "sha256": "b92195ae8b5fd81eddfebbeca281c6e06f2e28fbeb3b13c24220a5c8e01ad3cb" }, "downloads": -1, "filename": "django-userpure-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5156cf847c14b478a0b41f9165a1fea8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8206, "upload_time": "2013-03-05T07:46:50", "url": "https://files.pythonhosted.org/packages/9a/56/985c4eccbb5b6e30957bf5384e13bf1e1be6239fd55e98f12d2765c1f9e8/django-userpure-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5156cf847c14b478a0b41f9165a1fea8", "sha256": "b92195ae8b5fd81eddfebbeca281c6e06f2e28fbeb3b13c24220a5c8e01ad3cb" }, "downloads": -1, "filename": "django-userpure-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5156cf847c14b478a0b41f9165a1fea8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8206, "upload_time": "2013-03-05T07:46:50", "url": "https://files.pythonhosted.org/packages/9a/56/985c4eccbb5b6e30957bf5384e13bf1e1be6239fd55e98f12d2765c1f9e8/django-userpure-0.1.0.tar.gz" } ] }