Showing posts with label Django. Show all posts
Showing posts with label Django. Show all posts

Tuesday, January 12, 2021

How to run Django's Development Server

Hi,

In this post I am going to talk about, how to run Django's development server with different options...

As we all know the framework django is packed along with a development server to ease the job during development

Make sure you have the following prerequisites in place before we proceed...

Prerequisites
NameVersion
Python3.9.1
Django3.1.5

In order to have the development server, we should have a valid project created before hand, to create a project in django, you can make use of the link below for creating a project


From the Project's home directory, you can try the following options to have the server up.

To run the server with default settings
$ python manage.py runserver

To run the server on port 8080
$ python manage.py runserver 8080

To run the server on a specific port with an IP
$ python manage.py runserver 0:8080

The above command can be expanded as...

$ python manage.py runserver 0.0.0.0:8080

To run the server with different IP
$ python manage.py runserver 192.168.1.5:8080


Well that is it, we have discussed possible different options of running the development server in dango web application framework.

Hope you had great time, Thanks.

How to Create a Project and Application in Django Web Application Framework

Hi,
In this post I am going to talk about how to create a Web Application Project using Django framework.

Please refer the prerequisite section for what you suppose to have upfront before proceeding further.

At the time of writing, the versions that you find under prerequisites were in use, the details discussed would remain same for the future versions as well...

Prerequisites
NameVersion
Python3.9.1
Django3.1.5

Creating a project

To create a project, use the following command... In my case the project name is "django_tutor"

$ django-admin startproject django_tutor

The above command would have created a directory named "django_tutor" in the present working directory which is the Home directory for the project.

Creating an Application

Change directory to project's Home directory.

$ cd django_tutor

To create a application, use the following command... in my case the application name is "blogs"

$ python manage.py startapp blogs

Now you could see a directory called blogs under django_tutor, which is the application directory for the application blogs.

Well with this we have concluded the creation of a project and a application.

Hope you had great time, Thanks.

How to install Django - The Web Application Framework in Python

Hi,

In this post I am going to talk about how to install Django framework.

The below table would describe the details of software required to install the framework as prerequisite.

At the time of writing, the version that you find under prerequisites was in use, the details discussed would remain same for the future versions as well...

Prerequisites
SoftwareVersion
Python3.9.1

To check whether Django is already installed or not, you can make use of the following command

$ python -m django --version

if Django framework is already installed, the above command would return the version of the framework else it would return the error message stating "No module named django".

Assuming we have not yet installed the framework, use the following command to install the same.

$ python -m pip install Django

Well that is it, we have successfully installed Django framework. Hope you had great time reading.

Thanks.

Installing Python and Creating Virtual Environment for Pip for package installations in Ubuntu

Hi, In this post we are going to look at how to install Python and PIP and installing packages in virtual environments.. Without wasting...