{"id":29618682,"url":"https://github.com/polymathuniversata/alx_djangolearnlab","last_synced_at":"2025-09-03T18:42:49.458Z","repository":{"id":304205981,"uuid":"1018096809","full_name":"polymathuniversata/Alx_DjangoLearnLab","owner":"polymathuniversata","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-22T11:27:03.000Z","size":261,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-22T11:45:05.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polymathuniversata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-11T15:46:17.000Z","updated_at":"2025-08-22T11:27:06.000Z","dependencies_parsed_at":"2025-07-11T18:31:40.510Z","dependency_job_id":"e7af4224-6703-4b8c-a122-b9e47b94fa2a","html_url":"https://github.com/polymathuniversata/Alx_DjangoLearnLab","commit_stats":null,"previous_names":["polymathuniversata/alx_djangolearnlab"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/polymathuniversata/Alx_DjangoLearnLab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polymathuniversata%2FAlx_DjangoLearnLab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polymathuniversata%2FAlx_DjangoLearnLab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polymathuniversata%2FAlx_DjangoLearnLab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polymathuniversata%2FAlx_DjangoLearnLab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polymathuniversata","download_url":"https://codeload.github.com/polymathuniversata/Alx_DjangoLearnLab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polymathuniversata%2FAlx_DjangoLearnLab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273492403,"owners_count":25115596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-21T02:03:18.246Z","updated_at":"2025-09-03T18:42:49.432Z","avatar_url":"https://github.com/polymathuniversata.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Social Media API\n\nA RESTful API for a social media platform built with Django and Django REST Framework.\n\n## Features\n\n- User registration and authentication with JWT\n- User profiles with bio, profile pictures, and more\n- Follow/Unfollow functionality\n- Secure password management\n- RESTful API design\n\n## Prerequisites\n\n- Python 3.8+\n- pip (Python package manager)\n- Virtual environment (recommended)\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd social_media_api\n   ```\n\n2. Create and activate a virtual environment:\n   ```bash\n   # On Windows\n   python -m venv venv\n   .\\venv\\Scripts\\activate\n   \n   # On macOS/Linux\n   python3 -m venv venv\n   source venv/bin/activate\n   ```\n\n3. Install the required packages:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. Apply migrations:\n   ```bash\n   python manage.py migrate\n   ```\n\n5. Create a superuser (admin):\n   ```bash\n   python manage.py createsuperuser\n   ```\n\n6. Run the development server:\n   ```bash\n   python manage.py runserver\n   ```\n\n## API Endpoints\n\n### Authentication\n\n- `POST /api/auth/register/` - Register a new user\n- `POST /api/auth/token/` - Obtain JWT token (login)\n- `POST /api/auth/token/refresh/` - Refresh JWT token\n\n### User Profile\n\n- `GET /api/auth/profile/` - Get or update current user's profile\n- `GET /api/auth/users/\u003cusername\u003e/` - Get a user's public profile\n- `POST /api/auth/change-password/` - Change password\n- `POST /api/auth/follow/\u003cusername\u003e/` - Follow/Unfollow a user\n\n## Testing the API\n\nYou can use tools like [Postman](https://www.postman.com/) or [curl](https://curl.se/) to test the API endpoints.\n\n### Example: Register a new user\n\n```bash\ncurl -X POST http://127.0.0.1:8000/api/auth/register/ \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"username\": \"testuser\",\n    \"email\": \"test@example.com\",\n    \"password\": \"testpass123\",\n    \"password2\": \"testpass123\",\n    \"first_name\": \"Test\",\n    \"last_name\": \"User\"\n  }'\n```\n\n### Example: Get JWT token\n\n```bash\ncurl -X POST http://127.0.0.1:8000/api/auth/token/ \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"username\": \"testuser\", \"password\": \"testpass123\"}'\n```\n\n## Project Structure\n\n```\nsocial_media_api/\n├── accounts/                 # User accounts app\n│   ├── migrations/           # Database migrations\n│   ├── __init__.py\n│   ├── admin.py             # Admin interface configuration\n│   ├── apps.py              # App configuration\n│   ├── models.py            # User and related models\n│   ├── serializers.py       # API serializers\n│   ├── urls.py             # App URL configuration\n│   └── views.py            # API views\n├── config/                  # Project configuration\n│   ├── __init__.py\n│   ├── asgi.py\n│   ├── settings.py         # Project settings\n│   ├── urls.py            # Main URL configuration\n│   └── wsgi.py\n├── media/                  # User-uploaded files (profile pictures)\n├── manage.py              # Django management script\n└── README.md              # This file\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a new branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n=======\n# Alx_DjangoLearnLab\n\u003e\u003e\u003e\u003e\u003e\u003e\u003e origin/main\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymathuniversata%2Falx_djangolearnlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolymathuniversata%2Falx_djangolearnlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymathuniversata%2Falx_djangolearnlab/lists"}