When I am hitting http://127.0.0.1:8000/segment_address but I am getting 404 error:
当我点击http://127.0.0.1:8000/segment_address但我收到404错误:
This is my urls.py
这是我的urls.py
from addFixAPI import views
router = routers.DefaultRouter()
router.register(r'segment_address', views.search_addresses,base_name='segment_address')
urlpatterns = patterns('',
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^locality/', include('locality.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^django-rq/', include('django_rq.urls')),
)
1 个解决方案
#1
1
First you should check that "app" has registered its "urls" in the main "urls" project.
首先,您应该检查“app”是否在主“urls”项目中注册了其“urls”。
It is obvious but I dont see that you include the line
很明显,但我没有看到你包括这条线
from django.conf.urls import url, include from rest_framework import routers
来自django.conf.urls导入url,包含来自rest_framework导入路由器
#1
1
First you should check that "app" has registered its "urls" in the main "urls" project.
首先,您应该检查“app”是否在主“urls”项目中注册了其“urls”。
It is obvious but I dont see that you include the line
很明显,但我没有看到你包括这条线
from django.conf.urls import url, include from rest_framework import routers
来自django.conf.urls导入url,包含来自rest_framework导入路由器