#3860: AttributeError: 'module' object has no attribute 'myapp'
---------------------------+------------------------------------------------
   Reporter:  Vinay Sajip  |                Owner:  adrian      
     Status:  reopened     |            Component:  Contrib apps
    Version:  SVN          |           Resolution:              
   Keywords:               |                Stage:  Unreviewed  
  Has_patch:  0            |           Needs_docs:  0           
Needs_tests:  0            |   Needs_better_patch:  0           
---------------------------+------------------------------------------------
Changes (by Vinay Sajip <[EMAIL PROTECTED]>):

  * status:  closed => reopened
  * resolution:  invalid =>

Comment:

 I replicated this as follows just after doing an '''svn update''' to get
 the latest files from the repository.
 
 Ran '''django-admin.py startproject mysite'''.
 From the mysite directory, ran '''./manage.py startapp myapp'''.
 
 Changed '''settings.py''' as per the following '''diffsettings''' output:
 {{{
 [EMAIL PROTECTED]:~/projects/mysite$ ./manage.py diffsettings
 DATABASE_ENGINE = 'sqlite3'
 DATABASE_NAME = '/home/vinay/projects/mysite.db'
 DEBUG = True
 INSTALLED_APPS = ['django.contrib.auth', 'django.contrib.contenttypes',
 'django.contrib.sessions', 'django.contrib.sites', 'mysite.myapp']
 LANGUAGE_CODE = 'en-gb'
 MIDDLEWARE_CLASSES = ('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware')
 ROOT_URLCONF = 'mysite.urls'  ###
 SECRET_KEY = 'u_wf!1^!3y7iz!)=3cs8-=clsg^#g&2y16cavha2!fca3macrw'
 SETTINGS_MODULE = 'mysite.settings'  ###
 SITE_ID = 1  ###
 TEMPLATE_DEBUG = True
 TIME_ZONE = 'Europe/London'
 }}}
 
 I then modified '''{{{myapp/__init__.py}}}''' to add the following lines:
 
 {{{
 import django.contrib.auth
 print django.contrib.auth
 #import django.contrib.auth.models
 }}}
 
 and ran diffsettings again:
 
 {{{
 [EMAIL PROTECTED]:~/projects/mysite$ ./manage.py diffsettings
 <module 'django.contrib.auth' from '/usr/lib/python2.4/site-
 packages/django/contrib/auth/__init__.pyc'>
 DATABASE_ENGINE = 'sqlite3'
 DATABASE_NAME = '/home/vinay/projects/mysite.db'
 DEBUG = True
 INSTALLED_APPS = ['django.contrib.auth', 'django.contrib.contenttypes',
 'django.contrib.sessions', 'django.contrib.sites', 'mysite.myapp']
 LANGUAGE_CODE = 'en-gb'
 MIDDLEWARE_CLASSES = ('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware')
 ROOT_URLCONF = 'mysite.urls'  ###
 SECRET_KEY = 'u_wf!1^!3y7iz!)=3cs8-=clsg^#g&2y16cavha2!fca3macrw'
 SETTINGS_MODULE = 'mysite.settings'  ###
 SITE_ID = 1  ###
 TEMPLATE_DEBUG = True
 TIME_ZONE = 'Europe/London'
 }}}
 
 Notice that this produced the same output, with the additional print of
 the django.contrib.auth module at the top.
 
 Now, removing the comment from the last line of {{{myapp/__init.py___}}}
 and running '''diffsettings''' again produces the error.
 
 I'll reopen the ticket this once, and if you close it again I'll take
 things up again on django-users; hope that's OK with you. However, I don't
 see that it's a problem with myapp or configuration, since I followed the
 steps in the tutorial.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/3860#comment:3>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to