Domanda

I want to build a django framework with mezzanine using python on my mac. from their site they have this simple steps to create a framework in your terminal.

# Install from PyPI
$ pip install mezzanine

# Create a project
$ mezzanine-project myproject
$ cd myproject

# Create a database
$ python manage.py createdb

# Run the web server
$ python manage.py runserver

when i try to run "$ python manage.py createdb" this command it throws me this error.

Traceback (most recent call last):
File "manage.py", line 28, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management

pip freeze gives me this for more info.

Django==1.6.2
Mezzanine==3.0.9
Pillow==2.3.1
South==0.8.4
bleach==1.4
filebrowser-safe==0.3.2
future==0.9.0
grappelli-safe==0.3.7
html5lib==0.999
oauthlib==0.6.1
pytz==2014.1.1
requests==2.2.1
requests-oauthlib==0.4.0
six==1.6.1
tzlocal==1.0
vboxapi==1.0
virtualenv==1.11.4
wsgiref==0.1.2
È stato utile?

Soluzione

You will have to set your path variables right. Python is not able to locate Django:

To verify, with the python shell try:

import django 
django.version

If you encounter the same problem, you will have to adjust $PATH variable.

Alternative to this would be using a virtual env.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top