A Django REST Framework application that mimics the basic functionalities of Spotify, including managing tracks, playlists, and user authentication.
- User Authentication (Register, Login, Logout)
- CRUD operations for Tracks and Playlists
- Add/Remove Tracks from Playlists
- List Playlists and Tracks
- Python 3.x
- Django 3.x or later
- Django REST Framework
- PostgreSQL (or any other preferred database)
-
Clone the repository:
git clone https://github.com/ShubhamNagure/spotify_clone.git cd spotify_clone -
Create and activate a virtual environment:
python -m venv env source env/bin/activate # On Windows use `env\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Set up the database:
- Configure your database settings in
spotify_clone/settings.py. - Apply migrations:
python manage.py migrate
- Configure your database settings in
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
- Access the API at
http://127.0.0.1:8000/api/. - Use the Django admin interface at
http://127.0.0.1:8000/admin/to manage users, tracks, and playlists.
- Register:
POST /api/auth/register/ - Login:
POST /api/auth/login/ - Logout:
POST /api/auth/logout/
- List Tracks:
GET /api/tracks/ - Create Track:
POST /api/tracks/ - Retrieve Track:
GET /api/tracks/{id}/ - Update Track:
PUT /api/tracks/{id}/ - Delete Track:
DELETE /api/tracks/{id}/
- List Playlists:
GET /api/playlists/ - Create Playlist:
POST /api/playlists/ - Retrieve Playlist:
GET /api/playlists/{id}/ - Update Playlist:
PUT /api/playlists/{id}/ - Delete Playlist:
DELETE /api/playlists/{id}/ - Add Track to Playlist:
POST /api/playlists/{id}/add_track/ - Remove Track from Playlist:
POST /api/playlists/{id}/remove_track/
To run the tests, execute:
python manage.py testContributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch.
- Make your changes.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.