This repository contains a simple project that follows the official Django REST Framework tutorial. It's intended as a learning resource to understand the fundamentals of building APIs using Django and the Django REST Framework (DRF).
- Django project setup with REST framework integration
- Basic CRUD API for code snippets
- Token-based authentication
- Permissions and ownership logic
- DRF's browsable API for interactive exploration
django-rest-tutorial/
├── manage.py
├── snippets/ # Contains models, serializers, views, URLs
├── tutorial/ # Project settings and configuration
└── requirements.txt
To get the project up and running locally:
- Clone the repository
git clone https://github.com/lorainemg/django-rest-tutorial.git
cd django-rest-tutorial- Create and activate a virtual environment
python -m venv env
source env/bin/activate # On Windows: env\Scripts\activate- Install dependencies
pip install -r requirements.txt- Apply migrations
python manage.py migrate- Create a superuser (optional)
python manage.py createsuperuser- Run the development server
python manage.py runserverAccess the API at: http://localhost:8000/