I tried writing hello world program in django, but I did not get the expected result. Please help - 2nd day stuck here. My version of Python is 2.7. Django 1.6.2
Directory List:
- Mysite
- manage.py
- Mysite
- init.py
- _init.pyc
- settings.py
- settings.pyc
- urls.py
- urls.pyc
- wsgi.py
- wsgi.pyc
- views.py
1. Code in the views file
from django.http import HttpResponse
def hello(request):
return HttpResponse("hello world")
2. Code in urls file
from django.conf.urls import patterns, include, url
from mysite.views import hello
url(r'^$', 'mysite.views.hello’, name=‘hello’)
)
SyntaxError on "":
Exception value:
Non-ASCII character '\ xe2' in the file / Users / ** /**/djcode/mysite/mysite/urls.py on line 16, but no encoding is declared; see http://www.python.org/peps/pep-0263.html for more information (urls.py, line 16) [note: an asterisk is used to hide the path above]