Skip to content

Commit 881f7a7

Browse files
committed
Correct file paths in documentation
This commit corrects the file paths provided in the documentation, changing from dot notation to the correct slash notation. It also removes an empty item in the requirements list in the documentation.
1 parent f15026d commit 881f7a7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/images/index.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
The goal of this tutorial is for you to have Music API ready to receive songs, albums, and artists. While you learn [Django](https://www.djangoproject.com/) and [Django Rest Framework a.k.a DRF](https://www.django-rest-framework.org/) to build you first API
66

77
Requirements list:
8+
89
1. Python 3
910
2. Git
10-
3.
1111

1212
- **Total Duration:** 3 hours 30 minutes
1313
- **Lecture:** 1 hour (approximately 30%)
@@ -104,7 +104,7 @@ This will create the app structure for us. Something similar to this below:
104104

105105
Don't forget to add the app music to your INSTALLED_APPS in your `settings.py`
106106
```python
107-
# settings.py
107+
# first_api/settings.py
108108
...
109109
INSTALLED_APPS = [
110110
"django.contrib.admin",
@@ -131,7 +131,7 @@ We are going to create 3 models in the file models.py
131131
Let's start with the artist model.
132132

133133
```python
134-
# music.models.py
134+
# music/models.py
135135
class Artist(models.Model):
136136
name = models.CharField(max_length=100)
137137

@@ -145,7 +145,7 @@ from django.db import models
145145
```
146146
Now the album model
147147
```python
148-
# music.models.py
148+
# music/models.py
149149
class Album(models.Model):
150150
title = models.CharField(max_length=100)
151151
artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
@@ -158,7 +158,7 @@ class Album(models.Model):
158158
The last model will be the song model that will have relationship with artist and album.
159159

160160
```python
161-
# music.models.py
161+
# music/models.py
162162
class Song(models.Model):
163163
author = models.CharField(max_length=100)
164164
title = models.CharField(max_length=100)
@@ -173,7 +173,7 @@ Now let's go to the URL Mapping, we need to associate the url with the handler f
173173

174174

175175
```python
176-
# first_api.urls.py
176+
# first_api/urls.py
177177
from django.contrib import admin
178178
from django.urls import path, include
179179

@@ -186,7 +186,7 @@ urlpatterns = [
186186
You need to create a file `urls.py` inside music folder and make it look like the example below.
187187

188188
```python
189-
# music.urls.py
189+
# music/urls.py
190190
from django.urls import path
191191

192192
from . import views
@@ -200,7 +200,7 @@ And last but not least you need to create this
200200
you need to create the view. A function view in this case.
201201

202202
```python
203-
# music.views.py
203+
# music/views.py
204204
from django.http import HttpResponse
205205

206206

@@ -247,7 +247,7 @@ With the serializer in place we need more 2 steps, the url mapping and the view.
247247
Let's do both in sequence, first the view. For the view we are going to use a [ModelViewSet](https://www.django-rest-framework.org/api-guide/viewsets/#modelviewset). Inside our file `music.views.py` we need to add this snipper.
248248

249249
```python
250-
# music.views.py
250+
# music/views.py
251251
...
252252
class ArtistViewSet(viewsets.ModelViewSet):
253253
queryset = Artist.objects.all()
@@ -270,7 +270,7 @@ from music.serializers import ArtistSerializer
270270
Ok, now we just need to map our ArtistViewSet to a URL. In our `music.urls.py` we are going to use one more resource that DRF provides us, the [Default Router](https://www.django-rest-framework.org/api-guide/routers/#defaultrouter). It will create a set of common routes for our ViewSet.
271271
This will be the code:
272272
```python
273-
# music.urls.py
273+
# music/urls.py
274274
from django.urls import path, include
275275
from rest_framework import routers
276276

0 commit comments

Comments
 (0)