将我的博客上传到pythonanywhere.com时出现问题

时间:2019-05-16 10:29:54

标签: python django deployment

我已将博客上传到pythonanywhere。在我的本地主机上一切正常,但是在pythonanywhere上一切都不正常。 我像在本地主机上一样配置了pythonanywhere,安装了所有内容(还安装了Tinymce),但是我收到此错误消息:

std::string const& get_string(std::string const& p) {
  return p;
}

std::string const& v = 
get_string(std::string{"Hello"});

我已经用pip3 install django-tinymce --user安装了Tinymce,就像我在本地主机上一样。 无法弄清楚正在发生什么。

如果我转到.virtualenvs并尝试安装它,则它说:

 2019-05-16 12:24:14,263: Error running WSGI application
2019-05-16 12:24:14,264: ImportError: No module named 'tinymce'
2019-05-16 12:24:14,264:   File "/var/www/urosdobricic_pythonanywhere_com_wsgi.py", line 15, in <module>
2019-05-16 12:24:14,264:     application = get_wsgi_application()
2019-05-16 12:24:14,264: 
2019-05-16 12:24:14,265:   File "/home/UrosDobricic/.virtualenvs/urosdobricic.pythonanywhere.com/lib/python3.5/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2019-05-16 12:24:14,265:     django.setup(set_prefix=False)
2019-05-16 12:24:14,265: 
2019-05-16 12:24:14,265:   File "/home/UrosDobricic/.virtualenvs/urosdobricic.pythonanywhere.com/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
2019-05-16 12:24:14,265:     apps.populate(settings.INSTALLED_APPS)
2019-05-16 12:24:14,266: 
2019-05-16 12:24:14,266:   File "/home/UrosDobricic/.virtualenvs/urosdobricic.pythonanywhere.com/lib/python3.5/site-packages/django/apps/registry.py", line 91, in populate
2019-05-16 12:24:14,266:     app_config = AppConfig.create(entry)
2019-05-16 12:24:14,266: 
2019-05-16 12:24:14,266:   File "/home/UrosDobricic/.virtualenvs/urosdobricic.pythonanywhere.com/lib/python3.5/site-packages/django/apps/config.py", line 90, in create
2019-05-16 12:24:14,266:     module = import_module(entry)

所以一切都安装正确了。

1 个答案:

答案 0 :(得分:4)

cd进入~/.virtualenvs目录不会更改软件包的安装位置。

使用Web应用程序页面上的链接打开激活了virtualenv的控制台,并且在安装时不要使用--user选项。