Django + Virtualenv: manage.py Commands Not Working with ImportError Project Name

It inflates my mind because it is probably a simple solution, but I cannot figure out what could be causing this.

So, I have a new dev box, and I'm setting everything up. I installed virtualenv, created a new environment for my project under~/.virtualenvs/projectname

Then I cloned my project from github to my projects directory. Nothing special here. There are no files .pycsitting around, so this is a clean list of code.

Then I activated my virtualenv and installed Django via pip. So far so good.

Then I run python manage.py syncdbdir inside my project. Here I am confused:

 ImportError: No module named projectname

So, I realized that I might have had references to the project name in my code. That way I grep (actually) through my code base, and I did not find anything like it.

So now I'm at a loss, given this environment, why am I getting an ImportError in a module with a name projectnamethat is not mentioned anywhere in my code?

I look forward to a decision .. thanks guys!

+3
source share
1 answer

Is the project name exactly (modulo suffix) the name of the directory in which the project is located? Wild hunch, but I know that Django does some things with the current directory ...

, ? ? , py manage.py --traceback syncdb , .

+1

Source: https://habr.com/ru/post/1736529/


All Articles