Objects to support the front page of my Django powered web site? -
i building first django website , having trouble understanding objects needed support front page of website.
the front page has structure front page of 12 factor app , wondering django objects; models, views etc. need achieve this.
the page contain several headings text change infrequently. below text list of links other parts of site. content added via admin app.
at moment have following model:
class frontpage(models.model): introduction = models.charfield(max_length = 4000) updates = models.charfield(max_length = 4000) my view (simplified) looks this:
def indexpage(request): front_page = get_object_or_404(frontpage, pk=1) collection_list = carcollection.objects.orderby('the_year') return render(request, 'index.html', {'collection': collection_list, 'frontpage': front_page}) which pass template , page displayed expected, see text , links.
however sure there must more "django" type way develop type of page or suggestions appreciated.
in case of need using django 1.6
if text base not need anything. install django-cms , let handle content.
the links below introduction @ link posted seem content pages , django-cms provides. not need add models of own likely.
Comments
Post a Comment