/usernotes

Primary LanguagePython

๐Ÿ“˜ UserNotes Django Application

๐Ÿ“œ Description

This is a UserNotes application created using Django REST Framework. It provides APIs for managing notes.

๐Ÿš€ Setup Instructions

Without Docker

๐Ÿ“‹ Prerequisites

  • Python 3.11
  • pip (Python package manager)

๐Ÿ”ง Steps

  1. Clone the repository:
    git clone https://github.com/cmaliwal/usernotes.git
  2. Navigate to the project directory:
    cd usernotes
  3. Create a virtual environment:
    python -m venv venv
  4. Activate the virtual environment:
    • On Unix or MacOS: source venv/bin/activate
  5. Install the requirements:
    pip install -r requirements.txt
  6. Apply the migrations:
    python manage.py makemigrations
    python manage.py migrate
  7. Run the server:
    python manage.py runserver

With Docker

๐Ÿณ Prerequisites

  • Docker
  • Docker Compose

๐Ÿ”ง Steps

  1. Clone the repository:
    git clone https://github.com/cmaliwal/usernotes.git
  2. Navigate to the project directory:
    cd usernotes
  3. Build and run the Docker container:
    docker-compose up --build
  4. To access the bash shell:
    docker-compose exec web bash

๐ŸŒ Accessing the Application

The application will be accessible at http://127.0.0.1:8000.

๐Ÿ“š Swagger API Documentation

To access the Swagger API documentation, visit http://127.0.0.1:8000/api/schema/swagger-ui/.

๐Ÿงช Running Tests

To run tests, execute the following command:

python manage.py test

๐Ÿ—๏ธ Creating Migrations

To create new migrations based on the changes you've made to your models:

python manage.py makemigrations

With docker

docker-compose exec web python manage.py makemigrations

To apply the migrations to the database:

python manage.py migrate

With docker:

docker-compose exec web python manage.py migrate