blog detail working

This commit is contained in:
2020-03-08 23:42:03 -07:00
parent a87dd68bc7
commit c78b0261ec
10 changed files with 135 additions and 17 deletions

View File

@ -1,7 +1,4 @@
from django.contrib import admin
# Register your models here.
from .models import Job
admin.site.register(Job)

View File

@ -1,8 +1,9 @@
from django.db import models
# Create your models here.
class Job(models.Model):
image = models.ImageField(upload_to='images/')
summary = models.CharField(max_length=200)
def __str__(self):
return self.summary

View File

@ -1,10 +1,7 @@
from django.shortcuts import render
from .models import Job
# Create your views here.
def home(request):
jobs = Job.objects
return render(request, 'jobs/home.html', {'jobs': jobs})