fix: changing default project name to my_project

This commit is contained in:
Ryan Parsa 2025-03-11 13:56:03 -07:00 committed by GitHub
parent c078b336b2
commit 02a68ae9b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,14 +33,14 @@ Okay, we're ready to get coding.
To get started, let's create a new project to work with. To get started, let's create a new project to work with.
cd ~ cd ~
django-admin startproject tutorial django-admin startproject my_project
cd tutorial cd my_project
Once that's done we can create an app that we'll use to create a simple Web API. Once that's done we can create an app that we'll use to create a simple Web API.
python manage.py startapp snippets python manage.py startapp snippets
We'll need to add our new `snippets` app and the `rest_framework` app to `INSTALLED_APPS`. Let's edit the `tutorial/settings.py` file: We'll need to add our new `snippets` app and the `rest_framework` app to `INSTALLED_APPS`. Let's edit the `my_project/settings.py` file:
INSTALLED_APPS = [ INSTALLED_APPS = [
... ...
@ -282,7 +282,7 @@ Finally we need to wire these views up. Create the `snippets/urls.py` file:
path('snippets/<int:pk>/', views.snippet_detail), path('snippets/<int:pk>/', views.snippet_detail),
] ]
We also need to wire up the root urlconf, in the `tutorial/urls.py` file, to include our snippet app's URLs. We also need to wire up the root urlconf, in the `my_project/urls.py` file, to include our snippet app's URLs.
from django.urls import path, include from django.urls import path, include
@ -307,7 +307,7 @@ Quit out of the shell...
Validating models... Validating models...
0 errors found 0 errors found
Django version 5.0, using settings 'tutorial.settings' Django version 5.0, using settings 'my_project.settings'
Starting Development server at http://127.0.0.1:8000/ Starting Development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C. Quit the server with CONTROL-C.