This project is a simple URL shortening service implemented using Django and Django REST framework.
-
Clone the repository:
git clone https://github.com/AibekYrysbekov/Neobis_Shortener_Project.git
-
Change to the project directory:
cd Neobis_Shortener_Project
-
Create and activate a virtual environment (recommended):
python -m venv venv source venv/bin/activate # For Linux/Mac venv\Scripts\activate # For Windows
-
Install dependencies from the requirements.txt file:
pip install -r requirements.txt
-
Apply migrations to the database:
python manage.py migrate
-
Start the server:
python manage.py runserver
After these steps, your server will be accessible at http://localhost:8000/.
Create a short link: Send a POST request to /api/create/ with a JSON body containing the original_url. For example: {"original_url": "https://example.com"}.
Get a list of all short links: You can retrieve a list of all created short links by sending a GET request to /api/list/.
Follow a short link: Simply navigate to the URL containing the short link to perform a redirection to the original URL.
Configure the database: By default, the project uses Postgresql as the database. You can configure other databases by changing the settings in the settings.py file.
Additional Features: You can add additional features to the project, such as link expiration, click analytics, and more.