diff --git a/first_api/first_api/settings.py b/first_api/first_api/settings.py index 4c32de7..d21794d 100644 --- a/first_api/first_api/settings.py +++ b/first_api/first_api/settings.py @@ -38,6 +38,7 @@ "django.contrib.messages", "django.contrib.staticfiles", "rest_framework", + "music", ] MIDDLEWARE = [ diff --git a/first_api/first_api/urls.py b/first_api/first_api/urls.py index 2924dda..8f513f1 100644 --- a/first_api/first_api/urls.py +++ b/first_api/first_api/urls.py @@ -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')), ] diff --git a/first_api/music/urls.py b/first_api/music/urls.py new file mode 100644 index 0000000..2fcca0d --- /dev/null +++ b/first_api/music/urls.py @@ -0,0 +1,7 @@ +from django.urls import path + +from . import views + +urlpatterns = [ + path('', views.index, name='index') +] diff --git a/first_api/music/views.py b/first_api/music/views.py index 91ea44a..f84a524 100644 --- a/first_api/music/views.py +++ b/first_api/music/views.py @@ -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!")