justdjango / django-ecommerce

An e-commerce website built with Django
GNU General Public License v3.0
2.05k stars 1.59k forks source link

Got Connection refuse error on sign up page #49

Closed azmatsiddique closed 4 years ago

azmatsiddique commented 4 years ago

Environment:

Request Method: POST Request URL: http://127.0.0.1:8000/accounts/signup/

Django Version: 2.2.14 Python Version: 3.7.6 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'allauth', 'allauth.account', 'allauth.socialaccount', 'crispy_forms', 'django_countries', 'core', 'debug_toolbar'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'debug_toolbar.middleware.DebugToolbarMiddleware']

Traceback:

File "/opt/anaconda3/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner

  1. response = get_response(request)

File "/opt/anaconda3/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response

  1. response = self.process_exception_by_middleware(e, request)

File "/opt/anaconda3/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response

  1. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/opt/anaconda3/lib/python3.7/site-packages/django/views/generic/base.py" in view

  1. return self.dispatch(request, *args, **kwargs)

File "/opt/anaconda3/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper

  1. return bound_method(*args, **kwargs)

File "/opt/anaconda3/lib/python3.7/site-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper

  1. return view(request, *args, **kwargs)

File "/opt/anaconda3/lib/python3.7/site-packages/allauth/account/views.py" in dispatch

  1. return super(SignupView, self).dispatch(request, *args, **kwargs)

File "/opt/anaconda3/lib/python3.7/site-packages/allauth/account/views.py" in dispatch

  1. **kwargs)

File "/opt/anaconda3/lib/python3.7/site-packages/allauth/account/views.py" in dispatch

  1. **kwargs)

File "/opt/anaconda3/lib/python3.7/site-packages/django/views/generic/base.py" in dispatch

  1. return handler(request, *args, **kwargs)

File "/opt/anaconda3/lib/python3.7/site-packages/allauth/account/views.py" in post

  1. response = self.form_valid(form)

File "/opt/anaconda3/lib/python3.7/site-packages/allauth/account/views.py" in form_valid

  1. self.get_success_url())

File "/opt/anaconda3/lib/python3.7/site-packages/allauth/account/utils.py" in complete_signup

  1. signal_kwargs=signal_kwargs)

File "/opt/anaconda3/lib/python3.7/site-packages/allauth/account/utils.py" in perform_login

  1. send_email_confirmation(request, user, signup=signup)

File "/opt/anaconda3/lib/python3.7/site-packages/allauth/account/utils.py" in send_email_confirmation

  1. signup=signup)

File "/opt/anaconda3/lib/python3.7/site-packages/allauth/account/models.py" in send_confirmation

  1. confirmation.send(request, signup=signup)

File "/opt/anaconda3/lib/python3.7/site-packages/allauth/account/models.py" in send

  1. get_adapter(request).send_confirmation_mail(request, self, signup)

File "/opt/anaconda3/lib/python3.7/site-packages/allauth/account/adapter.py" in send_confirmation_mail

  1. ctx)

File "/opt/anaconda3/lib/python3.7/site-packages/allauth/account/adapter.py" in send_mail

  1. msg.send()

File "/opt/anaconda3/lib/python3.7/site-packages/django/core/mail/message.py" in send

  1. return self.get_connection(fail_silently).send_messages([self])

File "/opt/anaconda3/lib/python3.7/site-packages/django/core/mail/backends/smtp.py" in send_messages

  1. new_conn_created = self.open()

File "/opt/anaconda3/lib/python3.7/site-packages/django/core/mail/backends/smtp.py" in open

  1. self.connection = self.connection_class(self.host, self.port, **connection_params)

File "/opt/anaconda3/lib/python3.7/smtplib.py" in init

  1. (code, msg) = self.connect(host, port)

File "/opt/anaconda3/lib/python3.7/smtplib.py" in connect

  1. self.sock = self._get_socket(host, port, self.timeout)

File "/opt/anaconda3/lib/python3.7/smtplib.py" in _get_socket

  1. self.source_address)

File "/opt/anaconda3/lib/python3.7/socket.py" in create_connection

  1. raise err

File "/opt/anaconda3/lib/python3.7/socket.py" in create_connection

  1. sock.connect(sa)

Exception Type: ConnectionRefusedError at /accounts/signup/ Exception Value: [Errno 61] Connection refused

azmatsiddique commented 4 years ago

i fix the issue

azmatsiddique commented 4 years ago

actual code of developement of py

from .base import *

DEBUG = True ALLOWED_HOSTS = ['127.0.0.1']

INSTALLED_APPS += [ 'debug_toolbar' ]

MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware', ] EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

DEBUG TOOLBAR SETTINGS

DEBUG_TOOLBAR_PANELS = [ 'debug_toolbar.panels.versions.VersionsPanel', 'debug_toolbar.panels.timer.TimerPanel', 'debug_toolbar.panels.settings.SettingsPanel', 'debug_toolbar.panels.headers.HeadersPanel', 'debug_toolbar.panels.request.RequestPanel', 'debug_toolbar.panels.sql.SQLPanel', 'debug_toolbar.panels.staticfiles.StaticFilesPanel', 'debug_toolbar.panels.templates.TemplatesPanel', 'debug_toolbar.panels.cache.CachePanel', 'debug_toolbar.panels.signals.SignalsPanel', 'debug_toolbar.panels.logging.LoggingPanel', 'debug_toolbar.panels.redirects.RedirectsPanel', ]

def show_toolbar(request): return True

DEBUG_TOOLBAR_CONFIG = { 'INTERCEPT_REDIRECTS': False, 'SHOW_TOOLBAR_CALLBACK': show_toolbar }

DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } }

STRIPE_PUBLIC_KEY = config('STRIPE_TEST_PUBLIC_KEY') STRIPE_SECRET_KEY = config('STRIPE_TEST_SECRET_KEY')