Django芹菜的错误,如何修复



好吧,我在另一个应用程序中对芹菜的设置相同,当我启动另一个应用程序时,他是工作,绝对工作,但是当我启动此功能时,没有,我安装了Everthyng,另一个,但没有什么,请帮助我!

如果您有一些想法,请让我知道)

这是完整的追溯

Traceback (most recent call last):
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombuutils__init__.py", line 423, in __call__
    return self.__value__
AttributeError: 'ChannelPromise' object has no attribute '__value__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombuconnection.py", line 449, in _ensured
    return fun(*args, **kwargs)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombumessaging.py", line 177, in _publish
    channel = self.channel
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombumessaging.py", line 194, in _get_channel
    channel = self._channel = channel()
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombuutils__init__.py", line 425, in __call__
    value = self.__value__ = self.__contract__()
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombumessaging.py", line 209, in <lambda>
    channel = ChannelPromise(lambda: connection.default_channel)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombuconnection.py", line 771, in default_channel
    self.connection
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombuconnection.py", line 756, in connection
    self._connection = self._establish_connection()
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombuconnection.py", line 711, in _establish_connection
    conn = self.transport.establish_connection()
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombutransportpyamqp.py", line 116, in establish_connection
    conn = self.Connection(**opts)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesamqpconnection.py", line 165, in __init__
    self.transport = self.Transport(host, connect_timeout, ssl)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesamqpconnection.py", line 186, in Transport
    return create_transport(host, connect_timeout, ssl)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesamqptransport.py", line 299, in create_transport
    return TCPTransport(host, connect_timeout)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesamqptransport.py", line 95, in __init__
    raise socket.error(last_err)
OSError: [WinError 10061]The connection is not established, because the destination computer rejected the connection request 
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesdjangocorehandlersexception.py", line 41, in inner
    response = get_response(request)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesdjangocorehandlersbase.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesdjangocorehandlersbase.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesdjangoutilsdecorators.py", line 149, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshopsrcaccountsdecorators.py", line 25, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshopsrcaccountsviews.py", line 41, in signup
    register_task.delay(username, password, email, get_secret_key)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesceleryapptask.py", line 453, in delay
    return self.apply_async(args, kwargs)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesceleryapptask.py", line 559, in apply_async
    **dict(self._get_exec_options(), **options)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesceleryappbase.py", line 353, in send_task
    reply_to=reply_to or self.oid, **options
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesceleryappamqp.py", line 305, in publish_task
    **kwargs
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombumessaging.py", line 172, in publish
    routing_key, mandatory, immediate, exchange, declare)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombuconnection.py", line 470, in _ensured
    interval_max)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombuconnection.py", line 382, in ensure_connection
    interval_start, interval_step, interval_max, callback)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombuutils__init__.py", line 246, in retry_over_time
    return fun(*args, **kwargs)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombuconnection.py", line 250, in connect
    return self.connection
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombuconnection.py", line 756, in connection
    self._connection = self._establish_connection()
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombuconnection.py", line 711, in _establish_connection
    conn = self.transport.establish_connection()
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packageskombutransportpyamqp.py", line 116, in establish_connection
    conn = self.Connection(**opts)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesamqpconnection.py", line 165, in __init__
    self.transport = self.Transport(host, connect_timeout, ssl)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesamqpconnection.py", line 186, in Transport
    return create_transport(host, connect_timeout, ssl)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesamqptransport.py", line 299, in create_transport
    return TCPTransport(host, connect_timeout)
  File "C:UsersP.A.N.D.E.M.I.CDesktopshoplibsite-packagesamqptransport.py", line 95, in __init__
    raise socket.error(last_err)
OSError: [WinError 10061] `The connection is not established, because the destination computer rejected the connection request` 

这是芹菜

from __future__ import absolute_import
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'src.settings')
from django.conf import settings
from celery import Celery
app = Celery('src')
# This reads, e.g., CELERY_ACCEPT_CONTENT = ['json'] from settings.py:
app.config_from_object('django.conf:settings')
# For autodiscover_tasks to work, you must define your tasks in a file called 'tasks.py'.
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
@app.task(bind=True)
def debug_task(self):
    print("Request: {0!r}".format(self.request))

这是设置

# CELERY STUFF
BROKER_URL                  = 'redis://127.0.0.1:6379'
CELERY_RESULT_BACKEND       = 'redis://127.0.0.1:6379'
CELERY_ACCEPT_CONTENT       = ['application/json']
CELERY_TASK_SERIALIZER      = 'json'
CELERY_RESULT_SERIALIZER    = 'json'
CELERY_TIMEZONE            = TIME_ZONE

这是视图

@csrf_protect
@check_recaptcha
def signup(request):
    if request.method == 'POST':
        form = RegistrationForm(request.POST)
        print(form)
        if form.is_valid() and request.recaptcha_is_valid:
            print(form.cleaned_data)
            email               = form.cleaned_data['email']
            username            = form.cleaned_data['username']
            password            = form.cleaned_data['password1']
            get_secret_key      = activation_key_generator(username)
            link                = "127.0.0.1:8000/accounts/activate/{0}".format(get_secret_key)
            html_message        = '<h3>Your username: <b>{0}</b> <br> <b>Your password:  <b>{1}</b></h3><br><h1>That to get full access to our services, go through link below!</h1> <br> <a href="{2}">Activate</a> need raw link? <br> {2}'.format(username, password, link)
            register_task.delay(username, password, email, get_secret_key)
            send_some_email_task.delay(email, username, html_message)
            return redirect('/accounts/register/verification')
    form = RegistrationForm(request.POST or None)
    context = {'form':form}
    return render(request, 'accounts/registration/signup.html', context)

您在使用Redis的评论中说,但是您的配置是兔子。使用Redis页面检查有关配置的更多信息。更具体地说,您的经纪URL应该是redis://:password@hostname:port/db_number,而不是AMQP。

相关内容

  • 没有找到相关文章

最新更新