This is my exercise based on the tutorials by Code With Stein Channel on Youtube https://www.youtube.com/watch?v=FN3EfKC2i6M&list=PLpyspNLjzwBkeyP_4_bZBdtRjZQreDR_H&index=2
Github repository: https://github.com/gurnitha/2022-django-multi-vendor-ytb-codewithstein
E:.
├───apps
│ ├───core
│ │ ├───migrations
│ │ │ └───__pycache__
│ │ └───__pycache__
│ ├───product
│ │ ├───migrations
│ │ │ └───__pycache__
│ │ └───__pycache__
│ └───vendor
│ ├───migrations
│ │ └───__pycache__
│ └───__pycache__
└───config
└───__pycache__
modified: README.md
modified: README.md
new file: apps/core/templates/core/base.html
new file: apps/core/templates/core/contact.html
new file: apps/core/templates/core/frontpage.html
new file: apps/core/urls.py
modified: apps/core/views.py
modified: config/urls.py
modified: README.md
modified: apps/core/templates/core/base.html
modified: apps/core/templates/core/frontpage.html
new file: apps/product/templates/product/category.html
new file: apps/product/templates/product/product.html
new file: apps/product/templates/product/search.html
new file: apps/product/urls.py
modified: apps/product/views.py
modified: config/urls.py
modified: apps/core/templates/core/base.html
new file: apps/vendor/templates/vendor/add_product.html
new file: apps/vendor/templates/vendor/become_vendor.html
new file: apps/vendor/templates/vendor/login.html
new file: apps/vendor/templates/vendor/vendor_admin.html
new file: apps/vendor/urls.py
modified: apps/vendor/views.py
modified: config/urls.py
modified: README.md
modified: apps/product/templates/product/product.html
modified: config/settings.py
modified: config/urls.py
new file: static/css/main.css
new file: static/img/img-large.jpeg
new file: static/img/img.jpeg
new file: static/js/main.js
STEPS:
1. Create model
2. Create migration
3. Apply migration
4. Register model to admin
modified: README.md
modified: apps/vendor/admin.py
new file: apps/vendor/migrations/0001_initial.py
modified: apps/vendor/models.py
STEPS:
1. In vendor/views.py:
- import UserCreationForm
- import redirect
2. In vendor/views.py (become_vendor)
- load UserCreationForm
- add logic to create a user
3. Load the form to become_vendor page
4. Test it out :)
modified: README.md
modified: apps/vendor/templates/vendor/become_vendor.html
modified: apps/vendor/views.py
STEPS:
1. Import login_required
2. Create instance of the user (vendor)
3. Use is_authenticated method to show link
to authenticated user
4. Test it out :)
modified: README.md
modified: apps/core/templates/core/base.html
modified: apps/vendor/templates/vendor/vendor_admin.html
modified: apps/vendor/views.py
STEPS:
1. In vendor/urls.py: Import auth_views
2. Use it to create path to logout
3. Add link to vendor_admin to logout
4. Test it out :)
NOTE: After logging out, it return to admin panel page
modified: README.md
modified: apps/vendor/templates/vendor/vendor_admin.html
modified: apps/vendor/urls.py
modified: apps/vendor/templates/vendor/login.html
modified: apps/vendor/urls.py
modified: apps/vendor/views.py
modified: config/settings.py
modified: README.md
modified: apps/vendor/templates/vendor/become_vendor.html
modified: apps/vendor/urls.py
modified: apps/vendor/views.py
modified: config/settings.py
modified: README.md
modified: apps/product/admin.py
new file: apps/product/migrations/0001_initial.py
modified: apps/product/models.py
modified: README.md
modified: apps/vendor/templates/vendor/vendor_admin.html
modified: apps/vendor/views.py
modified: README.md
new file: apps/vendor/forms.py
modified: apps/vendor/templates/vendor/add_product.html
modified: apps/vendor/views.py
new file: media/uploads/img-large.jpeg
new file: media/uploads/img-large_uQsXPIi.jpeg
modified: README.md
modified: apps/core/templates/core/frontpage.html
modified: apps/core/views.py
new file: media/uploads/uploads/img-large_uQsXPIi.jpeg
modified: static/css/main.css
NOTE: It shows error, I could not fix it
NoReverseMatch at /
Reverse for 'product' with arguments '('', '')' not found. 1 pattern(s) tried: ['(?P<category_slug>[-a-zA-Z0-9_]+)/(?P<product_slug>[-a-zA-Z0-9_]+)/$']
modified: README.md
modified: apps/core/templates/core/frontpage.html
modified: apps/product/templates/product/product.html
modified: apps/product/urls.py
modified: apps/product/views.py