dhmit / paris_1970

Fall 2020 Project: This was Paris in 1970
9 stars 5 forks source link

Move photo url generation to the backend as part of the Photo model #246

Closed ryaanahmed closed 2 years ago

ryaanahmed commented 2 years ago

Right now, the frontend tends to construct URLs for individual photos. We do this by passing the photoDir in app.views.render_view and in map_page etc.

We should shove all of this back into Photo, so that the frontend can just do photo.front_url and photo.slide_url (or some other similar structure: we may want to have a dict that holds many urls for different resolutions, e.g.,) instead, and we don't have to expose the photos dir to the frontend at all.