Customising the front-end of Mezzanine

Richard Miles
A free video tutorial from Richard Miles
Web Developer
4.1 instructor rating • 2 courses • 34,691 students

Learn more from the full course

Django for WordPress Developers

Learn how to code in python and how to use Django while drawing parallels to WordPress

06:30:15 of on-demand video • Updated October 2016

  • Understand how python works as a programming language
  • Create a basic Class and Object in python and php
  • Create a TO-DO application using python
  • Understand the architecture of the Django framework
  • Create a Django server
  • Create a basic blog using core python and Django
  • Create a CMS using Django's powerful package and extension management system
  • Create an eCommerce store using Oscar Commerce
  • Create an eCommerce store using Mezzanine and Cartridge
  • Create an eCommerce store using Saleor
English [Auto] It in the last lecture we had a bit of a tour on the front end and the back end of mezzanine and some of the basic things that the Office of the box in this lecture was going to be looking at how to customize the front and look and feel of the site. So the first thing that I'm going to do is I'm actually going to go look at the project itself. So I'm in Sublime Text now. And what you'll notice is that we've obviously installed my project at the default app as it is before and with a personal nigers it looks very very different to a normal Genger and this is because mezzanine takes care of a lot of the heavy lifting and only when we need something. Well we asked me to give it to us so that keeps this whole folder really really neat and trim and clean and very similar to the way that we're press creates child theme which has minimal stuff in it. So. Ms Nene does the same thing. So effectively what we're doing is we creating a child team of the parent team obviously logistically it's completely different. That's there is there is a a core theme that exists somewhere and all we want to do is extend it so the way that we extend the coffee is by calling and templates in the AM in Python command line and then it will actually generate dissemblers force and then make an editor. And then our child team opened open closes inverted commas. Well actually the files folders will actually be created. So let's go to our consulate because there are also some breathing room. And it's just cool also. So the way that we do that is the same way that we always run the Genger on the reset and madness up you. And then the question that we want to use is complex templates and if we want a specific template we can just go Dashti and then and the way that that Django works well where that mezzanine works is we actually select which template we want to create and then it will create that template specifically for us and it will mimic what has already been created in Maysan So it's copied one templates Acosta still giving us that area we can fix it at some sites just copy that one template across if we go back to your code now I would grant you templates we can all see that we have mision means based on age Tamal. So if I wanted to do this to just make 100 percent sure that we had something you know I'm just going to say overworld mice and big and bold. And then I'm going to run all server and I'm going to refresh this and I'll see that based template has had a will. So that's that's a really really soon. The next thing that I want to do is actually just import every single template and it's going to make our theme quite bulky but I just want to show you for example it's not really best practice to import every single one package just to take up these parameters. And acyclic templates I don't know say it will not loop through every single template and ask us if we would like to overwrite that template just in case we already created it. So I would really like to override based on that. Yes we would like to write base. So now what it's done is it's copied 47 templates across and because it's not just that we really have something in base asked us that but otherwise it's created every single as a template for us really. So you will see all templates folder has got a lot bigger and you'll notice that because it's over written that we no longer have one type with hello world in it's another thing that you'll notice which is really cool is that we have not created any of our static assets yet to any of our javascript processes so if we look under static CIRCE's Sheptock TSS you'll see that it's still pulling in the default and mision styling and we don't have access to that. If we wanted to we could create a successful the here and the Osseous folder and files would override that of mezzanine so we just do the example of a bootstrap dash themed or C assist because I don't want to take all that stuff from all of them and I'm going to save that that's a beach. The embassy says so. One thing that I do want to make a note of is that if we look at our base HMO and our theme does she says if we take this out completely and we save the file and we go back to our sites again and refresh it you'll notice that there has not been any change. So what that tells us is that this team isn't really doing anything. So for now I'm not going to use this theme. I'm going to change this to say iam dush custom say Prichep mean custom not. And I'm going to change this fall as well. Preacher Dasht he does custom theosis. OK cool. So we don't want to fiddle with that it's not really doing anything. So now let's actually add some styling to our custom theme that he says let's just apply is attacked the whole body and that's say background and then something that's going to be really obvious like blue cool. So not pulling in all custom but see is this if we run this file again you will notice that our background has changed to pretty awesome guys congratulations we have. We have created all first custom styling on our missing theme.