This guide provides detailed steps for installing Django on Termux, a terminal emulator for Android.
- Video Tutorial
- Auto Install
- Manual Process
- Step 1: Update Termux Package List
- Step 2: Install Python and Git
- Step 3: Install Django and Required Packages
- Step 4: Verify Installation
- Step 5: Create a Django Project
- Step 6: Run the Development Server
- Question: Why We Do Not Recommend Installing Django in a Virtual Environment
- License
- Uses
- Contributing
For a visual guide on installing django in Termux, watch the YouTube video tutorial:
To automatically install all required packages, execute the following command:
curl -s https://raw.githubusercontent.com/cyberkernelofficial/django-in-termux/main/commands.txt | bash
Ensure your package list is up to date with the following command:
pkg update -y && pkg upgrade -y
Install Python and Git using the package manager pkg:
pkg install python3 git -y
- Install Django using pip, the Python package manager:
pip install django
- For image processing in Django, install the python-pillow package:
pkg install python-pillow -y
- To manage date and time effectively, Django requires tzdata:
pip install tzdata
Confirm the Django installation by checking its version:
django-admin --version
Create a new Django project with the following command:
django-admin startproject mysite
Move into your project directory:
cd mysite
Start the Django development server:
python manage.py runserver
Visit http://127.0.0.1:8000 in your web browser to view your Django project.
When installing the Pillow package in Termux using pip, some devices encounter errors. As a workaround, we suggest using the python-pillow package instead of directly installing from pip. Furthermore, activating a virtual environment may cause Pillow to malfunction due to isolation from its necessary dependencies. Hence, we recommend installing Django globally to ensure its seamless functionality.
This project is licensed under the MIT License.
Feel free to use this guide for installing Django on Termux interactively.
Contributions are welcome! If you have any improvements or suggestions, please feel free to create a pull request.