How to reference to a Method inside a Class in urls.py <p>I have this <code>views.py</code></p> <pre><code>from django.shortcuts import render from forms import ReferenceTableForm class ReferenceTable(object): def createReferenceTable(request): form = ReferenceTableForm() return render(request, "DataImport/createReferenceTable.html", {'form': form}) </code></pre> <p>And this is my <code>urls.py</code></p> <pre><code>from django.conf.urls import patterns, include, url import views urlpatterns = patterns('', url(r'^$', views.createReferenceTable), ) </code></pre> <p>But when I go to my url, <code>http://localhost:8000/create_reference_table/</code> (I am using a different <code>urls.py</code> for each app), I get this error:</p> <pre><code>'module' object has no attribute 'createReferenceTable' </code></pre> <p>If I move the method <code>createReferenceTable</code> to out of the class, it works fine.</p> <p>I think it is because as I am calling a method that is inside a class it is expecting it to be called from an instance of this class, but as I am not very experienced, I really don't know how to sort it out (either if it is the problem or not).</p> <p>Could someone explain what is going on and how I can solve it and prevent from happening next time?</p> <p>Thanks in advance!</p>