在PythonAnywhere上部署Django应用程序

时间:2016-05-10 11:21:02

标签: python django web-deployment pythonanywhere

我是Django的新手,我做了一个应用程序。以下是github存储库的链接:https://github.com/akashmalla07/spring。我按照此http://tutorial.djangogirls.org/en/deploy/来部署我的代码,并在运行python manage.py migrate时收到此错误

ImportError: No module named 'django_nose' 

我在本地计算机上进行开发时没有遇到此问题,但我在PythonAnywhere上遇到此问题。请帮我。提前致谢

编辑    在你的解决方案之后我得到了这个错误

  File "/tmp/pip-build-_l_qs3mn/wsgiref/setup.py", line 5, in <module>
    import ez_setup
  File "/tmp/pip-build-_l_qs3mn/wsgiref/ez_setup/__init__.py", line 170
    print "Setuptools version",version,"or greater has been installed."
                             ^
SyntaxError: Missing parentheses in call to 'print'

----------------------------------------
 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-
 build-_l_qs3mn/wsgiref/

我已经提到了其他stackoverflow解决方案,即

  pip install --upgrade setuptools 

但对我没有用。

1 个答案:

答案 0 :(得分:3)

看起来你的项目需要一些额外的模块 - 在requirements.txt中你有这个:

Django==1.8.3
django-nose==1.4.1
nose==1.3.7
requests==2.7.0
wsgiref==0.1.2

您所遵循的教程仅提供有关如何安装其演示应用程序所需模块的说明,这些只是Django。所以你也需要安装额外的模块。

为此,在安装了django的Bash控制台中,您需要运行以下命令:

pip install -r /home/yourpythonanywhereusername/spring/requirements.txt

不要忘记用您实际的PythonAnywhere用户名替换yourpythonanywhereusername

相关问题