a Django clone of the website for the popular photo app Instagram.
As a user of the application I should be able to:
- Sign in to the application to start using. ✔️
- Upload my pictures to the application. ✔️
- See my profile with all my pictures. ✔️
- Follow other users and see their pictures on my timeline. ✔️
- Like a picture and leave a comment on it. ✔️
Your Project should contain an Image model with the following properties:
- Image
- Image Name.
- Image Caption.
- Profile Foreign key
- Likes
- Comments
Create the Profile model with the following properties:
- Profile Photo
- Bio
- Remember to make migrations to your database when you change the properties of the model.
Your Image model should contain at least the following methods:
- save_image() - Save an image to the database.
- delete_image() - Delete image from the database.
- update_caption() - Update image caption in the database.
You should write tests for each of these methods and make sure you implement error handlers to prevent your application from crashing.
- You must implement the save, update and delete methods in the models.
- Make sure you write tests for each method
Your project must have a search form that when submitted calls a search function in the view function and redirects to a search results page.
When a user clicks on an Image he/she should be redirected to where the image is displayed and should also see the details of the Image.
Your application should have a solid authentication system that allows users to sign in or register into the application before using it. When a user registers with your application they should receive a confirmation email.
- Python and pip (I am currently using 3.9.7) Any version above 3.7 should work.
- Git installed on your machine
- Code editor/ IDE
-
Clone GitHub repository
git clone https://github.com/KenMwaura1/zoo-gram
-
Change into the folder
cd zoo_gram
-
Create a virtual environment
python3 -m venv venv
- Activate the virtual environment
source ./bin/activate
-
If you are using pyenv:
3a. Create a virtualenv
pyenv virtualenv zoo_gram
3b. Activate the virtualenv
pyenv activate zoo_gram
-
Create a
.env
file and add your credentialstouch .env
OR Copy the included example
cp .env-example .env
-
Add your credentials to the
.env
file5a. Create a free cloudinary account and get your credentials to enable photo uploading deployed.
OR
5b. Uncomment line 15 and line 57 in z_gram/models.py to save and serve images locally.
-
Migrate your database
python manage.py migrate
-
Install the required dependencies
pip install -r requirements.txt
-
Make the shell script executable
chmod a+x ./run.sh
-
Run the app
./run.sh
OR run with python
python manage.py runserver
-
To run the tests:
python manage.py test
- Python-3.9.7
- Django web framework
- PostgreSQL
- Cloudinary
- Bootstrap(Material Bootstrap 4)
- HTML5
- CSS3
MIT License
Copyright (c) 2021 Kennedy Ngugi Mwaura
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.