This Django web application provides user authentication and content management features. It includes endpoints for user login, registration, password management, and post creation and manipulation.
- User Authentication: Secure login, logout, and signup with email verification.
- Password Management: Password change, reset, and confirmation.
- User Management: Retrieve and update user details.
- Content Management: Create, update, delete, and retrieve posts.
- Python 3.6+
- Django 3.0+
- pip (Python package installer)
-
Clone the repository:
git clone https://github.com/IAmKushagraSharma/BlogAPI.git cd BlogAPI -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
-
Access the application: Open your browser and navigate to
http://localhost:8000. -
User Registration:
- Go to the signup page and create a new account.
- Verify your email through the verification link sent to your email.
-
Login:
- Use your registered email and password to log in.
-
Create a Post:
- Once logged in, navigate to the posts section.
- Create, edit, or delete posts as needed.
-
Authentication:
POST /api/v1/auth/login/- Login userPOST /api/v1/auth/logout/- Logout userPOST /api/v1/auth/signup/- Register userPOST /api/v1/auth/password/change/- Change passwordPOST /api/v1/auth/password/reset/- Reset passwordPOST /api/v1/auth/password/reset/confirm/- Confirm password reset
-
User Management:
GET /api/v1/auth/user/- Get user detailsPUT /api/v1/auth/user/- Update user detailsPATCH /api/v1/auth/user/- Partially update user details
-
Posts:
GET /api/v1/posts/- List all postsPOST /api/v1/posts/- Create a new postGET /api/v1/posts/{id}/- Retrieve a specific postPUT /api/v1/posts/{id}/- Update a specific postPATCH /api/v1/posts/{id}/- Partially update a specific postDELETE /api/v1/posts/{id}/- Delete a specific post
-
Collect static files:
python manage.py collectstatic
-
Run the application in production: Use a production server like Gunicorn with Nginx.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
- Thanks to the Django community for their continuous support and contributions.