0

I'm creating a Django application and I've compiled my own Python then used buildout to manage my dependencies.

I'm at the point where I want to run manage.py runserver but I can get an ImportError for django

Digging a little deeper it appears that actually it can find django - if I just run manage.py it lists all available commands (so obviously it imported django), but it appears that manage.py runserver calls manage.py again, and I guess this must be calling Python without the overloaded path that buildout provides.

So, how can I get manage.py runserver to work with my given setup? Other tutorials I see all say to use virtualenv but I've gone down the path of compiling my own Python so I'd like to stick with that. I've also seen similar questions but they seem to assume the use of system Python, which I am not using. Possibly Django should be installed into my compiled Python but I thought the point of buildout was to avoid the need to do that.

tschumann
  • 2,776
  • 3
  • 26
  • 42
  • what is the error message you get? – gefei Sep 16 '16 at 21:41
  • ImportError: no module named 'django' – tschumann Sep 16 '16 at 21:44
  • Possible duplicate of [Import Error: No module named django](http://stackoverflow.com/questions/9462212/import-error-no-module-named-django) – Jack Evans Sep 16 '16 at 21:49
  • @JackEvans I've updated the question - I've looked at a lot of other people with the same error message but they all seem to be using system Python, possibly with virtualenv whereas I've built my own Python. – tschumann Sep 16 '16 at 22:29

1 Answers1

0

So, I think I figured it out. I found a file called django-admin.py in my buildout's bin directory, which eventually led me to add a django section to my buildout.cfg (see https://pypi.python.org/pypi/djangorecipe for details).

This created a file called django in my buildout's bin directory, and now running bin/django runserver allows me to view my site locally.

tschumann
  • 2,776
  • 3
  • 26
  • 42