Skip to content

Commit 754bf43

Browse files
committed
1b. Create a Django Application & Create a View
1 parent a639f1c commit 754bf43

File tree

11 files changed

+31
-2
lines changed

11 files changed

+31
-2
lines changed

rp-portfolio/hello_world/__init__.py

Whitespace-only changes.

rp-portfolio/hello_world/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# from django.contrib import admin
2+
3+
# Register your models here.

rp-portfolio/hello_world/apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class HelloWorldConfig(AppConfig):
5+
name = "hello_world"

rp-portfolio/hello_world/migrations/__init__.py

Whitespace-only changes.

rp-portfolio/hello_world/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# from django.db import models
2+
3+
# Create your models here.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>Hello, World!</h1>

rp-portfolio/hello_world/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# from django.test import TestCase
2+
3+
# Create your tests here.

rp-portfolio/hello_world/urls.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.urls import path
2+
3+
from hello_world import views
4+
5+
urlpatterns = [path("", views.hello_world, name="hello_world")]

rp-portfolio/hello_world/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.shortcuts import render
2+
3+
4+
def hello_world(request):
5+
return render(request, "hello_world.html", {})

rp-portfolio/personal_portfolio/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"django.contrib.sessions",
3838
"django.contrib.messages",
3939
"django.contrib.staticfiles",
40+
"hello_world",
4041
]
4142

4243
MIDDLEWARE = [

0 commit comments

Comments
 (0)