Django Configuration with Apache Web Server29 Aug 2024 | 1 min read Django uses its built-in development server to run the web application. To start this server, we can use python manage.py runserver command. This command starts the server which runs on port 8000 and can be accessed at browser by entering localhost:8000. It shows a welcome page of the application. ![]() And at browser, it can be accessed as below. ![]() But if we want to run our application by using apache server rather than built-in development server, we need to configure apache2.conf file located at /etc/apache directory. Add the following code into this file. // apache2.conf After adding these lines, restart apache server by using the service apache2 restart command and then type localhost to the browser's address bar. This time, project will run on apache server rather than a built-in server. See, it shows the home page of the application. ![]() Next TopicVirtual Environment Setup |
The MVT (Model View Template) is a software design pattern. It is a collection of three important components Model View and Template. The Model helps to handle database. It is a data access layer which handles the data. The Template is a presentation layer which handles User Interface...
1 min read
Create CSV with Django Django uses Python's built-in CSV library to create Dynamic CSV (Comma Separated Values) file. We can use this library in our project's view file. Let's see an example, here we have a Django project to which we are implementing this feature. A view function...
2 min read
Sending email using Django is pretty easy and require less configuration. In this tutorial, we will send email to provided email. For this purpose, we will use Google's SMTP and a Gmail account to set sender. Django provides built-in mail library django.core.mail to send email. Before sending email, we...
2 min read
In Django, a model is a class which is used to contain essential fields and methods. Each model class maps to a single table in the database. is a subclass of django.db.models.Model and each field of the model class represents a database field (column). Django provides us...
4 min read
Django Migration is a way of applying changes that we have made to a model, into the database schema. Django creates a migration file inside the migration folder for each model to create the table schema, and each table is mapped to the model of which...
3 min read
| How to work with the ORM Queries In this tutorial, we will have the complete discussion over the Django ORM queries and how we can use them to manipulate the data. Django ORM is one of the best tools of Django and plays very essential role...
9 min read
A session is a mechanism to store information on the server side during the interaction with the web application. In Django, by default session stores in the database and also allows file-based and cache based sessions. It is implemented via a piece of middleware and can be...
2 min read
In this tutorial, we are discussing . If you are working with Django, pytest fixtures can help you write tests for your models that are easy to maintain. Writing accurate assessments is a key step to a successful app, and fixtures are a key part of...
4 min read
Django is the most popular web framework of Python, which is used in rapid web application development. It provides a built-in interface that makes it easy to work with it. It is also known as the Batteries included framework because it offers built-in facilities for each...
11 min read
Ruby on Rails and Django are two leading web frameworks popularly used in web development. This tutorial discusses which framework is more suitable for the project and defines the advantages and disadvantages. These frameworks share lots of similarities, but each has unique features on its way. Both...
7 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India