I am learning from djangobook.com using the 2edition online ver. I am doing my first view
from django.http import HttpResponse def hello(request): return HttpResponse("Hello world") -------------------------------------------------------------- and this is my urls.py file: from django.conf.urls.defaults import * from mysite.views import hello urlpatterns = patterns('', ('^hello/$', hello), ) ------------------------------------------------------------ sorry for the long error post but when I run this views.py on both my desktop and laptop OS windows XP SP2 & 3, I get this error: Traceback (most recent call last): File "C:\Python26\lib\site-packages\django\core\servers \basehttp.py", line 279, in run self.result = application(self.environ, self.start_response) File "C:\Python26\lib\site-packages\django\core\servers \basehttp.py", line 651, in __call__ return self.application(environ, start_response) File "C:\Python26\lib\site-packages\django\core\handlers\wsgi.py", line 241, in __call__ response = self.get_response(request) File "C:\Python26\lib\site-packages\django\core\handlers\base.py", line 73, in get_response response = middleware_method(request) File "C:\Python26\lib\site-packages\django\middleware\common.py", line 56, in process_request if (not _is_valid_path(request.path_info) and File "C:\Python26\lib\site-packages\django\middleware\common.py", line 142, in _is_valid_path urlresolvers.resolve(path) File "C:\Python26\lib\site-packages\django\core\urlresolvers.py", line 294, in resolve return get_resolver(urlconf).resolve(path) File "C:\Python26\lib\site-packages\django\core\urlresolvers.py", line 216, in resolve for pattern in self.url_patterns: File "C:\Python26\lib\site-packages\django\core\urlresolvers.py", line 245, in _get_url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "C:\Python26\lib\site-packages\django\core\urlresolvers.py", line 240, in _get_urlconf_module self._urlconf_module = import_module(self.urlconf_name) File "C:\Python26\lib\site-packages\django\utils\importlib.py", line 35, in import_module __import__(name) File "C:\djproj\mysite\..\mysite\urls.py", line 2, in <module> from mysite.views import hello File "C:\djproj\mysite\..\mysite\views.py", line 1 {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss \fcharset0 Arial;}} ^ SyntaxError: unexpected character after line continuation character I uninstalled and reinstalled my python and django. I am following every detail of the tutorial. I don't understand why I keep getting this error. I appreciate your help. --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---