我一直收到此错误,我也不知道为什么。我在Windows 10上使用Ubuntu,而celery可以正常工作。然后发生了什么,我不断收到此错误。我使用芹菜文档学习。
这是task.py:
from celery import Celery
app = Celery('tasks', broker='pyamqp://guest@localhost//')
@app.task
def add(x, y):
return x + y
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
[2017-08-14 17:34:04,436: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 92] Protocol not available.
Trying again in 2.00 seconds...
[2017-08-14 17:34:06,453: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 92] Protocol not available.
Trying again in 4.00 seconds...
[2017-08-14 17:34:10,465: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 92] Protocol not available.
Trying again in 6.00 seconds...
[2017-08-14 17:34:16,480: ERROR/MainProcess] consumer: Cannot connect …Run Code Online (Sandbox Code Playgroud) 我想制作一个应用程序,它接受 excel 文件并读取其内容,而不使用表单和模型。
我不断收到标题中的错误,我想知道错误是什么。
这是我的 HTML:
<div style="width: 800px; margin: 0 auto;">
<form enctype="multipart/form-data" action="." method='POST'> {% csrf_token %}
<input type="file" name="excelfile">
<input type="submit" value="Submit" />
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
这是我的观点:
def uploadexcelfile(request):
if request.method == "POST":
excel = request.FILE['excelfile'].read()
print('Opening workbook...')
wb = openpyxl.load_workbook(excel)
activesheet = wb.active
print(activesheet.title)
sheet = wb.get_sheet_by_name(activesheet.title)
print('Reading rows...')
for row in range(1, sheet.max_row + 1):
url = sheet['A' + str(row)].value
print(url)
else:
return render(request, 'uploadexcelfile.html')
Run Code Online (Sandbox Code Playgroud) 我想在邮递员中给出一个字符串列表,例如:
['字符串1','字符串2','字符串3','字符串4','字符串5']
但是当它到达serializer.is_valid()时它给了我:
"non_field_errors": [
"Invalid data. Expected a dictionary, but got str."
]
Run Code Online (Sandbox Code Playgroud)
这是我的序列化器:
class URLRequestedSerializer(serializers.Serializer):
urls = serializers.ListField(child=serializers.CharField())
Run Code Online (Sandbox Code Playgroud)
如何使序列化器排除字符串列表?
它表示它已被弃用,并将在未来删除.另一行说"请使用tensorflow/transform或tf.data.".我搜索了互联网,但我找不到答案.这是给我警告的线:
# Change texts into numeric vectors
vocab_processor = tf.contrib.learn.preprocessing.VocabularyProcessor(max_sequence_length,min_frequency=min_word_frequency)
Run Code Online (Sandbox Code Playgroud)