Welcome to the Bookstore Project! This project is designed to help you learn Django and understand its core concepts through a practical application. Below you'll find detailed information on the project's setup, features, and usage.
- Project Overview
- Features
- Technologies Used
- Installation
- Usage
- API Documentation
- Learning Outcomes
- Contributing
- License
The Bookstore Project is a web application developed using Django. It features a dynamic interface for browsing and managing a collection of books. The project includes user authentication, book listings, and a user profile section that demonstrates the use of REST APIs and Ajax for asynchronous data fetching.
- User Authentication: Register, login, and manage user accounts.
- Book Listings: View, add, edit, and delete book entries.
- User Profiles: Update user profile information using REST APIs and Ajax.
- Django Templates: Render dynamic HTML content using Django templates.
- Class-Based and Functional Views: Compare and understand the use of both types of views in Django.
- API Documentation with Swagger: Interactive API documentation generated using Swagger.
- Django: Web framework for developing the application.
- Django REST Framework: For building RESTful APIs.
- Swagger: For API documentation.
- Ajax: For asynchronous data fetching and updating user profiles.
- SQLite: Default database for development.
Follow these steps to set up the project locally:
-
Clone the repository:
git clone https://github.com/your-username/bookstore-project.git cd bookstore-project
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
-
Open your browser and navigate to
http://127.0.0.1:8000
.
- Homepage: Browse the list of books.
- User Registration/Login: Create a new account or log in to an existing account.
- Book Management: Add, edit, and delete books from your collection.
- Profile Management: Update your profile information using the user profile page.
- GET /api/profile/: Retrieve user profile information.
- PUT/PATCH /api/profile/: Update user profile information.
$.ajax({
url: '/api/profile/',
type: 'GET',
success: function(data) {
console.log(data);
}
});
By working on this project, you'll gain a better understanding of:
- Django's class-based and functional views.
- Working with Django templates for dynamic content rendering.
- Building and consuming RESTful APIs using Django REST Framework.
- Using Ajax for asynchronous operations in web applications.
Contributions are welcome! If you'd like to contribute, please fork the repository and create a pull request with your changes. For major changes, please open an issue first to discuss what you'd like to change.
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
. - Make your changes and commit them:
git commit -m 'Add some feature'
. - Push to the branch:
git push origin feature-branch
. - Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to customize the sections further to fit your project and preferences!