Skip to content

Commit

Permalink
ホーム画面の実装
Browse files Browse the repository at this point in the history
  • Loading branch information
HayashiYoshihiro committed May 4, 2024
1 parent 9c5ac1c commit 3790c19
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 7 additions & 0 deletions templates/tweets/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "base.html" %} ← base.htmlを継承

{% block title %}Home{% endblock %} ← titleを入れる

{% block content %}
<h1>Homeです</h1>
{% endblock %}
6 changes: 3 additions & 3 deletions tweets/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# from django.urls import path
from django.urls import path

# from . import views
from . import views

app_name = "tweets"

urlpatterns = [
# path('home/', views.HomeView.as_view(), name='home'),
path("home/", views.HomeView.as_view(), name="home"),
# path('create/', views.TweetCreateView.as_view(), name='create'),
# path('<int:pk>/', views.TweetDetailView.as_view(), name='detail'),
# path('<int:pk>/delete/', views.TweetDeleteView.as_view(), name='delete'),
Expand Down
6 changes: 6 additions & 0 deletions tweets/views.py
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# from django.shortcuts import render
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic.base import TemplateView


class HomeView(LoginRequiredMixin, TemplateView):
template_name = "tweets/home.html"

0 comments on commit 3790c19

Please sign in to comment.