L
L
Les Alterman2015-12-17 18:13:39
Django
Les Alterman, 2015-12-17 18:13:39

How to fix redirect error in Django 1.9?

An error occurs while redirecting:

Could not import 'product.urls'. View is not callable.

The code of the urls.py file of the project itself
from django.conf.urls import patterns, url, include
from django.contrib import admin
from tovary import urls
admin.autodiscover()

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^category/', 'tovary.urls'),
]

From this file should go to the urls.py of the tovary application
The code of the urls.py file of the tovary application:
from django.conf.urls import url,patterns
from tovary import views
urlpatterns = [
    url(r'^1/', 'tovary.views.page1')
]

How to fix the error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2015-12-17
@Les_Alterman

https://docs.djangoproject.com/en/1.9/topics/http/...

url(r'^community/', include('django_website.aggregator.urls')),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question