Steps to setup project on your machine:
git clone https://github.com/WarrenU/photofeed.git
cd photofeed
pip install virtualenv
virtualenv env
source env/bin/activate
chmod +x ./setup.sh
_ ./setup.sh
- Model that allows for Photographers to make Comment(s) on Photo(s).
- ModelViewSet allows for Create, Read, Update, Delete
Serves as link to django's user model, by having OneToOne w/ User. Useful
for showing who authored a photo or comment. Also a point of interest for
following other users. A Photographer has a location, so we are matching
Photographer's locations to locations of Photo objects, in our feed endpoint, see views.py
in photographers
app.
- ModelViewSet allows for Create, Read, Update, Delete
- PhotographerSerializer overrides create and update to handle User & Photographer editing.
- To see a photographer's Feed of photos near their location & of
photographers they are following, visit:
/photographers/1/feed/
- To follow a user, you could update via Post/Patch on the Photographer endpoint:
photographers/1/follow
, or do a post request to:photographers/1/follow
where the id in the url is who you want to follow (as a logged in user, ensured via IsAuthenticated).
Photos are uploaded by a Photographer, and are taken at a certain location. Provide a string to identify a location of where the Photo was. (Orange, Newport Beach, Irvine) for example.
- ModelViewSet allows for Create, Read, Update, Delete
- List view of comments is available:
/photos/1/comments/
, we are querying a list of Comment objects, related to Photo id 1, as per example with link:/photos/1/comments/
seeviews.py
inphotos
app.