Skip to content

A simple note taking API for Django that supports creating notes and a folder structure. Built for the purpose of learning how to use the Django REST Framework to build a CRUD API.

License

Notifications You must be signed in to change notification settings

sheldonkwoodward/marknote

Repository files navigation

MarkNote

PyPI Version Python Versions Django Versions License Build Status Codacy Quality Badge Codacy Coverage Badge

A simple note taking API for Django that supports creating notes and a folder structure. Built for the purpose of learning how to use the Django REST Framework to build a CRUD API.

Features

  • Notes and folder structure
  • Per item owners
  • Integrated Django permissions

Planned Features

  • Revision history
  • Bearer token support
  • Note sharing
  • Ownership transfer

Installation

  1. Install with pip.
$ pip install marknote
  1. Modify your INSTALLED_APPS in settings.py.
INSTALLED_APPS = [
    'rest_framework',
    'rest_framework.authtoken',
    'marknote',
]
  1. Modify you urlpatterns in urls.py.
from django.urls import include, re_path

urlpatterns = [
    re_path(r'^marknote/', include(('marknote.urls', 'marknote'), namespace='marknote'))
]
  1. Run migrations.
$ python manage.py migrate

5. In the Django admin panel, generate a new token for the desired user. If they are not a superuser then they will need the MarkNote permissions added to their user.

The request expects an Authorization header with the value of Token xxx where xxx is your token. This will be changed in the future to add Bearer token support.

Endpoints

Documentation can be found here. Refer to the docs folder for the OpenAPI specification file.

There are four different endpoints for the API. The marknote portion of the URI can be mapped using the Django urls.py file. It is setup as shown in the sample project.

/marknote/note
The create and list endpoint used to create and list all notes.
/marknote/note/{id}
The retrieve, update, and destroy endpoint used to access individual notes.
/marknote/folder
The create and list endpoint used to create and list all folders.
/marknote/folder/{id}
The retrieve, update, and destroy endpoint used to access individual folders.

Tests

To run the unit tests, simply use the Django test command with Pipenv.

$ pipenv install
$ pipenv run python manage.py test

About

A simple note taking API for Django that supports creating notes and a folder structure. Built for the purpose of learning how to use the Django REST Framework to build a CRUD API.

Topics

Resources

License

Stars

Watchers

Forks

Languages