我正在用 django 制作一个 webapp。我尝试将它部署在 pythonanywhere 上,一切正常,但最后当我尝试使用python manage.py collectstatic它收集静态文件时,出现了以下错误:
return database_name == ':memory:' or 'mode=memory' in database_name
TypeError: argument of type 'PosixPath' is not iterable
Run Code Online (Sandbox Code Playgroud)
提出一些想法,我该如何解决它。
这是我的 setting.py 文件
import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '!25%rdt-$_$bsc*fl)e7x2*x6awjca^3_2t-k@l0tu*8k!f33&'
# SECURITY WARNING: don't run …Run Code Online (Sandbox Code Playgroud) 我使用 anaconda 提示符创建了环境,conda create -n talkingbot python=3.5然后安装pip install tensorflow==1.0.0(遵循与一个 udemy 课程中使用的命令相同的命令)但是当我尝试使用conda install spyderthen安装 spyder 时,它给了我这个错误:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
ERROR conda.core.link:_execute(698): An error occurred while installing package 'defaults::icu-58.2-ha925a31_3'.
Rolling back transaction: done
[Errno 13] Permission denied: 'C:\\Users\\Lenovo\\anaconda3\\envs\\talkingbot\\Library\\bin\\icudt58.dll'
()
Run Code Online (Sandbox Code Playgroud)
然后我尝试使用 anaconda navigator 安装 spyder,但从那里也没有安装 spyder。
帮我解决这个问题。
python machine-learning chatbot anaconda recurrent-neural-network
我已经花了好几天的时间来解决这个问题,但我无法解决这个问题,可能是因为缺乏 html2canva 的知识,或者它不想被修复。我唯一想要的是将我的 pdf 放在 a4 大小的单页上,但它总是呈现在两页上。不知道我哪里错了。请提出建议。
\n这是我的代码:
\ndocument.querySelector(\'#temp\').contentEditable = true;\n\nfunction createpdf() {\n let body = document.body\n let html = document.documentElement\n let height = Math.max(body.scrollHeight, body.offsetHeight,\n html.clientHeight, html.scrollHeight, html.offsetHeight)\n let element = document.querySelector(\'#temp\')\n let heightCM = height / 35.35\n html2pdf(element, {\n margin: 1,\n filename: \'MyResume.pdf\',\n image: {\n type: \'jpeg\',\n quality: 4\n },\n html2canvas: {\n dpi: 400,\n letterRendering: true,\n scale: 3\n },\n jsPDF: {\n orientation: \'portrait\',\n unit: \'cm\',\n // format: [heightCM, 50]\n format: \'a4\'\n\n }\n }).save()\n}Run Code Online (Sandbox Code Playgroud)\r\n …python ×2
anaconda ×1
chatbot ×1
css ×1
django ×1
html ×1
html-to-pdf ×1
html2canvas ×1
javascript ×1