diff --git a/aula207_ola_django/blog/templates/blog/exemplo.html b/aula207_ola_django/blog/templates/blog/exemplo.html new file mode 100644 index 0000000..fb689e8 --- /dev/null +++ b/aula207_ola_django/blog/templates/blog/exemplo.html @@ -0,0 +1,12 @@ + + + + + + + Document + + +

EXEMPLO 2

+ + \ No newline at end of file diff --git a/aula207_ola_django/blog/templates/blog/index.html b/aula207_ola_django/blog/templates/blog/index.html new file mode 100644 index 0000000..ca7a407 --- /dev/null +++ b/aula207_ola_django/blog/templates/blog/index.html @@ -0,0 +1,12 @@ + + + + + + + Document + + +

BLOG 2

+ + \ No newline at end of file diff --git a/aula207_ola_django/blog/views.py b/aula207_ola_django/blog/views.py index bf8ba57..e8649a6 100644 --- a/aula207_ola_django/blog/views.py +++ b/aula207_ola_django/blog/views.py @@ -1,13 +1,18 @@ -from django.http import HttpResponse -# from django.shortcuts import render +from django.shortcuts import render def blog(request): print('blog') - return HttpResponse('blog do app 1') + return render( + request, + 'blog/index.html' + ) def exemplo(request): print('exemplo') - return HttpResponse('exemplo do app 1') + return render( + request, + 'blog/exemplo.html' + ) diff --git a/aula207_ola_django/home/templates/home/index.html b/aula207_ola_django/home/templates/home/index.html new file mode 100644 index 0000000..03704ff --- /dev/null +++ b/aula207_ola_django/home/templates/home/index.html @@ -0,0 +1,12 @@ + + + + + + + Document + + +

HOME 2

+ + \ No newline at end of file diff --git a/aula207_ola_django/home/views.py b/aula207_ola_django/home/views.py index ce9f212..a45ad24 100644 --- a/aula207_ola_django/home/views.py +++ b/aula207_ola_django/home/views.py @@ -1,8 +1,10 @@ -from django.http import HttpResponse - -# from django.shortcuts import render +from django.shortcuts import render def home(request): print('home') - return HttpResponse('home do app 1') + + return render( + request, + 'home/index.html' + ) diff --git a/aula207_ola_django/project/settings.py b/aula207_ola_django/project/settings.py index ca5c4a6..23899d3 100644 --- a/aula207_ola_django/project/settings.py +++ b/aula207_ola_django/project/settings.py @@ -37,6 +37,8 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'home', + 'blog', ] MIDDLEWARE = [