Skip to content

Commit

Permalink
Commit message:
Browse files Browse the repository at this point in the history
Add 'music' app to Django project

Added new 'music' app to Django project along with necessary views and urls. Settings and main url files have been updated to include 'music' app. A base index view returning a simple HttpResponse has been added to 'music' views for testing purposes.
  • Loading branch information
lipemorais committed Apr 18, 2024
1 parent f2a1ab5 commit 3213041
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions first_api/first_api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"django.contrib.messages",
"django.contrib.staticfiles",
"rest_framework",
"music",
]

MIDDLEWARE = [
Expand Down
3 changes: 2 additions & 1 deletion first_api/first_api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
"""

from django.contrib import admin
from django.urls import path
from django.urls import path, include

urlpatterns = [
path("admin/", admin.site.urls),
path("", include('music.urls')),
]
7 changes: 7 additions & 0 deletions first_api/music/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.urls import path

from . import views

urlpatterns = [
path('', views.index, name='index')
]
6 changes: 4 additions & 2 deletions first_api/music/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from django.shortcuts import render
from django.http import HttpResponse

# Create your views here.

def index(_request):
return HttpResponse("My first API!")

0 comments on commit 3213041

Please sign in to comment.