this repo presents a website where you can look for data science books and discuss data science topics. the website is built using Django3 Bootstrap4 with Postgresql database. i hosted a lite version of this project on heroku platform see it here
there is two applications of machine learning algorithms in this project:
- Content Based Recommander System to similars to each book you can see the notebook where i build this recommander system using nlp(in this repo).
- Super users can uppload new books so to ensure that they uppload only it books i built a book classifier that can classify books based on their descriptions on IT books or Not you can find more details about this classifier in this repo
- clone the repo:
- if you have git installed:
git clone https://github.com/YassineZITI/django-ds-books/edit/main/README.md
- if you don't. use this website to download the repo.
- set up envirement:
pip install virtualenv
virtualenv venv
pip install -r requirements.txt
- Database:
- you need a postgres database for this project(we use an array field wich is available only in postgres django).
- replace the database configuration in settings.py file with yours.
python manage.py makemigrations
python manage.py migrate
- now you need some data(books) see next step.
- populate database:
in this repo there are files called books.json and categories.json you will use those files to populate your database.
py manage.py loaddata categories.json
py manage.py loaddata books.json
if you didn't succeed with the 1st method you can use app_data.pkl and categories.pkl with the following steps instead.
- open your commande prompt and type
py manage.py shell
from blog.models import Book,Category
import pickle
with open('app_data.pkl','rb') as f:
- indentation
books = pickle.load(f)
with open('categories.pkl','rb') as f:
- indentation
categories = pickle.load(f)
for i in categories:
- indentation
category = Category(name=i)
- indentation ` category.save()
for i in books:
- indentation
book=Book(ISBN=i['isbn13'],title=i['title'],description=i['description'],author=i['authors'],publisher=i['publisher'],published=i['year'],pages=i['pages'],stars=i['rating'],price=i['price'],image=i['image'],category=Category.objects.get(name=i['category']),similar_books=i['similar'],embedding=i['embedding'])
- indentation
book.save()
- start server:
py manage.py runserver
- add like option on posts and comments.
- add models for machine learning models.
- add profile section for users.
- add admin dashboard.
- ...
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. Please star the repo and feel free to use it. ....