Needful Things
Needful Things is a simple e-commerce website. It is a Django application that uses MongoDB as the main database and it also uses a local SQLite database to keep sessions. It is deployed on Render at https://e-commerce-20ct.onrender.com/index.html
It's frontend is developed using HTML, CSS and JavaScript on top of DarkLook Theme. It uses Bootstrap for styling and jQuery for some of the functionalities.
All the urls and endpoints used by the system are listed below:
https://e-commerce-20ct.onrender.com/index.html
https://e-commerce-20ct.onrender.com/product/<str:product_id>/<str:product_name>
https://e-commerce-20ct.onrender.com/user/<str:username>
https://e-commerce-20ct.onrender.com/login.html
https://e-commerce-20ct.onrender.com/login-action.html
https://e-commerce-20ct.onrender.com/logout.html
https://e-commerce-20ct.onrender.com/admin.html
https://e-commerce-20ct.onrender.com/delete_user/<str:username>
https://e-commerce-20ct.onrender.com/delete_product/<str:product_id>
https://e-commerce-20ct.onrender.com/create_user.html
https://e-commerce-20ct.onrender.com/create_product.html
How to Login
- Go to https://e-commerce-20ct.onrender.com/login.html
- Enter
harry91
as username andp455w0rd
as password (or any other username on the system, they all have the same password) - Click on
Login
button
Log in as Admin
- Go to https://e-commerce-20ct.onrender.com/login.html
- Enter
mrneedful
as username andp455w0rd
as password - Click on
Login
button - You can visit admin panel by clicking on
admin
button on the top of the website or by visiting https://e-commerce-20ct.onrender.com/admin.html
Populating the Database
I have created a script that populates the database with some dummy data. You can run it uncommenting last 4 lines in the utils.py
file.
How to Run Locally
- Clone the repository
- Create a virtual environment
- Install the requirements
- Do migrations
- Create a prod.env file in the root directory of the project and add the following lines to it:
DEBUG=on
DATABASE_URL=mongodb+srv://...
- Run the server
git clone
cd e-commerce
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
Used Technologies
- HTML
- CSS
- JavaScript
- Bootstrap
- jQuery
- Django
- MongoDB
- SQLite