I've been frequently encountering this problem. I'm on revision 5582 and using the development web server. Often, but not always, after I have some other error, my next request gets the error below, and I have to restart the server to get past it. I believe this happens after I run into a syntax error and fix it, but I'm not certain. I saw another post about this error which talked about old .pyc files being left in django_src, so I cleaned all those out. But the problem persists.
Is this a bug that I need to file a ticket on? ------- AttributeError at /reports/query/ 'module' object has no attribute 'urlpatterns' Request Method: GET Request URL: http://127.0.0.1:8000/reports/query/ Exception Type: AttributeError Exception Value: 'module' object has no attribute 'urlpatterns' Exception Location: /usr/lib/python2.3/site-packages/django/core/ urlresolvers.py in resolve, line 220 Python Executable: /usr/bin/python Python Version: 2.3.4 Traceback (innermost last) Switch to copy-and-paste view * /usr/lib/python2.3/site-packages/django/core/handlers/base.py in get_response 61. return response 62. 63. # Get urlconf from request object, if available. Otherwise use default. 64. urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF) 65. 66. resolver = urlresolvers.RegexURLResolver(r'^/', urlconf) 67. try: 68. callback, callback_args, callback_kwargs = resolver.resolve(request.path) ... 69. 70. # Apply view middleware 71. for middleware_method in self._view_middleware: 72. response = middleware_method(request, callback, callback_args, callback_kwargs) 73. if response: 74. return response ▶ Local vars Variable Value debug <module 'django.views.debug' from '/usr/lib/python2.3/site- packages/django/views/debug.pyc'> exceptions <module 'django.core.exceptions' from '/usr/lib/python2.3/site- packages/django/core/exceptions.pyc'> mail_admins <function mail_admins at 0xb6f94684> middleware_method <bound method AuthenticationMiddleware.process_request of <django.contrib.auth.middleware.AuthenticationMiddleware object at 0xb6fe438c>> request <WSGIRequest GET:<MultiValueDict: {}>, POST:<MultiValueDict: {}>, COOKIES:{'sessionid': '23110c2aeaa9a0e03387647021ab7f98'}, META: {'COLORTERM': 'gnome-terminal', 'CONTENT_LENGTH': '', 'CONTENT_TYPE': 'text/plain', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus- p15nJMfAVj', 'DESKTOP_STARTUP_ID': '', 'DISPLAY': 'unix:1000.0', 'DJANGO_SETTINGS_MODULE': 'mgn.settings', 'GATEWAY_INTERFACE': 'CGI/ 1.1', 'GNOME_DESKTOP_SESSION_ID': 'Default', 'GNOME_KEYRING_SOCKET': '/ tmp/keyring-PZpbwV/socket', 'GTK_RC_FILES': '/etc/gtk/gtkrc:/home/ steve/.gtkrc-1.2-gnome2', 'G_BROKEN_FILENAMES': '1', 'HISTSIZE': '1000', 'HOME': '/home/steve', 'HOSTNAME': 'mgn.localdomain', 'HTTP_ACCEPT': 'text/xml,application/xml,application/xhtml+xml,text/ html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'en- us,en;q=0.5', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'sessionid=23110c2aeaa9a0e03387647021ab7f98', 'HTTP_HOST': '127.0.0.1:8000', 'HTTP_KEEP_ALIVE': '300', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4', 'INPUTRC': '/etc/inputrc', 'KDEDIR': '/usr', 'LANG': 'en_US', 'LESSOPEN': '|/usr/bin/lesspipe.sh %s', 'LOGNAME': 'steve', 'LS_COLORS': 'no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:', 'MAIL': '/var/spool/mail/steve', 'NXSESSIONID': 'mgn.localdomain-1000-63445E5A17FFFAB05FB69FA37CD6FCA5', 'OLDPWD': '/ home/steve/django', 'PATH': '/usr/kerberos/bin:/usr/local/bin:/bin:/ usr/bin:/usr/X11R6/bin:/home/steve/bin', 'PATH_INFO': '/reports/ query/', 'PWD': '/home/steve/django/mgn', 'QUERY_STRING': '', 'REMOTE_ADDR': '127.0.0.1', 'REMOTE_HOST': '', 'REQUEST_METHOD': 'GET', 'RUN_MAIN': 'true', 'SCRIPT_NAME': '', 'SERVER_NAME': 'localhost.localdomain', 'SERVER_PORT': '8000', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.3.4', 'SESSION_MANAGER': 'local/mgn.localdomain:/tmp/.ICE-unix/11807', 'SHELL': '/bin/bash', 'SHLVL': '3', 'SSH_AGENT_PID': '11819', 'SSH_ASKPASS': '/usr/libexec/openssh/gnome-ssh-askpass', 'SSH_AUTH_SOCK': '/tmp/ssh-pYgtE11807/agent.11807', 'SSH_CLIENT': '::ffff:127.0.0.1 37967 22', 'SSH_CONNECTION': '::ffff:127.0.0.1 37967 ::ffff:127.0.0.1 22', 'TERM': 'xterm', 'TZ': 'America/Chicago', 'USER': 'steve', 'WINDOWID': '29360207', '_': './manage.py', 'wsgi.errors': <open file '<stderr>', mode 'w' at 0xb7f270a0>, 'wsgi.file_wrapper': <class 'django.core.servers.basehttp.FileWrapper'>, 'wsgi.input': <socket._fileobject object at 0xb6fe5924>, 'wsgi.multiprocess': False, 'wsgi.multithread': True, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}> resolver <django.core.urlresolvers.RegexURLResolver object at 0xb6fe426c> response None self <django.core.handlers.wsgi.WSGIHandler object at 0xb6fb84ac> settings <django.conf.LazySettings object at 0xb7c821ec> urlconf 'mgn.urls' urlresolvers <module 'django.core.urlresolvers' from '/usr/lib/python2.3/site- packages/django/core/urlresolvers.pyc'> * /usr/lib/python2.3/site-packages/django/core/urlresolvers.py in resolve 213. reverse_dict = property(_get_reverse_dict) 214. 215. def resolve(self, path): 216. tried = [] 217. match = self.regex.search(path) 218. if match: 219. new_path = path[match.end():] 220. for pattern in self.urlconf_module.urlpatterns: ... 221. try: 222. sub_match = pattern.resolve(new_path) 223. except Resolver404, e: 224. tried.extend([(pattern.regex.pattern + ' ' + t) for t in e.args[0]['tried']]) 225. else: 226. if sub_match: ▶ Local vars Variable Value match <_sre.SRE_Match object at 0xb6f51c60> new_path 'reports/query/' path '/reports/query/' self <django.core.urlresolvers.RegexURLResolver object at 0xb6fe426c> tried [] Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/django/core/handlers/base.py" in get_response 68. callback, callback_args, callback_kwargs = resolver.resolve(request.path) File "/usr/lib/python2.3/site-packages/django/core/urlresolvers.py" in resolve 220. for pattern in self.urlconf_module.urlpatterns: AttributeError at /reports/query/ 'module' object has no attribute 'urlpatterns' Request information GET No GET data POST No POST data COOKIES Variable Value sessionid '23110c2aeaa9a0e03387647021ab7f98' META Variable Value COLORTERM 'gnome-terminal' CONTENT_LENGTH '' CONTENT_TYPE 'text/plain' DBUS_SESSION_BUS_ADDRESS 'unix:abstract=/tmp/dbus-p15nJMfAVj' DESKTOP_STARTUP_ID '' DISPLAY 'unix:1000.0' DJANGO_SETTINGS_MODULE 'mgn.settings' GATEWAY_INTERFACE 'CGI/1.1' GNOME_DESKTOP_SESSION_ID 'Default' GNOME_KEYRING_SOCKET '/tmp/keyring-PZpbwV/socket' GTK_RC_FILES '/etc/gtk/gtkrc:/home/steve/.gtkrc-1.2-gnome2' G_BROKEN_FILENAMES '1' HISTSIZE '1000' HOME '/home/steve' HOSTNAME 'mgn.localdomain' HTTP_ACCEPT 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/ plain;q=0.8,image/png,*/*;q=0.5' HTTP_ACCEPT_CHARSET 'ISO-8859-1,utf-8;q=0.7,*;q=0.7' HTTP_ACCEPT_ENCODING 'gzip,deflate' HTTP_ACCEPT_LANGUAGE 'en-us,en;q=0.5' HTTP_CONNECTION 'keep-alive' HTTP_COOKIE 'sessionid=23110c2aeaa9a0e03387647021ab7f98' HTTP_HOST '127.0.0.1:8000' HTTP_KEEP_ALIVE '300' HTTP_USER_AGENT 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4' INPUTRC '/etc/inputrc' KDEDIR '/usr' LANG 'en_US' LESSOPEN '|/usr/bin/lesspipe.sh %s' LOGNAME 'steve' LS_COLORS 'no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:' MAIL '/var/spool/mail/steve' NXSESSIONID 'mgn.localdomain-1000-63445E5A17FFFAB05FB69FA37CD6FCA5' OLDPWD '/home/steve/django' PATH '/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/ steve/bin' PATH_INFO '/reports/query/' PWD '/home/steve/django/mgn' QUERY_STRING '' REMOTE_ADDR '127.0.0.1' REMOTE_HOST '' REQUEST_METHOD 'GET' RUN_MAIN 'true' SCRIPT_NAME '' SERVER_NAME 'localhost.localdomain' SERVER_PORT '8000' SERVER_PROTOCOL 'HTTP/1.1' SERVER_SOFTWARE 'WSGIServer/0.1 Python/2.3.4' SESSION_MANAGER 'local/mgn.localdomain:/tmp/.ICE-unix/11807' SHELL '/bin/bash' SHLVL '3' SSH_AGENT_PID '11819' SSH_ASKPASS '/usr/libexec/openssh/gnome-ssh-askpass' SSH_AUTH_SOCK '/tmp/ssh-pYgtE11807/agent.11807' SSH_CLIENT '::ffff:127.0.0.1 37967 22' SSH_CONNECTION '::ffff:127.0.0.1 37967 ::ffff:127.0.0.1 22' TERM 'xterm' TZ 'America/Chicago' USER 'steve' WINDOWID '29360207' _ './manage.py' wsgi.errors <open file '<stderr>', mode 'w' at 0xb7f270a0> wsgi.file_wrapper <class 'django.core.servers.basehttp.FileWrapper'> wsgi.input <socket._fileobject object at 0xb6fe5924> wsgi.multiprocess False wsgi.multithread True wsgi.run_once False wsgi.url_scheme 'http' wsgi.version (1, 0) Settings Using settings module mgn.settings Setting Value ABSOLUTE_URL_OVERRIDES {} ADMINS () ADMIN_FOR () ADMIN_MEDIA_PREFIX '/media/' ALLOWED_INCLUDE_ROOTS () APPEND_SLASH True AUTHENTICATION_BACKENDS ('django.contrib.auth.backends.ModelBackend',) BANNED_IPS () CACHE_BACKEND 'simple://' CACHE_MIDDLEWARE_KEY_PREFIX '' COMMENTS_ALLOW_PROFANITIES False COMMENTS_BANNED_USERS_GROUP None COMMENTS_FIRST_FEW 0 COMMENTS_MODERATORS_GROUP None COMMENTS_SKETCHY_USERS_GROUP None DATABASE_ENGINE 'postgresql_psycopg2' DATABASE_HOST '' DATABASE_NAME 'djmgn' DATABASE_OPTIONS {} DATABASE_PASSWORD '********************' DATABASE_PORT '' DATABASE_USER 'apache' DATETIME_FORMAT 'N j, Y, P' DATE_FORMAT 'N j, Y' DEBUG True DEFAULT_CHARSET 'utf-8' DEFAULT_CONTENT_TYPE 'text/html' DEFAULT_FROM_EMAIL '[EMAIL PROTECTED]' DISALLOWED_USER_AGENTS () EMAIL_HOST 'localhost' EMAIL_HOST_PASSWORD '********************' EMAIL_HOST_USER '' EMAIL_PORT 25 EMAIL_SUBJECT_PREFIX '[Django] ' EMAIL_USE_TLS False FIXTURE_DIRS () IGNORABLE_404_ENDS ('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico', '.php') IGNORABLE_404_STARTS ('/cgi-bin/', '/_vti_bin', '/_vti_inf') INSTALLED_APPS ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'mgn.reports'] INTERNAL_IPS () JING_PATH '/usr/bin/jing' LANGUAGES (('ar', 'Arabic'), ('bn', 'Bengali'), ('bg', 'Bulgarian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es_AR', 'Argentinean Spanish'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('gl', 'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ko', 'Korean'), ('kn', 'Kannada'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'), ('pt', 'Portugese'), ('pt-br', 'Brazilian'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('te', 'Telugu'), ('tr', 'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese')) LANGUAGES_BIDI ('he', 'ar') LANGUAGE_CODE 'en-us' LOGIN_REDIRECT_URL '/accounts/profile/' LOGIN_URL '/accounts/login/' LOGOUT_URL '/accounts/logout/' MANAGERS () MEDIA_ROOT '/home/steve/django/mgn/static' MEDIA_URL 'http://localhost/static' MIDDLEWARE_CLASSES ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.doc.XViewMiddleware') MONTH_DAY_FORMAT 'F j' PREPEND_WWW False PROFANITIES_LIST '********************' ROOT_URLCONF 'mgn.urls' SECRET_KEY '********************' SEND_BROKEN_LINK_EMAILS False SERVER_EMAIL '[EMAIL PROTECTED]' SESSION_COOKIE_AGE 1209600 SESSION_COOKIE_DOMAIN None SESSION_COOKIE_NAME 'sessionid' SESSION_COOKIE_SECURE False SESSION_EXPIRE_AT_BROWSER_CLOSE False SESSION_SAVE_EVERY_REQUEST False SETTINGS_MODULE 'mgn.settings' SITE_ID 1 TEMPLATE_CONTEXT_PROCESSORS ('django.core.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media') TEMPLATE_DEBUG True TEMPLATE_DIRS ('/home/steve/django/mgn/../mgn/reports/templates',) TEMPLATE_LOADERS ('django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source') TEMPLATE_STRING_IF_INVALID '' TEST_DATABASE_CHARSET None TEST_DATABASE_COLLATION None TEST_DATABASE_NAME None TEST_RUNNER 'django.test.simple.run_tests' TIME_FORMAT 'P' TIME_ZONE 'America/Chicago' TRANSACTIONS_MANAGED False URL_VALIDATOR_USER_AGENT 'Django/0.97-pre (http://www.djangoproject.com)' USE_ETAGS False USE_I18N True YEAR_MONTH_FORMAT 'F Y' You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 500 page. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---