Search code examples
djangopythonanywhere

django_comments site package missing templates?


I am moving a website from my local dev machine to PA. I'm getting a template not found error. After a bit of searching, it appears that it is not finding the django_comments form.html template in the templates directory. Presumably, because of this, collectstatic isn't creating the static file to serve. Looking at the install on my dev machine, there is a template directory in the site-package but not in the package on PA. I notice that my django.contrib_comments distro is 1.9.0 while it is 1.8.0 on PA. (artifact of my venv creation?)

My question is "am I missing something". I can certainly get around the problem by including the templates in my own directory, but for obvious reasons, I'd rather not.

Suggestions? (if I run pip install, I'm getting a unicode not defined error)

Thx, --Don


Solution

  • You need to make sure that the versions for all your packages (python.contrib_comments or otherwise) are the same locally vs on PA.

    One way to do this by doing a pip freeze > requirements.txt locally, then upload the requirements.txt onto PythonAnywhere, set up a virtualenv on PythonAnywhere, and pip install -r requirements.txt to get the correct version of all the packages. Then configure your PythonAnywhere webapp to use that virtualenv on your webapp dashboard.