Skip to content

Commit

Permalink
Phase2 -------- partial 5 (#98)
Browse files Browse the repository at this point in the history
* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD (#75)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase 2 partial ------ 3 (#73)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch (#77)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* Code Refactor (#67)

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* Issue #54: switched from class based views to function based views, moved styles to seprate files and changed the general structure of the project to be more intuitive

* more refactoring

* more refactor -- added new prettier rules and prettified more files not being covered by prettier initially

* Customized form submission error (#80)

* fixed issue #25 --- initial

* prettified

* fixed issue #34: Increased upload image size, added image compression and functionality to remove image metadata (#79)

* Removed line behind dob field label on the signup page (#81)

* fixed issue #26: removed line behind DOB input label

* fixed issue #26: removed line behind DOB field text in signup --- patch

* fixed issue #52: Added help text to project creation desc field (#82)

* fixed issue #59: Added projects, followers and following links to profile dropdown menu (#86)

* added functionality to show creators we are following (#83)

* added functionality to show creators we are following

* fixed issue #58: added functionality to show creators we are following --- patch

* First Iteration of CI/CD workflow (#89)

* Added more actions to profile dropdown (#84)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD (#75)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase 2 partial ------ 3 (#73)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch (#77)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* Code Refactor (#67)

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* Issue #54: switched from class based views to function based views, moved styles to seprate files and changed the general structure of the project to be more intuitive

* more refactoring

* more refactor -- added new prettier rules and prettified more files not being covered by prettier initially

* Customized form submission error (#80)

* fixed issue #25 --- initial

* prettified

* fixed issue #34: Increased upload image size, added image compression and functionality to remove image metadata (#79)

* Removed line behind dob field label on the signup page (#81)

* fixed issue #26: removed line behind DOB input label

* fixed issue #26: removed line behind DOB field text in signup --- patch

* fixed issue #52: Added help text to project creation desc field (#82)

* fixed issue #59: Added projects, followers and following links to profile dropdown menu

* Revert "Added more actions to profile dropdown (#84)" (#85)

This reverts commit 271408a.

* ci/cd ---- test 1

* Second Iteration of CI/CD (#90)

* Added more actions to profile dropdown (#84)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD (#75)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase 2 partial ------ 3 (#73)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch (#77)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* Code Refactor (#67)

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* Issue #54: switched from class based views to function based views, moved styles to seprate files and changed the general structure of the project to be more intuitive

* more refactoring

* more refactor -- added new prettier rules and prettified more files not being covered by prettier initially

* Customized form submission error (#80)

* fixed issue #25 --- initial

* prettified

* fixed issue #34: Increased upload image size, added image compression and functionality to remove image metadata (#79)

* Removed line behind dob field label on the signup page (#81)

* fixed issue #26: removed line behind DOB input label

* fixed issue #26: removed line behind DOB field text in signup --- patch

* fixed issue #52: Added help text to project creation desc field (#82)

* fixed issue #59: Added projects, followers and following links to profile dropdown menu

* Revert "Added more actions to profile dropdown (#84)" (#85)

This reverts commit 271408a.

* ci/cd ---- test 1

* ci/cd ---- test 2

* third iteration of CI/CD (#91)

* Added more actions to profile dropdown (#84)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD (#75)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase 2 partial ------ 3 (#73)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch (#77)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* Code Refactor (#67)

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* Issue #54: switched from class based views to function based views, moved styles to seprate files and changed the general structure of the project to be more intuitive

* more refactoring

* more refactor -- added new prettier rules and prettified more files not being covered by prettier initially

* Customized form submission error (#80)

* fixed issue #25 --- initial

* prettified

* fixed issue #34: Increased upload image size, added image compression and functionality to remove image metadata (#79)

* Removed line behind dob field label on the signup page (#81)

* fixed issue #26: removed line behind DOB input label

* fixed issue #26: removed line behind DOB field text in signup --- patch

* fixed issue #52: Added help text to project creation desc field (#82)

* fixed issue #59: Added projects, followers and following links to profile dropdown menu

* Revert "Added more actions to profile dropdown (#84)" (#85)

This reverts commit 271408a.

* ci/cd ---- test 1

* ci/cd ---- test 2

* ci/cd ---- test 3

* Update build_deploy_backend.yml

manually added manual workflow dispatch to github actions file

* Fourth Iteration of CI/CD (#92)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* Added more actions to profile dropdown (#84)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD (#75)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase 2 partial ------ 3 (#73)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch (#77)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* Code Refactor (#67)

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* Issue #54: switched from class based views to function based views, moved styles to seprate files and changed the general structure of the project to be more intuitive

* more refactoring

* more refactor -- added new prettier rules and prettified more files not being covered by prettier initially

* Customized form submission error (#80)

* fixed issue #25 --- initial

* prettified

* fixed issue #34: Increased upload image size, added image compression and functionality to remove image metadata (#79)

* Removed line behind dob field label on the signup page (#81)

* fixed issue #26: removed line behind DOB input label

* fixed issue #26: removed line behind DOB field text in signup --- patch

* fixed issue #52: Added help text to project creation desc field (#82)

* fixed issue #59: Added projects, followers and following links to profile dropdown menu

* Revert "Added more actions to profile dropdown (#84)" (#85)

This reverts commit 271408a.

* ci/cd ---- test 1

* ci/cd ---- test 2

* ci/cd ---- test 3

* Added functionalities to update and delete projects (#88)

* fixed issue #87: Added project edit functionality

* fixed issue #87: Added project edit and delete functionality --- patch

* Internationalization  (#74)

* issue #55: internationalization

* issue #55: internationalization --- patch

* issue #55: internationalization --- changed snake-case to camel-case

* Added more actions to profile dropdown (#84)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD (#75)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase 2 partial ------ 3 (#73)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch (#77)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* Code Refactor (#67)

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* Issue #54: switched from class based views to function based views, moved styles to seprate files and changed the general structure of the project to be more intuitive

* more refactoring

* more refactor -- added new prettier rules and prettified more files not being covered by prettier initially

* Customized form submission error (#80)

* fixed issue #25 --- initial

* prettified

* fixed issue #34: Increased upload image size, added image compression and functionality to remove image metadata (#79)

* Removed line behind dob field label on the signup page (#81)

* fixed issue #26: removed line behind DOB input label

* fixed issue #26: removed line behind DOB field text in signup --- patch

* fixed issue #52: Added help text to project creation desc field (#82)

* fixed issue #59: Added projects, followers and following links to profile dropdown menu

* Revert "Added more actions to profile dropdown (#84)" (#85)

This reverts commit 271408a.

* fixed merge conflicts while merging i18n to phase2 and made other improvements

* Added feature for editing and deleting of user profiles (#97)

* Added more actions to profile dropdown (#84)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD (#75)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase 2 partial ------ 3 (#73)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch (#77)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend

* separated docker-compose files into dev and prod in preparation for CI/CD --- patch

* made deploy_frontend.sh more explanatory

* Code Refactor (#67)

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* Issue #54: switched from class based views to function based views, moved styles to seprate files and changed the general structure of the project to be more intuitive

* more refactoring

* more refactor -- added new prettier rules and prettified more files not being covered by prettier initially

* Customized form submission error (#80)

* fixed issue #25 --- initial

* prettified

* fixed issue #34: Increased upload image size, added image compression and functionality to remove image metadata (#79)

* Removed line behind dob field label on the signup page (#81)

* fixed issue #26: removed line behind DOB input label

* fixed issue #26: removed line behind DOB field text in signup --- patch

* fixed issue #52: Added help text to project creation desc field (#82)

* fixed issue #59: Added projects, followers and following links to profile dropdown menu

* Revert "Added more actions to profile dropdown (#84)" (#85)

This reverts commit 271408a.

* fixed issue #57: Made user profile details fully editable, and allowed creators to delete their accounts

* merged phase2 into make_profile_fully_editable

* prettified

* phase2 ----- partial 5 ---- patch
  • Loading branch information
NdibeRaymond authored Jan 28, 2021
1 parent bf72418 commit 314f130
Show file tree
Hide file tree
Showing 49 changed files with 3,063 additions and 726 deletions.
4 changes: 3 additions & 1 deletion zubhub_backend/zubhub/creators/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ class CreatorSerializer(serializers.ModelSerializer):
id = serializers.UUIDField(read_only=True)
followers = serializers.SlugRelatedField(
slug_field="id", read_only=True, many=True)
location = serializers.SlugRelatedField(
slug_field='name', queryset=Location.objects.all())

class Meta:
model = Creator
fields = ('id', 'username', 'email', 'avatar',
fields = ('id', 'username', 'email', 'avatar', 'location',
'dateOfBirth', 'bio', 'followers', 'following_count', 'projects_count')


Expand Down
1 change: 1 addition & 0 deletions zubhub_backend/zubhub/creators/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
urlpatterns = [
path('authUser/', auth_user_api_view, name='auth_user_detail'),
path('edit_creator/', EditCreatorAPIView.as_view(), name='edit_creator'),
path('delete/', DeleteCreatorAPIView.as_view(), name='delete_creator'),
path('locations/', LocationListAPIView.as_view(), name='location_list'),
path('<str:username>/projects/',
UserProjectsAPIView.as_view(), name="user_projects"),
Expand Down
14 changes: 13 additions & 1 deletion zubhub_backend/zubhub/creators/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from rest_framework.decorators import api_view, permission_classes
from rest_framework.generics import UpdateAPIView, RetrieveAPIView, ListAPIView
from rest_framework.generics import UpdateAPIView, RetrieveAPIView, ListAPIView, DestroyAPIView
from rest_framework.permissions import IsAuthenticated, AllowAny, IsAuthenticatedOrReadOnly
from rest_framework.response import Response
from projects.serializers import ProjectListSerializer
Expand Down Expand Up @@ -44,6 +44,18 @@ def get_object(self):
return obj


class DeleteCreatorAPIView(DestroyAPIView):
queryset = Creator.objects.all()
serializer_class = CreatorSerializer
permission_classes = [IsAuthenticated, IsOwner]
lookup_field = "pk"

def get_object(self):
obj = self.queryset.get(pk=self.request.user.pk)
self.check_object_permissions(self.request, obj)
return obj


class UserProjectsAPIView(ListAPIView):
serializer_class = ProjectListSerializer
permission_classes = [AllowAny]
Expand Down
Binary file not shown.
86 changes: 86 additions & 0 deletions zubhub_backend/zubhub/locale/hi/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Translation of custom error messages to hindi.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST Ndibe Raymond <[email protected]>, 2021.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-10 06:00+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FIRST Ndibe Raymond <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: hindi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: zubhub/creators/serializers.py:46
msgid "Date of Birth must be less than today's date"
msgstr "जन्म तिथि आज की तारीख से कम होनी चाहिए"

#: zubhub/creators/serializers.py:51
msgid "Location is required"
msgstr "स्थान की आवश्यकता है"

#: zubhub/projects/serializers.py:68 zubhub/projects/serializers.py:74
msgid "you must provide either image(s) or video url"
msgstr "आपको छवि या वीडियो url प्रदान करना चाहिए"

#: zubhub/templates/account/email/email_confirmation_message.txt:6
msgid "Hello from "
msgstr "से नमस्कार "

#: zubhub/templates/account/email/email_confirmation_message.txt:7
#, python-format
msgid ""
"\n"
"You're receiving this e-mail because user %(user_display)s has given yours "
"as an e-mail address to connect their account.\n"
msgstr ""
"\n"
"आप यह ई-मेल प्राप्त कर रहे हैं क्योंकि उपयोगकर्ता %(user_display)s ने आपका दिया है"
"उनके खाते को जोड़ने के लिए एक ई-मेल पते के रूप में। \n"

#: zubhub/templates/account/email/email_confirmation_message.txt:10
msgid "To confirm this is correct, go to "
msgstr "यह सही है, इसकी पुष्टि करने के लिए "

#: zubhub/templates/account/email/email_confirmation_message.txt:12
msgid "Thank you from"
msgstr "से साभार"

#: zubhub/templates/account/email/email_confirmation_subject.txt:3
msgid "Please Confirm Your E-mail Address"
msgstr "कृपया अपने ईमेल पते की पुष्टि करें"

#: zubhub/templates/registration/password_reset_email.html:4
msgid ""
"You're receiving this email because you requested a password reset for your "
"user account at "
msgstr ""
"आप यह ईमेल प्राप्त कर रहे हैं क्योंकि आपने अपने लिए पासवर्ड रीसेट का अनुरोध किया है "
"उपयोगकर्ता खाता "

#: zubhub/templates/registration/password_reset_email.html:5
msgid "Please go to the following page and choose a new password:"
msgstr "कृपया निम्न पृष्ठ पर जाएं और एक नया पासवर्ड चुनें:"

#: zubhub/templates/registration/password_reset_email.html:10
msgid "Your username, in case you've forgotten:"
msgstr "आपका उपयोगकर्ता नाम, यदि आप भूल गए हैं:"

#: zubhub/templates/registration/password_reset_email.html:11
msgid "Thanks for using our site!"
msgstr "हमारी साइट का उपयोग करने के लिए धन्यवाद!"

#: zubhub/templates/registration/password_reset_email.html:12
msgid "The "
msgstr "यह "

#: zubhub/templates/registration/password_reset_email.html:12
msgid " Team"
msgstr "टीम"
29 changes: 22 additions & 7 deletions zubhub_backend/zubhub/projects/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@
admin.site.index_title = "ZubHub Administration"


class ImageAdmin(admin.ModelAdmin):
# model = Image
search_fields = ["project__title", "image_url"]
list_display = ["image_url"]


class CommentAdmin(admin.ModelAdmin):
# model = Comment
list_display = [
"text", "created_on"]
search_fields = ["project__tite", "creator__username",
"text", "created_on"]
list_filter = ["created_on"]


class ProjectImages(admin.StackedInline):
model = Image

Expand All @@ -17,17 +32,17 @@ class ProjectComments(admin.StackedInline):


class ProjectAdmin(admin.ModelAdmin):
list_display = ("title", "creator", "views_count", "likes_count",
"comments_count", "created_on", "published")
search_fields = ("title", 'creator__username', 'creator__email',
"created_on")
list_filter = ('created_on', "published")
list_display = ["title", "creator", "views_count", "likes_count",
"comments_count", "created_on", "published"]
search_fields = ["title", 'creator__username', 'creator__email',
"created_on"]
list_filter = ['created_on', "published"]
inlines = [ProjectImages, ProjectComments]

def get_readonly_fields(self, request, obj=None):
return ["id", "slug", "views_count", "likes_count", "comments_count", "created_on"]


admin.site.register(Project, ProjectAdmin)
admin.site.register(Image)
admin.site.register(Comment)
admin.site.register(Image, ImageAdmin)
admin.site.register(Comment, CommentAdmin)
3 changes: 3 additions & 0 deletions zubhub_backend/zubhub/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ class Comment(models.Model):
text = models.CharField(max_length=10000)
created_on = models.DateTimeField(default=timezone.now)

def __str__(self):
return self.text

def save(self, *args, **kwargs):
self.project.save()
super().save(*args, **kwargs)
8 changes: 8 additions & 0 deletions zubhub_backend/zubhub/projects/permissions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from rest_framework.permissions import BasePermission


class IsOwner(BasePermission):
message = "You must be the owner of this object to perform this function"

def has_object_permission(self, request, view, object):
return object.creator.pk == request.user.pk
30 changes: 30 additions & 0 deletions zubhub_backend/zubhub/projects/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.contrib.auth import get_user_model
from creators.serializers import CreatorSerializer
from .models import Project, Comment, Image
import time


Creator = get_user_model()
Expand Down Expand Up @@ -81,6 +82,35 @@ def create(self, validated_data):
Image.objects.create(project=project, **image)
return project

def update(self, project, validated_data):
images_data = validated_data.pop('images')

project.title = validated_data.pop("title")
project.description = validated_data.pop("description")
project.video = validated_data.pop("video")
project.materials_used = validated_data.pop("materials_used")

project.save()

images = project.images.all()
images_to_save = []
if len(images) != len(images_data):
for image_dict in images_data:
exist = False
for image in images:
if image_dict["image_url"] == image.image_url:
exist = True
if not exist:
images_to_save.append(image_dict)

for image in images:
image.delete()

for image in images_to_save:
Image.objects.create(project=project, **image)

return project


class ProjectListSerializer(serializers.ModelSerializer):
creator = CreatorSerializer(read_only=True)
Expand Down
12 changes: 2 additions & 10 deletions zubhub_backend/zubhub/projects/signals.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.db.models.signals import pre_delete, post_save
from django.dispatch import receiver
import boto3
from django.conf import settings
from .tasks import delete_image_from_DO_space
from .models import Project, Image


Expand All @@ -13,11 +12,4 @@ def project_saved(sender, instance, **kwargs):

@receiver(pre_delete, sender=Image)
def image_to_be_deleted(sender, instance, **kwargs):
session = boto3.session.Session()
client = session.client('s3',
region_name=settings.DOSPACE_REGION,
endpoint_url=settings.DOSPACE_ENDPOINT_URL,
aws_access_key_id=settings.DOSPACE_ACCESS_KEY_ID,
aws_secret_access_key=settings.DOSPACE_ACCESS_SECRET_KEY)

client.delete_object(Bucket="zubhub", Key=instance.public_id)
delete_image_from_DO_space.delay("zubhub", instance.public_id)
21 changes: 21 additions & 0 deletions zubhub_backend/zubhub/projects/tasks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import boto3
from django.conf import settings
from celery import shared_task

from random import uniform


@shared_task(bind=True, acks_late=True, max_retries=10)
def delete_image_from_DO_space(self, bucket, key):
session = boto3.session.Session()
client = session.client('s3',
region_name=settings.DOSPACE_REGION,
endpoint_url=settings.DOSPACE_ENDPOINT_URL,
aws_access_key_id=settings.DOSPACE_ACCESS_KEY_ID,
aws_secret_access_key=settings.DOSPACE_ACCESS_SECRET_KEY)

try:
client.delete_object(Bucket=bucket, Key=key)
except Exception as e:
raise self.retry(exc=e, countdown=int(
uniform(2, 4) ** self.request.retries))
2 changes: 2 additions & 0 deletions zubhub_backend/zubhub/projects/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
urlpatterns = [
path('', ProjectListAPIView.as_view(), name='list_projects'),
path('create/', ProjectCreateAPIView.as_view(), name='create_project'),
path('<uuid:pk>/update/', ProjectUpdateAPIView.as_view(), name='update_project'),
path('<uuid:pk>/delete/', ProjectDeleteAPIView.as_view(), name='delete_project'),
path('saved/', SavedProjectsAPIView.as_view(), name="saved_projects"),
path('<uuid:pk>/toggle_like/',
ToggleLikeAPIView.as_view(), name="toggle_like"),
Expand Down
28 changes: 24 additions & 4 deletions zubhub_backend/zubhub/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from rest_framework.response import Response
from django.contrib.auth.models import AnonymousUser
from rest_framework import status
from rest_framework.generics import CreateAPIView, ListAPIView, RetrieveAPIView
from rest_framework.generics import UpdateAPIView, CreateAPIView, ListAPIView, RetrieveAPIView, DestroyAPIView
from rest_framework.permissions import IsAuthenticated, IsAuthenticatedOrReadOnly, AllowAny
from creators.permissions import IsOwner
from projects.permissions import IsOwner
from .models import Project
from .serializers import ProjectSerializer, ProjectListSerializer, CommentSerializer
from .pagination import ProjectNumberPagination
Expand All @@ -19,6 +19,26 @@ def perform_create(self, serializer):
serializer.save(creator=self.request.user)


class ProjectUpdateAPIView(UpdateAPIView):
queryset = Project.objects.all()
serializer_class = ProjectSerializer
permission_classes = [IsAuthenticated, IsOwner]

def perform_update(self, serializer):
serializer.save(creator=self.request.user)


class ProjectDeleteAPIView(DestroyAPIView):
queryset = Project.objects.all()
serializer_class = ProjectSerializer
permission_classes = [IsAuthenticated, IsOwner]

def delete(self, request, *args, **kwargs):
result = self.destroy(request, *args, **kwargs)
request.user.save()
return result


class ProjectListAPIView(ListAPIView):
queryset = Project.objects.filter(published=True).order_by("-created_on")
serializer_class = ProjectListSerializer
Expand Down Expand Up @@ -62,7 +82,7 @@ def get_queryset(self):

class ToggleLikeAPIView(RetrieveAPIView):
serializer_class = ProjectSerializer
permission_classes = [IsAuthenticatedOrReadOnly]
permission_classes = [IsAuthenticated]

def get_queryset(self):
return Project.objects.filter(published=True)
Expand All @@ -83,7 +103,7 @@ def get_object(self):

class ToggleSaveAPIView(RetrieveAPIView):
serializer_class = ProjectSerializer
permission_classes = [IsAuthenticatedOrReadOnly]
permission_classes = [IsAuthenticated]

def get_queryset(self):
return Project.objects.filter(published=True)
Expand Down
3 changes: 3 additions & 0 deletions zubhub_backend/zubhub/zubhub/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
Expand Down Expand Up @@ -229,6 +230,8 @@

USE_TZ = True

LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
Expand Down
Loading

0 comments on commit 314f130

Please sign in to comment.