Django Routing Examples

Django Routing

A website can have many pages and each page has its own unique Route. What do we man by Route? A Route can be thought of as the full URL that displays in the Web Browser URL field. For example, when you want to visit Apple on the internet, you would type https://www.apple.com/ into the Web Browser. This is a specific URL or Route. If you wanted to learn about the iPhone however, you would use a different route such as https://www.apple.com/iphone/.…

What Is A Django App

What Is A Django App

Django uses a modular structure of services to provide an overall solution. In other words, a Django project may have just a few, or in some cases a high number of different modules to provide the service that the project offers. In Django terminology, these modules are referred to as Apps. Each module, or App, has its own directory in the overall Django project. Any application code or Python files that provide the functionality for that App live in that specific directory.…

How To Run Django Development Server

How To Run Django Development Server

Once you have a new Django project set up and understand the basic file structure, you can begin working with the builtin Django development server. The Django development server provides a wonderful local development server that developers can leverage to preview code updates and test features of the Django-powered website. There is no need to worry about configuring a virtual machine, or configuring Docker, though you could go that route if you choose.…

Django Project File Structure

Django Project File Structure

The great thing about an advanced framework like Django is that it does a lot of repetitive tasks for you. When you create a new project in Django, all of the supporting files and basic configuration are done for you so that you don’t have to spend time manually creating a bunch of individual Python files by hand. What’s more, those Python files are arranged properly to provide a basic skeleton for a functioning project in Django.…

How To Use Visual Studio Code With Django

How To Use Visual Studio Code With Django

Visual Studio Code is the best *free* text editor for writing code available today. It has the benefit of being lightweight, and therefore very performant, while still offering many of the features that you would normally expect in a more robust Integrated Development Environment. Visual Studio Code is also great to use when working with Python and Django since it has extensions that make it easy to code in Python and Django.…

How To Create A Django Project

How To Create A Django Project

To create a brand new Django Project you can use the django-admin command followed by the startproject subcommand, followed by the name you would like to assign to the project. If you have multiple Django projects you might want to work on, you can create a directory to hold all of those projects. In our case, we have a djangoprojects directory and all of the development of new Django Projects will happen in there.…

How To Create Flask Base Template

How To Create Flask Base Template

In Flask just like in most web development frameworks, you can make use of base templates and the extending of templates to reduce repetitive markup. In other words, you can have a base HTML file and have components from that shown on every single webpage. We can refactor some of the markups we have created already in our Flask application in order to make use of templates that extend from other templates and use various blocks to get the layout we want.…