Skip to content

Commit

Permalink
Created a new blog app.
Browse files Browse the repository at this point in the history
  • Loading branch information
yahyaaly151989 committed Aug 20, 2023
1 parent 2ec9d3c commit d38ead5
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 1 deletion.
Empty file.
3 changes: 3 additions & 0 deletions Module01/mysite/blog/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions Module01/mysite/blog/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class BlogConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'blog'
Empty file.
3 changes: 3 additions & 0 deletions Module01/mysite/blog/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions Module01/mysite/blog/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
Empty file added Module01/mysite/blog/urls.py
Empty file.
3 changes: 3 additions & 0 deletions Module01/mysite/blog/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions Module01/mysite/mysite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog.apps.BlogConfig',
]

MIDDLEWARE = [
Expand Down
3 changes: 2 additions & 1 deletion Module01/mysite/mysite/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import path, include

urlpatterns = [
path('admin/', admin.site.urls),
path('blog/', include('blog.urls', namespace='blog')),
]

0 comments on commit d38ead5

Please sign in to comment.