VOOZH about

URL: https://www.geeksforgeeks.org/python/translator-app-project-using-django/

⇱ Translator App Project using Django - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Translator App Project using Django

Last Updated : 23 Jul, 2025

We will build a simple translator app using Django. We will learn how to set up a project, create a form to input text and select a language, and use the Python translate package to convert text from one language to another. Step-by-step, we’ll create a working app that translates user input into different languages.

Install Required Packages

Open your terminal and run:

pip install django
pip install translate

Create Django Project and App

Refer to the following articles to check how to create a project and an app in Django.

Open terminal and run:

django-admin startproject translator
cd translator
python manage.py startapp main

Add App to Installed Apps

In translator/settings.py, add "main" to the INSTALLED_APPS list:

👁 InstalledAppsInSettings

Create the View

In main/views.py, add the following code:

Create Templates Directory and HTML File

Inside the main app folder, create these directories:

main/
└── templates/
└── main/
└── index.html

Create index.html with the following content:

Configure URLs in the App

Create main/urls.py:

Include App URLs in Project URLs

In translator/urls.py, include the app’s URLs:

Run the Development Server

Run the Django server:

python manage.py runserver

Output

👁 Image
👁 Image
👁 Image
👁 Image
Comment