From 9b14e96804f0ff9d159bb35095678a2782b9873c Mon Sep 17 00:00:00 2001 From: leolivier Date: Thu, 8 Aug 2024 17:45:13 +0200 Subject: [PATCH 01/17] django 5.1 compatibility tries to fix https://github.com/foo290/Django-Verify-Email/issues/86 --- verify_email/token_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verify_email/token_manager.py b/verify_email/token_manager.py index 585df01..3c15b18 100644 --- a/verify_email/token_manager.py +++ b/verify_email/token_manager.py @@ -50,7 +50,7 @@ def __init__(self): salt = self.settings.get('salt', raise_exception=False) sep = self.settings.get('sep', raise_exception=False) - super().__init__(key, sep, salt) + super().__init__(*, key, sep, salt) # Private : def __get_seconds(self, interval): From c9cd6902df6814e64c2705a73aa2cebab18ec46d Mon Sep 17 00:00:00 2001 From: leolivier Date: Thu, 8 Aug 2024 17:47:46 +0200 Subject: [PATCH 02/17] previous change was not done the right way --- verify_email/token_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verify_email/token_manager.py b/verify_email/token_manager.py index 3c15b18..104db24 100644 --- a/verify_email/token_manager.py +++ b/verify_email/token_manager.py @@ -50,7 +50,7 @@ def __init__(self): salt = self.settings.get('salt', raise_exception=False) sep = self.settings.get('sep', raise_exception=False) - super().__init__(*, key, sep, salt) + super().__init__(key=key, sep=sep, salt=salt) # Private : def __get_seconds(self, interval): From ec7b72bdb3a73323d4fb818dfb6159095855fb52 Mon Sep 17 00:00:00 2001 From: Olivier LEVILLAIN Date: Thu, 8 Aug 2024 19:03:33 +0200 Subject: [PATCH 03/17] changed envt --- .github/workflows/python-publish.yml | 12 ++++++------ setup.cfg | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 854e31f..64213fd 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,5 +1,5 @@ -name: Upload Python Package +name: Upload Python Package to PyPi on: [push] @@ -9,19 +9,19 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: '3.10' - name: Install dependencies run: | python -m pip install --upgrade pip pip install setuptools wheel twine - name: Build and publish env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_SECRET_TOKEN }} run: | python setup.py sdist bdist_wheel twine upload --skip-existing dist/* diff --git a/setup.cfg b/setup.cfg index ea5d1c7..9ef3216 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,10 +1,10 @@ [metadata] name = Django-Verify-Email -version = 2.0.3 -author = Nitin -author_email = ns290670@gamil.com -description = A Django app for email verification. -url = https://github.com/foo290/Django-Verify-Email/ +version = 2.0.4 +author = leolivier +author_email = levillain.olivier@gamil.com +description = A Django app for email verification. Forked from foo290 s initial version +url = https://github.com/leolivier/Django-Verify-Email/ packages =setuptools.find_packages() classifiers = Environment :: Web Environment From 17003a8be2cfbb239f9024dc62fb1e2f3c6e7bdf Mon Sep 17 00:00:00 2001 From: Olivier LEVILLAIN Date: Thu, 8 Aug 2024 19:17:28 +0200 Subject: [PATCH 04/17] publish on testpypi and release on pypi --- .github/workflows/python-publish.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 64213fd..fd5b93e 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,7 +1,13 @@ name: Upload Python Package to PyPi -on: [push] +on: + push: + branches: [] + tags-ignore: [] + + release: + types: [prereleased, published] jobs: deploy: @@ -22,6 +28,7 @@ jobs: env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_SECRET_TOKEN }} + PYPI_REPO: ${{ github.event_name == 'push' && '--repository testpypi' || '' }} run: | python setup.py sdist bdist_wheel - twine upload --skip-existing dist/* + twine upload $PYPI_REPO --skip-existing dist/* From 110ca8d06e4dd51b4293caf7f89dbf4642c7dbde Mon Sep 17 00:00:00 2001 From: Olivier LEVILLAIN Date: Thu, 8 Aug 2024 19:24:35 +0200 Subject: [PATCH 05/17] use test secret for test pypi --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index fd5b93e..fe4970f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -27,7 +27,7 @@ jobs: - name: Build and publish env: TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_SECRET_TOKEN }} + TWINE_PASSWORD: ${{ github.event_name == 'push' && secrets.TEST_PYPI_SECRET_TOKEN || secrets.PYPI_SECRET_TOKEN }} PYPI_REPO: ${{ github.event_name == 'push' && '--repository testpypi' || '' }} run: | python setup.py sdist bdist_wheel From f7975c3f76340d768d9e71bfbdb8ac675639ee0b Mon Sep 17 00:00:00 2001 From: Olivier LEVILLAIN Date: Thu, 8 Aug 2024 19:37:19 +0200 Subject: [PATCH 06/17] change project name and version to be able to publish --- setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 9ef3216..082baf5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] -name = Django-Verify-Email -version = 2.0.4 +name = django-email-validation +version = 0.9.0 author = leolivier author_email = levillain.olivier@gamil.com description = A Django app for email verification. Forked from foo290 s initial version From 6a370cde64ed712c6f35ede0f10d8d3316fdf331 Mon Sep 17 00:00:00 2001 From: Olivier LEVILLAIN Date: Fri, 9 Aug 2024 17:58:24 +0200 Subject: [PATCH 07/17] description --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 082baf5..98bbd8a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ name = django-email-validation version = 0.9.0 author = leolivier author_email = levillain.olivier@gamil.com -description = A Django app for email verification. Forked from foo290 s initial version +description = A Django app for email verification. Forked from foo290 s Django-Verify-Email v2.0.3 url = https://github.com/leolivier/Django-Verify-Email/ packages =setuptools.find_packages() classifiers = From 67db0c4fac89b9c4f97b59538a4c799dab683b89 Mon Sep 17 00:00:00 2001 From: Olivier LEVILLAIN Date: Fri, 9 Aug 2024 18:27:58 +0200 Subject: [PATCH 08/17] fixed wrong code when no form is provided --- verify_email/email_handler.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/verify_email/email_handler.py b/verify_email/email_handler.py index b3fae6f..257270a 100644 --- a/verify_email/email_handler.py +++ b/verify_email/email_handler.py @@ -28,16 +28,20 @@ def __send_email(self, msg, useremail): ) # Public : - def send_verification_link(self, request, inactive_user=None, form=None): - + def send_verification_link(self, request, form=None, inactive_user=None): + + if not form and not inactive_user: + raise ValueError('Either form or inactive_user must be provided') + elif form and inactive_user: + raise ValueError('Either form or inactive_user must be provided') if form: inactive_user = form.save(commit=False) - + inactive_user.is_active = False inactive_user.save() try: - + useremail = form.cleaned_data.get(self.settings.get('email_field_name')) if form else inactive_user.email if not useremail: raise KeyError( @@ -67,7 +71,7 @@ def resend_verification_link(self, request, email, **kwargs): - UserAlreadyActive (by) get_user_by_token() - MaxRetryExceeded (by) request_new_link() - InvalidTokenOrEmail - + These exception should be handled in caller function. """ inactive_user = kwargs.get('user') @@ -92,10 +96,9 @@ def resend_verification_link(self, request, email, **kwargs): return True - # These is supposed to be called outside of this module -def send_verification_email(request, form): - return _VerifyEmail().send_verification_link(request, form) +def send_verification_email(request, form=None, inactive_user=None): + return _VerifyEmail().send_verification_link(request, form, inactive_user) # These is supposed to be called outside of this module From c80096939f5660b6e133b0dd4d7118c000d0eae2 Mon Sep 17 00:00:00 2001 From: Olivier LEVILLAIN Date: Fri, 9 Aug 2024 19:05:36 +0200 Subject: [PATCH 09/17] raise exception on wrong http method --- verify_email/views.py | 134 +++++++++++++++++++++--------------------- 1 file changed, 68 insertions(+), 66 deletions(-) diff --git a/verify_email/views.py b/verify_email/views.py index 07873db..4af06e9 100644 --- a/verify_email/views.py +++ b/verify_email/views.py @@ -1,5 +1,6 @@ import logging +from django.forms import ValidationError from django.http import Http404, HttpResponse from django.urls import reverse from django.shortcuts import render, redirect @@ -42,77 +43,78 @@ def verify_user_and_activate(request, useremail, usertoken): verify the user's email and token and redirect'em accordingly. """ - if request.method == 'GET': - try: - verified = verify_user(useremail, usertoken) - if verified is True: - if login_page and not success_template: - messages.success(request, success_msg) - return redirect(to=login_page) - return render( - request, - template_name=success_template, - context={ - 'msg': success_msg, - 'status': 'Verification Successful!', - 'link': reverse(login_page) - } - ) - else: - # we dont know what went wrong... - raise ValueError - except (ValueError, TypeError) as error: - logger.error(f'[ERROR]: Something went wrong while verifying user, exception: {error}') - return render( - request, - template_name=failed_template, - context={ - 'msg': failed_msg, - 'minor_msg': 'There is something wrong with this link...', - 'status': 'Verification Failed!', - } - ) - except SignatureExpired: - return render( - request, - template_name=link_expired_template, - context={ - 'msg': 'The link has lived its life :( Request a new one!', - 'status': 'Expired!', - 'encoded_email': useremail, - 'encoded_token': usertoken - } - ) - except BadSignature: - return render( - request, - template_name=failed_template, - context={ - 'msg': 'This link was modified before verification.', - 'minor_msg': 'Cannot request another verification link with faulty link.', - 'status': 'Faulty Link Detected!', - } - ) - except MaxRetriesExceeded: - return render( - request, - template_name=failed_template, - context={ - 'msg': 'You have exceeded the maximum verification requests! Contact admin.', - 'status': 'Maxed out!', - } - ) - except InvalidToken: + if request.method != 'GET': + raise ValidationError('Method not allowed') + try: + verified = verify_user(useremail, usertoken) + if verified is True: + if login_page and not success_template: + messages.success(request, success_msg) + return redirect(to=login_page) return render( request, - template_name=failed_template, + template_name=success_template, context={ - 'msg': 'This link is invalid or been used already, we cannot verify using this link.', - 'status': 'Invalid Link', + 'msg': success_msg, + 'status': 'Verification Successful!', + 'link': reverse(login_page) } ) - except UserNotFound: - raise Http404("404 User not found") + else: + # we dont know what went wrong... + raise ValueError + except (ValueError, TypeError) as error: + logger.error(f'[ERROR]: Something went wrong while verifying user, exception: {error}') + return render( + request, + template_name=failed_template, + context={ + 'msg': failed_msg, + 'minor_msg': 'There is something wrong with this link...', + 'status': 'Verification Failed!', + } + ) + except SignatureExpired: + return render( + request, + template_name=link_expired_template, + context={ + 'msg': 'The link has lived its life :( Request a new one!', + 'status': 'Expired!', + 'encoded_email': useremail, + 'encoded_token': usertoken + } + ) + except BadSignature: + return render( + request, + template_name=failed_template, + context={ + 'msg': 'This link was modified before verification.', + 'minor_msg': 'Cannot request another verification link with faulty link.', + 'status': 'Faulty Link Detected!', + } + ) + except MaxRetriesExceeded: + return render( + request, + template_name=failed_template, + context={ + 'msg': 'You have exceeded the maximum verification requests! Contact admin.', + 'status': 'Maxed out!', + } + ) + except InvalidToken: + return render( + request, + template_name=failed_template, + context={ + 'msg': 'This link is invalid or been used already, we cannot verify using this link.', + 'status': 'Invalid Link', + } + ) + except UserNotFound: + raise Http404("404 User not found") def request_new_link(request, useremail=None, usertoken=None): From dc91ff64f894ea90731aa23ca956623af40705ff Mon Sep 17 00:00:00 2001 From: Olivier LEVILLAIN Date: Fri, 9 Aug 2024 19:14:28 +0200 Subject: [PATCH 10/17] changed version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 98bbd8a..dba019a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = django-email-validation -version = 0.9.0 +version = 0.9.1 author = leolivier author_email = levillain.olivier@gamil.com description = A Django app for email verification. Forked from foo290 s Django-Verify-Email v2.0.3 From 82713662553d67991c6305bdf85f28d5fae4a8a8 Mon Sep 17 00:00:00 2001 From: Olivier LEVILLAIN Date: Fri, 9 Aug 2024 21:15:34 +0200 Subject: [PATCH 11/17] 1rst try to modernize the packaging --- .github/workflows/python-publish.yml | 22 ++++++----- README.md | 39 ++++++++++++++++--- pyproject.toml | 32 +++++++++++++++ setup.cfg | 20 ---------- setup.py | 9 ----- src/verify_email/__init__.py | 1 + {verify_email => src/verify_email}/admin.py | 0 .../verify_email}/app_configurations.py | 0 {verify_email => src/verify_email}/apps.py | 0 {verify_email => src/verify_email}/confirm.py | 0 .../verify_email}/email_handler.py | 0 {verify_email => src/verify_email}/errors.py | 0 {verify_email => src/verify_email}/forms.py | 0 .../verify_email}/migrations/0001_initial.py | 0 .../verify_email}/migrations/__init__.py | 0 {verify_email => src/verify_email}/models.py | 0 {verify_email => src/verify_email}/signals.py | 0 .../verify_email}/templates/email_index.html | 0 .../email_verification_failed.html | 0 .../verify_email/email_verification_msg.html | 0 .../email_verification_successful.html | 0 .../templates/verify_email/link_expired.html | 0 .../verify_email/new_email_sent.html | 0 .../verify_email/request_new_email.html | 0 {verify_email => src/verify_email}/tests.py | 0 .../verify_email}/token_manager.py | 0 {verify_email => src/verify_email}/urls.py | 0 {verify_email => src/verify_email}/views.py | 0 verify_email/__init__.py | 3 -- 29 files changed, 79 insertions(+), 47 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py create mode 100644 src/verify_email/__init__.py rename {verify_email => src/verify_email}/admin.py (100%) rename {verify_email => src/verify_email}/app_configurations.py (100%) rename {verify_email => src/verify_email}/apps.py (100%) rename {verify_email => src/verify_email}/confirm.py (100%) rename {verify_email => src/verify_email}/email_handler.py (100%) rename {verify_email => src/verify_email}/errors.py (100%) rename {verify_email => src/verify_email}/forms.py (100%) rename {verify_email => src/verify_email}/migrations/0001_initial.py (100%) rename {verify_email => src/verify_email}/migrations/__init__.py (100%) rename {verify_email => src/verify_email}/models.py (100%) rename {verify_email => src/verify_email}/signals.py (100%) rename {verify_email => src/verify_email}/templates/email_index.html (100%) rename {verify_email => src/verify_email}/templates/verify_email/email_verification_failed.html (100%) rename {verify_email => src/verify_email}/templates/verify_email/email_verification_msg.html (100%) rename {verify_email => src/verify_email}/templates/verify_email/email_verification_successful.html (100%) rename {verify_email => src/verify_email}/templates/verify_email/link_expired.html (100%) rename {verify_email => src/verify_email}/templates/verify_email/new_email_sent.html (100%) rename {verify_email => src/verify_email}/templates/verify_email/request_new_email.html (100%) rename {verify_email => src/verify_email}/tests.py (100%) rename {verify_email => src/verify_email}/token_manager.py (100%) rename {verify_email => src/verify_email}/urls.py (100%) rename {verify_email => src/verify_email}/views.py (100%) delete mode 100644 verify_email/__init__.py diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index fe4970f..6861aff 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -19,16 +19,20 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.6' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish + python3 -m pip install --upgrade build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ github.event_name == 'push' && secrets.TEST_PYPI_SECRET_TOKEN || secrets.PYPI_SECRET_TOKEN }} - PYPI_REPO: ${{ github.event_name == 'push' && '--repository testpypi' || '' }} - run: | - python setup.py sdist bdist_wheel - twine upload $PYPI_REPO --skip-existing dist/* + name: ${{ github.event_name == 'push' && 'testpypi' || 'pypi' }} + url: ${{ github.event_name == 'push' && 'https://test.pypi.org/p/' || 'https://pypi.org/project/' }}Django-Verify-Email + with: + user: __token__ + password: ${{ github.event_name == 'push' && secrets.TEST_PYPI_SECRET_TOKEN || secrets.PYPI_SECRET_TOKEN }} + repository-url: ${{ github.event_name == 'push' && 'https://test.pypi.org/legacy/' || 'https://pypi.org/legacy/' }} + diff --git a/README.md b/README.md index 00ee391..61dc10e 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,43 @@ -

Email-Verification for Django

+# Email Verification for Django Email verification for new signups or new users is a two-step verification process and adds a layer for security for valid users. - verify_email is a django app that provides this functionality right of the bat without any complex implementation. +**verify_email** is a django app that provides this functionality right of the bat without any complex implementation. -
+## Version Update (2.0.4) +#### Bug fixes +* Solves incompatibility with Django 5.1 (exception when initializing the TokenManager) +* Fixes implementation of sending verification without a form (initial PR by ) -## Version Update (2.0.0): +#### Enhancements +* Verification emails can now be sent without a form if a user has already been created (eg when an admin wants to activate an inactive user) (Inspired by other PRs which were buggy, see above) +* Modernized the Python packaging (removed warnings on build) +* Use of GITHUB TOKEN to build + +## Version Update (v2.0.3) + +#### Bug Fixes: +* Variable name in view function was different than the one passed in URL + +#### Enhancement: +* Raising Http404 instead of returning 404 with a string so we can have the default 404 page +* Using python's logging system instead of print statements -
+ +## Version Update (2.0.2): +#### Bug Fixes: +* Using normal form instead of model forms to allow unique emails to re-request verification email +* Not returning HTTP response in one of the exception blocks + +#### Enhancements: +* Added new settings variable NEW_EMAIL_SENT_TEMPLATE to configure template shown after successful email sent. +* Using get_username() method to account for apps that have changed the USERNAME_FIELD of their user model +* migrations updated according to Django 4.x + + +## Version Update (2.0.0): > This version contains breaking changes and is not compatible with the previous version 1.0.9 @@ -29,7 +56,7 @@ Read about this feature here * Using exceptions instead of normal string errors * code cleanup -

+
## The app takes care of : * Settings user's is_active status to False. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d3057df --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,32 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "django-email-validation" +version = "2.0.4" +#dynamic = ["version"] +authors = [ + { name="Nitin Sharma", email="ns290670@gamil.com"} + { name="Olivier LEVILLAIN", email="levillain.olivier@gmail.com" }, +] +description = " A Django app for email verification." +readme = "README.md" +requires-python = ">=3.6" +dependencies=["binascii", "django"] +classifiers = [ + "Environment :: Web Environment", + "Framework :: Django CMS :: 3.8", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent" +] + +keywords = ["email", "validation", "check"] + +[project.urls] +Homepage = "https://github.com/foo290/Django-Verify-Email/" +Repository = "https://github.com/foo290/Django-Verify-Email.git" +Issues = "https://github.com/foo290/Django-Verify-Email//issues" +Download = "https://github.com/foo290/Django-Verify-Email/archive/refs/tags/2.0.4.tar.gz" \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index dba019a..0000000 --- a/setup.cfg +++ /dev/null @@ -1,20 +0,0 @@ -[metadata] -name = django-email-validation -version = 0.9.1 -author = leolivier -author_email = levillain.olivier@gamil.com -description = A Django app for email verification. Forked from foo290 s Django-Verify-Email v2.0.3 -url = https://github.com/leolivier/Django-Verify-Email/ -packages =setuptools.find_packages() -classifiers = - Environment :: Web Environment - Framework :: Django CMS :: 3.8 - Intended Audience :: Developers - Programming Language :: Python :: 3.6 - License :: OSI Approved :: MIT License - Operating System :: OS Independent -python_requires = >=3.6 - -[options] -include_package_data = true -packages = find: diff --git a/setup.py b/setup.py deleted file mode 100644 index 8ecafc6..0000000 --- a/setup.py +++ /dev/null @@ -1,9 +0,0 @@ -import setuptools - -with open("README.md", "r") as fh: - long_description = fh.read() - -setuptools.setup( - long_description=long_description, - long_description_content_type="text/markdown", -) diff --git a/src/verify_email/__init__.py b/src/verify_email/__init__.py new file mode 100644 index 0000000..9ae7461 --- /dev/null +++ b/src/verify_email/__init__.py @@ -0,0 +1 @@ +from .email_handler import * # noqa diff --git a/verify_email/admin.py b/src/verify_email/admin.py similarity index 100% rename from verify_email/admin.py rename to src/verify_email/admin.py diff --git a/verify_email/app_configurations.py b/src/verify_email/app_configurations.py similarity index 100% rename from verify_email/app_configurations.py rename to src/verify_email/app_configurations.py diff --git a/verify_email/apps.py b/src/verify_email/apps.py similarity index 100% rename from verify_email/apps.py rename to src/verify_email/apps.py diff --git a/verify_email/confirm.py b/src/verify_email/confirm.py similarity index 100% rename from verify_email/confirm.py rename to src/verify_email/confirm.py diff --git a/verify_email/email_handler.py b/src/verify_email/email_handler.py similarity index 100% rename from verify_email/email_handler.py rename to src/verify_email/email_handler.py diff --git a/verify_email/errors.py b/src/verify_email/errors.py similarity index 100% rename from verify_email/errors.py rename to src/verify_email/errors.py diff --git a/verify_email/forms.py b/src/verify_email/forms.py similarity index 100% rename from verify_email/forms.py rename to src/verify_email/forms.py diff --git a/verify_email/migrations/0001_initial.py b/src/verify_email/migrations/0001_initial.py similarity index 100% rename from verify_email/migrations/0001_initial.py rename to src/verify_email/migrations/0001_initial.py diff --git a/verify_email/migrations/__init__.py b/src/verify_email/migrations/__init__.py similarity index 100% rename from verify_email/migrations/__init__.py rename to src/verify_email/migrations/__init__.py diff --git a/verify_email/models.py b/src/verify_email/models.py similarity index 100% rename from verify_email/models.py rename to src/verify_email/models.py diff --git a/verify_email/signals.py b/src/verify_email/signals.py similarity index 100% rename from verify_email/signals.py rename to src/verify_email/signals.py diff --git a/verify_email/templates/email_index.html b/src/verify_email/templates/email_index.html similarity index 100% rename from verify_email/templates/email_index.html rename to src/verify_email/templates/email_index.html diff --git a/verify_email/templates/verify_email/email_verification_failed.html b/src/verify_email/templates/verify_email/email_verification_failed.html similarity index 100% rename from verify_email/templates/verify_email/email_verification_failed.html rename to src/verify_email/templates/verify_email/email_verification_failed.html diff --git a/verify_email/templates/verify_email/email_verification_msg.html b/src/verify_email/templates/verify_email/email_verification_msg.html similarity index 100% rename from verify_email/templates/verify_email/email_verification_msg.html rename to src/verify_email/templates/verify_email/email_verification_msg.html diff --git a/verify_email/templates/verify_email/email_verification_successful.html b/src/verify_email/templates/verify_email/email_verification_successful.html similarity index 100% rename from verify_email/templates/verify_email/email_verification_successful.html rename to src/verify_email/templates/verify_email/email_verification_successful.html diff --git a/verify_email/templates/verify_email/link_expired.html b/src/verify_email/templates/verify_email/link_expired.html similarity index 100% rename from verify_email/templates/verify_email/link_expired.html rename to src/verify_email/templates/verify_email/link_expired.html diff --git a/verify_email/templates/verify_email/new_email_sent.html b/src/verify_email/templates/verify_email/new_email_sent.html similarity index 100% rename from verify_email/templates/verify_email/new_email_sent.html rename to src/verify_email/templates/verify_email/new_email_sent.html diff --git a/verify_email/templates/verify_email/request_new_email.html b/src/verify_email/templates/verify_email/request_new_email.html similarity index 100% rename from verify_email/templates/verify_email/request_new_email.html rename to src/verify_email/templates/verify_email/request_new_email.html diff --git a/verify_email/tests.py b/src/verify_email/tests.py similarity index 100% rename from verify_email/tests.py rename to src/verify_email/tests.py diff --git a/verify_email/token_manager.py b/src/verify_email/token_manager.py similarity index 100% rename from verify_email/token_manager.py rename to src/verify_email/token_manager.py diff --git a/verify_email/urls.py b/src/verify_email/urls.py similarity index 100% rename from verify_email/urls.py rename to src/verify_email/urls.py diff --git a/verify_email/views.py b/src/verify_email/views.py similarity index 100% rename from verify_email/views.py rename to src/verify_email/views.py diff --git a/verify_email/__init__.py b/verify_email/__init__.py deleted file mode 100644 index 29e0ad4..0000000 --- a/verify_email/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .email_handler import * - - From e38a2a6f6516baf8fd3a46ed47ccb57ea3b3748a Mon Sep 17 00:00:00 2001 From: Olivier LEVILLAIN Date: Fri, 9 Aug 2024 21:16:54 +0200 Subject: [PATCH 12/17] upgrade python version --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 6861aff..032ab7c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.6' + python-version: '3.8' - name: Install dependencies run: | python -m pip install --upgrade pip From 0aab81c9a567a8b7e1023adb50da42b719a5f6e0 Mon Sep 17 00:00:00 2001 From: Olivier LEVILLAIN Date: Fri, 9 Aug 2024 21:18:12 +0200 Subject: [PATCH 13/17] typo --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d3057df..927fcab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "django-email-validation" version = "2.0.4" #dynamic = ["version"] authors = [ - { name="Nitin Sharma", email="ns290670@gamil.com"} + { name="Nitin Sharma", email="ns290670@gamil.com"}, { name="Olivier LEVILLAIN", email="levillain.olivier@gmail.com" }, ] description = " A Django app for email verification." From 9d706da1a176f0095a918c1b901761448a475a65 Mon Sep 17 00:00:00 2001 From: leolivier Date: Fri, 9 Aug 2024 22:16:21 +0200 Subject: [PATCH 14/17] changed package and project name --- pyproject.toml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 927fcab..23a38a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,9 @@ -[build-system] +I'll[build-system] requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "django-email-validation" +name = "Django-Verify-Email" version = "2.0.4" #dynamic = ["version"] authors = [ @@ -29,4 +29,7 @@ keywords = ["email", "validation", "check"] Homepage = "https://github.com/foo290/Django-Verify-Email/" Repository = "https://github.com/foo290/Django-Verify-Email.git" Issues = "https://github.com/foo290/Django-Verify-Email//issues" -Download = "https://github.com/foo290/Django-Verify-Email/archive/refs/tags/2.0.4.tar.gz" \ No newline at end of file +Download = "https://github.com/foo290/Django-Verify-Email/archive/refs/tags/2.0.4.tar.gz" + +[tool hatch.build.targets.wheel] +packages = ["src/verify_email"] \ No newline at end of file From 042b952286844a186e67f802f0799240535ce501 Mon Sep 17 00:00:00 2001 From: leolivier Date: Fri, 9 Aug 2024 22:17:43 +0200 Subject: [PATCH 15/17] typo --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 23a38a0..09f6e4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ -I'll[build-system] +[build-system] requires = ["hatchling"] build-backend = "hatchling.build" From adcf2ed25555f9d7aa474630c787aec849a491e7 Mon Sep 17 00:00:00 2001 From: leolivier Date: Fri, 9 Aug 2024 22:19:30 +0200 Subject: [PATCH 16/17] yet another typo --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 09f6e4e..c817999 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,5 +31,5 @@ Repository = "https://github.com/foo290/Django-Verify-Email.git" Issues = "https://github.com/foo290/Django-Verify-Email//issues" Download = "https://github.com/foo290/Django-Verify-Email/archive/refs/tags/2.0.4.tar.gz" -[tool hatch.build.targets.wheel] +[tool.hatch.build.targets.wheel] packages = ["src/verify_email"] \ No newline at end of file From d42b143fe55b43b78a0cabf8abb8d72ff84f38a7 Mon Sep 17 00:00:00 2001 From: leolivier Date: Fri, 9 Aug 2024 22:23:49 +0200 Subject: [PATCH 17/17] use another project name to be allowed to upload to pypi --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c817999..2e80b1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "Django-Verify-Email" +name = "django-email-verification" version = "2.0.4" #dynamic = ["version"] authors = [