from django.conf import settings urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', IndexView.as_view(), name='index'), #정규식, 얘들이 정규식을 읽고 필요한 파일을 불러옴. url(r'^django$', DjangoView.as_view(), name='djangoIndex'), url(r'^accounts/register/$', UserCreateView.as_view(), name='register'), url(r'^accounts/register_done/$', UserCreateDoneTV.as_view(), name='register_done'), url(r'^accounts/', include('django.contrib.auth.urls')), url(r'^bookmark/$', BookmarkLV.as_view(), name='bookmark_index'), url(r'^bookmark/(?P<pk>\d+)/$', BookmarkDV.as_view(), name='detail'), url(r'^bookmark/add/$', BookmarkCV.as_view(), name='bookmark_create'), url(r'^bookmark/update/(?P<pk>[0-9]+)$', BookmarkUV.as_view(), name='bookmark_update'), url(r'^bookmark/delete/(?P<pk>[0-9]+)$', BookmarkRV.as_view(), name='bookmark_delete'), url(r'^youtube$', BookmarkLV.as_view(), name='youtube_index'), url(r'^youtube/(?P<pk>\d+)/$', YoutubeDV.as_view(), name='youtube_detail'), url(r'^blog/$', PostLV.as_view(), name='blog_index'), url(r'^blog/(?P<pk>\d+)/$', PostDV.as_view(), name='blog_detail'), #<pk> = primary_key url(r'^blog/add$', PostCV.as_view(), name='blog_create'), url(r'^blog/update/(?P<pk>[0-9]+)$', PostUV.as_view(), name='blog_update'), url(r'^blog/delete/(?P<pk>[0-9]+)$', PostRV.as_view(), name='blog_delete'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from blog.views import PostLV, PostDV, PostCV, PostUV, PostRV from django.conf.urls.static import static from django.conf import settings urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', IndexView.as_view(), name='index'), url(r'^about/$', aboutView.as_view(), name='about'), url(r'accounts/', include('django.contrib.auth.urls')), url(r'^accounts/register/$', UserCreateView.as_view(), name='register'), url(r'^accounts/register/done/$', UserCreateDoneTV.as_view(), name='register_done'), url(r'^bookmark/$', BookmarkLV.as_view(), name='bookmark_index'), url(r'^bookmark/(?P<pk>\d+)/$', BookmarkDV.as_view(), name='detail'), url(r'^blog/$', PostLV.as_view(), name='blog_index'), url(r'^blog/(?P<pk>\d+)/$', PostDV.as_view(), name='blog_detail'), url(r'^bookmark/add/$', BookmarkCV.as_view(), name='bookmark_create'), url(r'^bookmark/update/(?P<pk>[0-9]+)/$', BookmarkUV.as_view(), name='bookmark_update'), url(r'^bookmark/delete/(?P<pk>[0-9]+)/$', BookmarkRV.as_view(), name='bookmark_delete'), url(r'^blog/add/$', PostCV.as_view(), name='post_create'), url(r'^blog/update/(?P<pk>[0-9]+)/$', PostUV.as_view(), name='post_update'), url(r'^blog/delete/(?P<pk>[0-9]+)/$', PostRV.as_view(), name='post_delete') ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
""" from django.contrib import admin from django.urls import path, include from MY_HOME.views import IndexView, AboutView, UserCreateView, UserCreateDoneTV, CreateView from bookmark.views import BookmarkDV, BookmarkLV, BookmarkCV, BookmarkUV, BookmarkRV from blog.views import PostLV, PostCV, PostDV, PostUV from django.conf.urls.static import static from django.conf import settings urlpatterns = [ path('admin/', admin.site.urls), path('', IndexView.as_view(), name='index'), path('bookmark/', BookmarkLV.as_view(), name='bookmark_index'), path('bookmark/delete/<pk>', BookmarkRV.as_view(), name='bookmark_delete'), path('bookmark/update/<pk>', BookmarkUV.as_view(), name="bookmark_update"), path('bookmark/create', BookmarkCV.as_view(), name='bookmark_create'), path('bookmark/<pk>', BookmarkDV.as_view(), name='bookmark_detail'), path('accounts/register/', UserCreateView.as_view(), name='register'), path('about/', AboutView.as_view(), name="about"), path('accounts/', include('django.contrib.auth.urls')), path('accounts/register/', UserCreateView.as_view(), name='register'), path('accounts/register/done/', UserCreateDoneTV.as_view(), name='register_done'), path('blog/', PostLV.as_view(), name="blog"), path('blog/create', PostCV.as_view(), name="blog_create"), path('blog/update/<pk>', PostUV.as_view(), name="blog_update"), path('blog/delete/<pk>', PostDV.as_view(), name="blog_delete"), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url, include from django.contrib import admin from mysite.views import IndexView, UserCreateDoneTV, UserCreateView from bookmark.views import BookmarkLV, BookmarkDV from blog.views import PostLV, PostDV, PostCV, PostDeleteView from django.conf.urls.static import static from django.conf import settings urlpatterns = [ url(r'^admin/', admin.site.urls), url('^$', IndexView.as_view(), name='index'), url(r'^accounts/', include('django.contrib.auth.urls')), url(r'^accounts/register/$', UserCreateView.as_view(), name='register'), url(r'^accounts/register/done/$', UserCreateDoneTV.as_view(), name='register_done'), url(r'^bookmark/$', BookmarkLV.as_view(), name='bookmark_index'), url(r'^bookmark/(?P<pk>\d+)/$', BookmarkDV.as_view(), name='detail'), url(r'^blog/$', PostLV.as_view(), name='blog_index'), url(r'^blog/(?P<pk>\d+)/$', PostDV.as_view(), name='blog_detail'), url(r'^blog/add/$', PostCV.as_view(), name='blog_add'), url(r'^blog/(?P<pk>\d+)/delete/$', PostDeleteView.as_view(), name="blog_delete"), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)