How to setup Python based Django framework and MySQL Databse to execute SQL statements

Introduction Here in this tutorial I am going to show you how to setup Python based Django framework and MySQL database server to execute SQL statement in Windows environment. The MySQL server is used as a persistent system for storing data for the application. I have already discussed in my another tutorial how to setup Django, so I won’t repeat the same thing here. As a prerequisite you need to go through the django setup tutorial before going down further.

Continue

Working with Parent and Child Templates in Flask

Introduction I will discuss here how to work with parent and child templates in flask framework. In other words it is said template (Jinja) inheritance. So I will create a base or parent template which child template or pages will extend to include the common functionalities instead of repeating common functionalities into every page you need to use for your web application. A template contains the static parts of the desired HTML output as well as some special syntax describing how dynamic content will be inserted.

Continue

Context Processors in Flask API

Introduction I will explain here about the context processors in Python based web Flask API. Flask is a light-weight framework with a set of rich features for creating wonderful web application in Python programming language. In standard context of the flask API, there are some global variables which are, by default, available in Jinja 2 templates and you can easily use these variables throughout your web application’s template files. Such global variables are flask.config, flask.request, flask.session, flask.g. There are some global functions as well, such as flask.url_for(), flask.get_flashed_messages().

Continue

Working with Static Resources CSS JS Image in Flask Template

Introduction We are going to discuss about working with static resources such as css js images in flask template. This tutorial will show you how to use css (Cascading Style Sheet), js (JavaScript) and image files. We need such static resources to enhance the look of the web pages and to communicate with the server side code when a user perform an action on the web page. Every web framework has its own style of including such static resource files. Flask also has its own style to include such resources,…

Continue

How to create Photo Gallery with Django

Introduction Here I will show you how to create photo gallery with Django. Django is a Python based framework used to build complete web applications. Photo gallery also known as image gallery, media gallery or photo album is used to manage your photos. You can view the images one by one from a list of images in a gallery. You can navigate to another photo in the gallery using next or previous arrow link. You can click on a particular photo to see the larger size of the thumbnail which…

Continue

Working with media files in Django templates

Introduction In this tutorial we will see working with media files in Django templates. Media files, such as, images, videos etc. are frequently loaded into our web application as these files improve end users’ experience. Note that static resources or files and media files are two different things. Media files are generally uploaded by users for explaining a certain event. You may also like to read working with static resources in Django templates.

Continue

Working with parent and child templates in Django

Introduction Here we will see working with template inheritance in Django or on other words, working with parent and child templates in Django. Being a web framework, Django needs a convenient way to generate HTML dynamically. The most common approach relies on templates. A template contains the static parts of the desired HTML output as well as some special syntax describing how dynamic content will be inserted. A template is simply a text file. It can generate any text-based format (HTML, XML, CSV, etc.). A template contains variables, which get…

Continue

Using Template in Codeigniter 3

Introduction This tutorial will show you an example on how to use template in Codeigniter 3. In an web application a template is recommended because there are certain regions or areas which are common to all pages and only the body portion of the page gets changed. Common areas like header, footer, left sidebar or right sidebar are mainly common areas for most of the web applications. So we will fix those common areas in the template file so that every page will use those common areas in the application…

Continue

Separating Front-end and Back-end in Codeigniter

Introduction This tutorial will show you an example on how to we can separate front-end and back-end in Codeigniter 3. Front-end which is mainly used by public users who navigate through the site and sometimes register themselves to get updates on the site activities, new posts, update on a particular post etc. Back-end which is mainly used by site author, administrator, editor etc. to manage the site. So back-end will be restricted to some people with given roles. Here I can use different URL, i.e., http://www.example.com/admin, for accessing directly admin…

Continue

Using Template in Codeigniter

This tutorial will show you an example on how to use template in Codeigniter. In an web application a template is recommended because there are certain regions or areas which are common to all pages and only the body portion of the page gets changed. Common areas like header, footer, left sidebar or right sidebar are mainly common areas for most of the web applications. So we will fix those common areas in the template file so that every page will use those common areas in the application and body…

Continue