Exemplo n.º 1
0
from django.conf.urls import url
from bookmark.views import BookmarkLV, BookmarkDV

urlpatterns = [
    url(r'^$', BookmarkLV.as_view(), name='index'),
    url(r'^(?P<pk>\d+)/$', BookmarkDV.as_view(), name='detail'),
]
Exemplo n.º 2
0
from django.urls import path
from bookmark.views import BookmarkLV, BookmarkDV

app_name = 'bookmark'
urlpatterns = [
    path('', BookmarkLV.as_view(), name='index'),
    path('<int:pk>/', BookmarkDV.as_view(), name="detail")
]
Exemplo n.º 3
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    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 bookmark.views import BookmarkLV, BookmarkDV
from mysite.views import HomeView, BookmarkView
urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', HomeView.as_view(), name='home'),

    url(r'blog/', include('blog.urls', namespace='blog')),

    url(r'^bookmark/$', BookmarkLV.as_view(),
        name='index'),

    url(r'^bookmark/(?P<pk>\d+)/$', BookmarkDV.as_view(),
        name='detail')
]
Exemplo n.º 4
0
from blog.views import PostLV, PostDV, PostCreateView, PostDeleteView, PostUpdateView

from django.conf.urls.static import static
from django.conf import settings

from mysite.views import UserCreationView, UserCreationDoneTV

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^accounts/', include('django.contrib.auth.urls')),
    url(r'^accounts/register/$', UserCreationView.as_view(), name='register'),
    url(r'^accounts/register/done/$',
        UserCreationDoneTV.as_view(),
        name='register_done'),
    url(r'^$', IndexView.as_view(), name='index'),
    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/$', PostCreateView.as_view(), name="blog_add"),
    url(r'^blog/(?P<pk>[0-9]+)/delete/$',
        PostDeleteView.as_view(),
        name="blog_delete"),
    url(r'^blog/(?P<pk>[0-9]+)/update/$',
        PostUpdateView.as_view(),
        name="blog_update"),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
"""
r'^   =>  localhost:8000/
r'^admin ====> localhost:8000/admin
r'^bookmark/$'  =====>    localhost:8000/bookmark
Exemplo n.º 5
0
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'^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'),
Exemplo n.º 6
0
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    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
from django.contrib import admin
from mysite.views import IndexView
from bookmark.views import BookmarkLV, BookmarkDV
from blog.views import PostLV, PostDV

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'^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')
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

#url( url 주소 패턴, 관련된 views.py의 클래스.as_view(), name="html파일명")
Exemplo n.º 7
0
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
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"),
Exemplo n.º 8
0
from django.conf.urls import url

from bookmark.views import BookmarkLV, BookmarkDV, \
    BookmarkCreateView, BookmarkChangeView, BookmarkUpdateView, BookmarkDeleteView

urlpatterns = [
    url(r'^$', BookmarkLV.as_view(), name='index'),
    url(r'^(?P<pk>\d+)/$', BookmarkDV.as_view(), name='detail'),

    url(r'^add/$', BookmarkCreateView.as_view(), name='add'),
    url(r'^change/$', BookmarkChangeView.as_view(), name='change'),
    url(r'^(?P<pk>[0-9]+)/update/$', BookmarkUpdateView.as_view(), name='update'),
    url(r'^(?P<pk>[0-9]+)/delete/$', BookmarkDeleteView.as_view(), name='delete'),
]
Exemplo n.º 9
0
from django.urls import path

from bookmark.views import BookmarkLV, BookmarkDV

app_name = 'bookmark'

urlpatterns = [
    path('', BookmarkLV.as_view(), name="index"),
    path('<int:pk>/', BookmarkDV.as_view(), name="detail"),
]
Exemplo n.º 10
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
#from bookmark.views import *
from bookmark.views import BookmarkLV, BookmarkDV
from bookmark.models import Bookmark

urlpatterns = [
    path('admin/', admin.site.urls),
    #class based views
    path("bookmark/", BookmarkLV.as_view(), name="index"),
    path("bookmark/<int:pk>/", BookmarkDV.as_view(), name="detail")
]
'''
    urls with view definition
    path("bookmark/", BookmarkVL.as_view(model=Bookmark), name="index")
    path("bookmark/<int:pk>/", BookmarkDV.as_view(model=Bookmark), name="detail")
'''
Exemplo n.º 11
0
"""mysite URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Add an import:  from blog import urls as blog_urls
    2. Import the include() function: from django.conf.urls import url, include
    3. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""

from django.conf.urls import url
from bookmark.views import BookmarkLV, BookmarkDV

urlpatterns = [
    url('', BookmarkLV.as_view(), name='index'),
    url('bookmark/', BookmarkLV.as_view(), name='index'),
    url('bookmark/<pk>', BookmarkDV.as_view(), name='detail'),
]
Exemplo n.º 12
0
"""mysite URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    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
from django.contrib import admin

from bookmark.models import Bookmark
from bookmark.views import BookmarkLV, BookmarkDV

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

#Class-based views for Bookmark app
url(r'^bookmark/$', BookmarkLV.as_view(model=Bookmark), name='index'),
url(r'^bookmark/(?P<pk>\d+)/$', BookmarkDV.as_view(model=Bookmark), name='detail'),
]
Exemplo n.º 13
0
from django.urls import path
from bookmark.views import BookmarkLV, BookmarkDV

app_name = "bookmark"
urlpatterns = [
    path("", BookmarkLV.as_view(), name="list"),
    path("<int:pk>/", BookmarkDV.as_view(), name="detail"),
]