Link to home
Start Free TrialLog in
Avatar of xoxomos
xoxomos

asked on

Python No Modules Named Defaults

Still trying to follow the example:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/OOW11/python_django/python_django.htm
I get to step 17 then more problems:

ImportError at /admin/
No module named defaults
Request Method:       GET
Request URL:       http://localhost:8000/admin/
Django Version:       1.8.5
Exception Type:       ImportError
Exception Value:       

No module named defaults

Exception Location:       /Users/ctaylor/mysite/mysite/urls.py in <module>, line 1
Python Executable:       /usr/bin/python
Python Version:       2.7.10
Python Path:       

urls.py module after edit:
A206394:mysite ctaylor$ cat urls.py
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(r'^mysite/', include('mysite.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)),
)



urls.py before edit:



['/Users/ctaylor/mysite',
 '/Library/Python/2.7/site-packages/web.py-0.37-py2.7.egg',
 '/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',



Any idea how i messed up on the editing?
Avatar of Mark Brady
Mark Brady
Flag of United States of America image

It is missing the admin class from django.contrib
Try going to the django file (module and search for contrib then look for admin. It may be a corrupt file in which case you would need to re-install it or it could be commented out perhaps. Anyway, just my 2 cents worth.
Avatar of xoxomos
xoxomos

ASKER

Does this have anything to do with what i'm looking for?

A206394:admin ctaylor$ pwd
/Users/ctaylor/Django-1.3.7/django/contrib/admin
A206394:admin ctaylor$ ls -ltr
total 352
-rw-r--r--@  1 ctaylor  staff  12061 Feb 20  2013 widgets.py
-rw-r--r--@  1 ctaylor  staff  19088 Feb 20  2013 validation.py
-rw-r--r--@  1 ctaylor  staff  12852 Feb 20  2013 util.py
-rw-r--r--@  1 ctaylor  staff  17393 Feb 20  2013 sites.py
-rw-r--r--@  1 ctaylor  staff  58288 Feb 20  2013 options.py
-rw-r--r--@  1 ctaylor  staff   2207 Feb 20  2013 models.py
-rw-r--r--@  1 ctaylor  staff  13361 Feb 20  2013 helpers.py
-rw-r--r--@  1 ctaylor  staff   1914 Feb 20  2013 forms.py
-rw-r--r--@  1 ctaylor  staff  12482 Feb 20  2013 filterspecs.py
-rw-r--r--@  1 ctaylor  staff   3285 Feb 20  2013 actions.py
-rw-r--r--@  1 ctaylor  staff   1608 Feb 20  2013 __init__.py
drwxr-xr-x@  4 ctaylor  staff    136 Feb 20  2013 templates
drwxr-xr-x@  5 ctaylor  staff    170 Feb 20  2013 media
drwxr-xr-x@ 68 ctaylor  staff   2312 Feb 20  2013 locale
drwxr-xr-x@  5 ctaylor  staff    170 Feb 20  2013 views
drwxr-xr-x@  7 ctaylor  staff    238 Feb 20  2013 templatetags
A206394:admin ctaylor$
Yikes I don't know what that is sorry.
Avatar of xoxomos

ASKER

OK Thanks.  I'll be going to OOW next week so it's possible someone there knows who prepared that tutorial.
awesome. Sorry I couldn't help further.
ASKER CERTIFIED SOLUTION
Avatar of xoxomos
xoxomos

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of xoxomos

ASKER

Simply deleting would be acceptable also.  Just did it this way to show what my solution was.