Project using python/Cloning Airbnb
-
django edit-photo by CBVProject using python/Cloning Airbnb 2021. 3. 12. 11:34
url 설정 config/urls.py urlpatterns = [ path("rooms/", include("rooms.urls", namespace="room")) ] rooms/urls.py from django.urls import path from . import views app_name = "rooms" urlpatterns = [ path( "/photos//edit/", views.EditPhotoView.as_view(), name="edit-photo", )] CBV(Class Based View) rooms/views.py CBV는 django에서 정의한 여러가지 View들을 이용한다. 그 중 UpdateView를 이용해서 edit-photo page를 작성한다. # rooms/vi..
-
django edit photo by FBVProject using python/Cloning Airbnb 2021. 3. 12. 10:31
url 설정 config/urls.py urlpatterns = [ path("rooms/", include("rooms.urls", namespace="room")) ] rooms/urls.py from django.urls import path from . import views app_name = "rooms" urlpatterns = [path( "/photos//edit/", views.editPhoto, name="edit-photo", )] FBV(Function Based View) rooms/views.py # rooms/views.py from django.shortcuts import render, redirect, reverse from django.contrib import mes..
-
django create-photo by CBVProject using python/Cloning Airbnb 2021. 3. 12. 10:08
url 설정 config/urls.py urlpatterns = [ path("rooms/", include("rooms.urls", namespace="room")) ] rooms/urls.py from django.urls import path from . import views app_name = "rooms" urlpatterns = [ path("/photos/create/", views.CreatePhotoView.as_view(), name="create-photo") ] CBV(Class Based View) rooms/views.py CBV는 django에서 정의한 여러가지 View들을 이용한다. 그 중 CreateView를 이용해서 create-photo page를 작성한다. # roo..
-
django create-photo by FBVProject using python/Cloning Airbnb 2021. 3. 12. 09:11
url 설정 config/urls.py urlpatterns = [ path("rooms/", include("rooms.urls", namespace="room")) ] rooms/urls.py from django.urls import path from . import views app_name = "rooms" urlpatterns = [path("/photos/create/", views.createPhoto, name="create-photo")] FBV(Function Based View) rooms/views.py # rooms/views.py from django.shortcuts import render, redirect, reverse from django.contrib import m..
-
django photo list by CBVProject using python/Cloning Airbnb 2021. 3. 11. 12:34
url 설정 config/urls.py urlpatterns = [ path("rooms/", include("rooms.urls", namespace="room")) ] rooms/urls.py from django.urls import path from . import views app_name = "rooms" urlpatterns = [path("/photos/", views.PhotoListView.as_view(), name="photo-list")] CBV(Class Based View) rooms/views.py CBV는 django에서 정의한 여러가지 View들을 이용한다. 그 중 DetailView를 이용해서 photo list page를 작성한다. Photo list인데 왜 ListV..
-
django photo list by FBVProject using python/Cloning Airbnb 2021. 3. 11. 09:52
url 설정 config/urls.py urlpatterns = [ path("rooms/", include("rooms.urls", namespace="room")) ] rooms/urls.py from django.urls import path from . import views app_name = "rooms" urlpatterns = [path("/photos/", views.photoList, name="photo-list")] FBV(Function Based View) rooms/views.py # rooms/views.py from django.shortcuts import render, redirect, reverse from django.contrib import messages fro..
-
django search page by FBVProject using python/Cloning Airbnb 2021. 3. 9. 12:43
config/urls.py urlpatterns = [ path("core/", include("core.urls", namespace="core")) ] core/urls.py from django.urls import path from rooms import views as room_views app_name = "core" urlpatterns = [ path("search/", room_views.searchView, name="search") ] FBV(Function Based View) rooms/views.py # rooms/views.py from django.shortcuts import render from django_countries import countries from . im..
-
django delete room by FBVProject using python/Cloning Airbnb 2021. 3. 9. 10:01
url 설정 config/urls.py urlpatterns = [ path("rooms/", include("rooms.urls", namespace="room")) ] rooms/urls.py from django.urls import path from . import views app_name = "rooms" urlpatterns = [path("/delete/", views.deleteRoom, name="delete-room")] FBV(Function Based View) rooms/views.py # rooms/views.py from django.shortcuts import redirect, reverse from django.contrib import messages from djan..