Below is a step-by-step guide to install and dockerize Django with OpenLayer, PostgreSQL, PostGIS, and the specified Python libraries on Ubuntu 22.04. This guide includes all the necessary Dockerfiles, scripts, and requirements files to help you set up the environment. Step 1: Install Docker and Docker Compose First, ensure that Docker and Docker Compose are […]
Category: Django
Django Test Framework
Django’s built-in test framework is a powerful tool that allows you to write and run tests for your Django applications. Below is a simple example and step-by-step guide to using it. Step 1: Set Up Your Django Project If you haven’t already, start by setting up a Django project. django-admin startproject myproject cd myproject python […]
Run server in back ground
you can use nohup and store the PID in a file when you start the server: nohup python manage.py runserver 0.0.0.0:8000 & echo $! > django_server.pid To continuously display the content of the nohup.out file in real-time tail -f nohup.out To stop the server later, you can use: kill $(cat django_server.pid) You can find the […]
Install in Env
Step 1: Install virtualenv (if not already installed) pip install virtualenv Step 2: Create a virtual environment virtualenv myenv Or using venv module python3 -m venv myenv Step 3: Activate the virtual environment On Windows myenv\Scripts\activate.bat On macOS and Linux source myenv/bin/activate Step 4: Install Django pip install django Step 5: Verify the installation django-admin […]