title: Django Invalid Syntax error def index(request)
body: <pre><code>File "/home/david/Django-Development/csruipa/ruth/urls.py", line 3, in &lt;module&gt;
      from ruth import views
  File "/home/david/Django-Development/csruipa/ruth/views.py", line 4
      def index(request)
                       ^
  SyntaxError: invalid syntax enter code here
  </code></pre>
  
  <p>this is my urls.py</p>
  
  <pre><code>from django.conf.urls import url
  
  from ruth import views
  
  urlpatterns = [
      url(r'^$', views.index, name="index"),
  ]
  </code></pre>
  
  <p>and this is the view.py</p>
  
  <pre><code>from django.shortcuts import render
  from django.http import HttpResponse
  
  def index(request)
      return HttpResponse("Hello World")
  </code></pre>
  
  <p>this is the main urls.py</p>
  
  <pre><code>from django.conf.urls import include, url
  
  from django.contrib import admin
  
  urlpatterns = [
     url(r'^ruth/', include('ruth.urls')),
     url(r'^admin/', admin.site.urls),
  ]
  </code></pre>
  
  <p>I'm following django tutorial here 
  <a href="https://docs.djangoproject.com/en/1.11/intro/tutorial01/" rel="nofollow noreferrer">https://docs.djangoproject.com/en/1.11/intro/tutorial01/</a></p>
  
  <p>my error said it's on line 4 this line <code>def index(request)</code>
  and on urls.py on line 3 which is this <code>from ruth import views</code>
  on the main urls.py line 6 was the error which is this <code>url(r'^ruth/', include('ruth.urls')),</code> line
  I'm new to python, I need some help thanks.</p>