First commit
This commit is contained in:
commit
440f5a7df4
1563 changed files with 217996 additions and 0 deletions
0
home/__init__.py
Normal file
0
home/__init__.py
Normal file
3
home/admin.py
Normal file
3
home/admin.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
home/apps.py
Normal file
6
home/apps.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class HomeConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'home'
|
||||
0
home/migrations/__init__.py
Normal file
0
home/migrations/__init__.py
Normal file
3
home/models.py
Normal file
3
home/models.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
3
home/tests.py
Normal file
3
home/tests.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
7
home/urls.py
Normal file
7
home/urls.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from django.urls import path
|
||||
from . import views
|
||||
|
||||
app_name = 'home'
|
||||
urlpatterns = [
|
||||
path('', views.home, name='home'),
|
||||
]
|
||||
6
home/views.py
Normal file
6
home/views.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
from django.shortcuts import render
|
||||
from courses.models import Course
|
||||
|
||||
def home(request):
|
||||
courses = Course.objects.order_by('-created_at')[:6]
|
||||
return render(request, 'home.html', {'courses': courses})
|
||||
Loading…
Add table
Add a link
Reference in a new issue