“unexpected indent” error when using notepad++ for creating django function
问题 I am following this book to learn django using notepad++, something interesting happens, when I type the function using notepad++ for the following script: def current_datetime(request): now = datetime.datetime.now() html = "<html><body>It is now %s.</body></html>" % now return HttpResponse(html) It gives me an error like this: IndentationError at /time/ ('unexpected indent', ('M:\\DjangoStack\\projects\\beta_01\\..\\beta_01\\hello_world\\views.py', 12, 1, '\thtml = "<html>"\n')) But when I