No module named django.core.management
If you're following django's
tutorial, and got stuck here.
$ python manage.py startapp polls
Traceback (most recent call last):
File "manage.py", line 2, in <module>
from django.core.management import execute_manager
ImportError: No module named django.core.management
do
port contents py25-django
and you'll see django is installed in "/opt/local/lib/python2.5/site-packages/django". so just link it to osX's python's folder.
cd /Library/Python/2.5/site-packages
ln -s /opt/local/lib/python2.5/site-packages/django django
name 'admin' is not defined
In tutorial page 2, after you setup admin site, I get "name 'admin' is not defined" then a stacktrace.
add line
from django.contrib import admin to the urls.py. so the file looks like below:
from django.conf.urls.defaults import *
from django.contrib import admin
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^django01/', include('django01.foo.urls')),
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
)