TypeError at /myapp/hello/ hello() takes exactly 2 arguments (1 given)
<p>ecomstore/settings.py</p>

<pre><code>INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'uploader',
    'myapp',
)
</code></pre>

<p>ecomstore/urls.py</p>

<pre><code>from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'ecomstore.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
    url(r'^catalog/$', 'ecomstore.views.catalog'),
    url(r'^myapp/', include(myapp.urls)),
    url(r'^upload/$', 'uploader.views.home', name = 'imageupload'),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
</code></pre>

<p>myapp/urls.py</p>

<pre><code>from django.conf.urls import patterns, include, url

urlpatterns = patterns('',
    url(r'^hello/', 'myapp.views.hello', name = 'hello'),
)
</code></pre>

<p>myapp/views.py</p>

<pre><code>from django.shortcuts import render
from django.http import HttpResponse

# Create your views here.

def hello(request, number):
    text = "&lt;h1&gt;welcome to my app number %s!&lt;/h1&gt;"% number
    return render(request, "myapp/template/hello.html", {})
    return HttpResponse(text)
</code></pre>

<p>after changing url(r'^myapp/', include('myapp.urls') when i put in url localhost:8000/myapp/hello/ it's throwing TypeError at /myapp/hello/</p>

<p><em>hello() takes exactly 2 arguments (1 given)</em></p>

<p>please guide me </p>

<p>Thanks.</p>

<p>You're missing quotes it should be:</p>

<pre><code>include('myapp.urls')
</code></pre>

<p>That or import myapp (which is not imported on your urls.py)</p>

python django