{ "info": { "author": "Leone Bacciu", "author_email": "leonebacciu@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Readme in progress\n\n# Requirements\n+ Python >= 3.6\n+ Django 2.2\n\n## General concept\n![alt text](emailFlow.png?raw=True \"Flow\")\n\n## Installation\n\nYou can install by:\n\n```commandline\npip3 install django-email-verification\n```\n\nand import by:\n\n```python\nINSTALLED_APPS = [\n 'django.contrib.admin',\n 'django.contrib.auth',\n ...\n 'django_email_verification', # you have to add this\n]\n```\n\n## Settings parameters\nYou have to add these parameters to the settings, you have to include all of them except the last one:\n```python\nEMAIL_SERVER = 'smtp.gmail.com'\nEMAIL_PORT = 587\nEMAIL_ADDRESS = 'mymail@gmail.com'\nEMAIL_PASSWORD = 'mYC00lP4ssw0rd'\nEMAIL_MAIL_SUBJECT = 'Confirm your email'\nEMAIL_MAIL_HTML = 'mail_body.html'\nEMAIL_MAIL_PLAIN = 'mail_body.txt'\nEMAIL_PAGE_TEMPLATE = 'confirm_template.html'\nEMAIL_PAGE_DOMAIN = 'http://mysite.com/'\nEMAIL_MODEL_ADMIN = False # the default value is False\n```\nIn detail:\n+ `EMAIL_SERVER`: your mail provider's server (e.g. `'smtp.gmail.com'` for gmail)\n+ `EMAIL_PORT`: your mail provider's server port (e.g. `587` for gmail)\n+ `EMAIL_ADDRESS`: your email address\n+ `EMAIL_PASSWORD`: your email address' password\n+ `EMAIL_MAIL_`:\n * `SUBJECT`: the mail default subject (needed)\n * `HTML`: the mail body in form of html (not needed)\n * `PLAIN`: the mail body in form of .txt file (needed if `HTML` is not defined)\n+ `EMAIL_PAGE_TEMPLATE`: the template of the success/error view\n+ `EMAIL_PAGE_DOMAIN`: the domain of the confirmation link (usually your site's domain)\n+ `EMAIL_MODEL_ADMIN`: True if you want to see the model in the admin panel (only for debugging purposes)\n\n## Templates examples\nThe `EMAIL_MAIL_HTML` should look like this (`{{ link }}` is passed during the rendering):\n```html\n\n\n\n \n \n\n \n

You are almost there!


\n

Please click here to confirm your account

\n \n\n```\n\nThe `EMAIL_MAIL_PLAIN` should look like this (`{{ link }}` is passed during the rendering):\n```text\nYou are almost there!\nPlease click the following link to confirm your account\n{{ link }}\n```\n\nThe `EMAIL_PAGE_TEMPLATE` should look like this (`{{ success }}` is boolean and passed during the rendering):\n```html\n\n\n\n \n Confirmation\n \n\n\n {% if success %}\n You have confirmed your account!\n {% else %}\n Errore, invalid token!\n {% endif %}\n\n\n```\n\n## Email sending\nAfter you have created the user you can send the confirm email\n```python\nfrom django.shortcuts import render\nfrom django.contrib.auth import get_user_model\nfrom django_email_verification import sendConfirm\n\ndef myCreateView(request):\n ...\n user = get_user_model().objects.create(username=username, password=password, email=email)\n sendConfirm(user)\n return render(...)\n```\n`sendConfirm(user)` sets user's `is_active` to `False` and sends an email with the defined template (and the pseudo-random generated token) to the user.\n\n## Token verification\nYou have to include the urls in `urls.py`\n```python\nfrom django.contrib import admin\nfrom django.urls import path, include\nfrom django_email_verification import urls as mail_urls\n\nurlpatterns = [\n path('admin/', admin.site.urls),\n ...\n path('email/', include(mail_urls)),\n]\n```\nWhen a request arrives to `https.//mydomain.com/email/` the package verifies the token and:\n+ if it corresponds to a pending token it renders the `EMAIL_PAGE_TEMPLATE` passing `success=True` and deletes the token\n+ if it doesn't correspond it renders the `EMAIL_PAGE_TEMPLATE` passing `success=False`\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/LeoneBacciu/django-email-verification", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-email-verification", "package_url": "https://pypi.org/project/django-email-verification/", "platform": "", "project_url": "https://pypi.org/project/django-email-verification/", "project_urls": { "Homepage": "https://github.com/LeoneBacciu/django-email-verification" }, "release_url": "https://pypi.org/project/django-email-verification/0.0.2/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Email verificator app for django", "version": "0.0.2" }, "last_serial": 5903037, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "203bfe2f03b4984fd28dcfead8d6c2b5", "sha256": "4fd0edc0f4d3867fbe541c7451618c5e716ceb74699c22e8dee67fef70fd45b9" }, "downloads": -1, "filename": "django_email_verification-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "203bfe2f03b4984fd28dcfead8d6c2b5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6442, "upload_time": "2019-09-29T10:07:55", "url": "https://files.pythonhosted.org/packages/1b/80/8c22a00434f010a04922cc27ec418e833a21eda24cd3a4316d87acddec9a/django_email_verification-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "02cc79209f2f6280028ac3c0eeeb585d", "sha256": "3ee34c26e37ccac6b20f5d53a3c30627c4ebc22306e5e09cfbb00f023478eebb" }, "downloads": -1, "filename": "django-email-verification-0.0.1.tar.gz", "has_sig": false, "md5_digest": "02cc79209f2f6280028ac3c0eeeb585d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4005, "upload_time": "2019-09-29T10:07:58", "url": "https://files.pythonhosted.org/packages/20/aa/d28520c7bcd6f8bfff17df6ba12eb2c792906a58bb1776843981af50f146/django-email-verification-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "4c0dd412ae6490cc1568009d8d6738ff", "sha256": "789b6fe97f54278693ee02fcffdefdc56a263d0b48434984db683a282f44ed26" }, "downloads": -1, "filename": "django_email_verification-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4c0dd412ae6490cc1568009d8d6738ff", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 7942, "upload_time": "2019-09-29T16:42:25", "url": "https://files.pythonhosted.org/packages/1f/64/8d4ced3f6676ba856d6fba7f7b4778353a0095a4f72e639399a66fe4e369/django_email_verification-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed23bea5cc23d6527a9303fcd7b60f86", "sha256": "a8cf903102f870c9a14d1a9de563866ac0fdf71b3349bbc8acab817e9f54d60b" }, "downloads": -1, "filename": "django-email-verification-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ed23bea5cc23d6527a9303fcd7b60f86", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5798, "upload_time": "2019-09-29T16:42:26", "url": "https://files.pythonhosted.org/packages/86/97/53296d4ee01125782f3236ad3f3636ad7f1c3558f9fe72e3bc708154516b/django-email-verification-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4c0dd412ae6490cc1568009d8d6738ff", "sha256": "789b6fe97f54278693ee02fcffdefdc56a263d0b48434984db683a282f44ed26" }, "downloads": -1, "filename": "django_email_verification-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4c0dd412ae6490cc1568009d8d6738ff", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 7942, "upload_time": "2019-09-29T16:42:25", "url": "https://files.pythonhosted.org/packages/1f/64/8d4ced3f6676ba856d6fba7f7b4778353a0095a4f72e639399a66fe4e369/django_email_verification-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed23bea5cc23d6527a9303fcd7b60f86", "sha256": "a8cf903102f870c9a14d1a9de563866ac0fdf71b3349bbc8acab817e9f54d60b" }, "downloads": -1, "filename": "django-email-verification-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ed23bea5cc23d6527a9303fcd7b60f86", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5798, "upload_time": "2019-09-29T16:42:26", "url": "https://files.pythonhosted.org/packages/86/97/53296d4ee01125782f3236ad3f3636ad7f1c3558f9fe72e3bc708154516b/django-email-verification-0.0.2.tar.gz" } ] }