Mickey Cheong
Mickey Cheong

Reputation: 3010

django collectstatic output no module error

I'm trying to run this command

sudo python manage.py collectstatic

This error appears:

Error: No module named cities

So I did a check:

prompt> python
Python 2.6....
>>>> import cities
>>>> cities
<module 'cities' from '/sites/.virtualenvs/myproject/src/django-cities/cities/__init__.pyc'>

Then it seems like I have the cities module there, but it gives me an error. Any pointers on how I can solve this? It works on my development machine (mac). I'm trying to deploy on my EC2 (running on ubuntu)

Thanks for all the help in advance.

Cheers, Mickey

Upvotes: 5

Views: 2695

Answers (1)

Jeffrey Bauer
Jeffrey Bauer

Reputation: 14080

Try running the python interpreter specific to your virtualenv:

sudo /sites/.virtualenvs/myproject/bin/python manage.py collectstatic

This assumes you need to run the server with sudo. A better way would be to run it under user space and proxy it via apache/mod_wsgi or nginx.

Upvotes: 2

Related Questions