creating pages thru admin and/or manually?

44 views
Skip to first unread message

Vincent Fulco

unread,
Aug 27, 2012, 1:25:10 PM8/27/12
to mezzani...@googlegroups.com
While early days thru django/mezzanine docs, been trying to hack up a very basic home page based on Ross Laird's phenomenal blog tut.  Was hoping for a nudge/tips from those more experienced? 

1) Within a python virtualenv, accessed the admin page and added a couple of additional pages to see what functionality was immediately available; namely form, rich text, gallery and link page.  In other words, the defaults. 

2) Separately, in order to incorporate bootstrap,  created an app 'trialsite',  and copied into the template directory, base.html, index.html, startertemplate.html, footer_scripts.html (these four from bootstrap) and another trialpage.html to work on as a secondary page.

3) Using urls.py, replaced the former index.html with startertemplate.html.  plan on using this as start page.

I don't think I want to use the pages made in step 1) but how do I access to edit them?  Doing a locate doesn't cause them to surface.

Should all modified pages from bootstrap examples be added into urls.py and then they'll show on the site and in admin?  Have tried adding trialpage.html a few times but not getting the regex desc. correct.


TIA, V.

Stephen McDonald

unread,
Aug 27, 2012, 4:44:26 PM8/27/12
to mezzani...@googlegroups.com
It sounds like you're mentally associating individual templates to individual pages, which isn't how things work. The pages you want to delete (and can't locate with locate) are stored in the database - they don't each have a template file.

Each page stored in the DB will search for a template to use when rendering it. Check the docs for full details on how templates are searched for (http://mezzanine.jupo.org/docs/content-architecture.html#page-templates), but generally speaking the order goes:

1) a template named the same as the page's slug
2) a template named the same as the page's type
3) page.html

Given that, you shouldn't need to modify urls.py unless you're doing something very custom. The homepage is reference in urls.py since it's expected to be a custom case that may fall outside of the above structure, eg it might not (and this is the default) be represented by a page in the database. More info about that in the docs too: http://mezzanine.jupo.org/docs/frequently-asked-questions.html#why-isn-t-the-homepage-a-page-object-i-can-edit-via-the-admin
--
Stephen McDonald
http://jupo.org
Reply all
Reply to author
Forward
0 new messages