Answer the question
In order to leave comments, you need to log in
What is the best way to implement a portfolio website with Django?
Hello. I am new to Django. As part of a study project, I need to implement a portfolio site.
I'll describe the idea, how I think it should work, and the problems I can't solve.
First, the database schema: user --(one-to-one)-> portfolio_list --(one-to-many)-> portfolio. The bottom line is that the user can create different portfolios on different topics.
A user logs into their account, creates a portfolio on a certain topic, and uses forms to upload content in a certain order.
Here arises problem number 0: how to store all this in the portfolio table? One user can upload 5 pictures with a description, while another can only upload text. It turns out that each line will be from a huge set of types with null? Yes, and loading through the forms does not look very hot.
Problem #1: I've worked with static pages before. Now how to make them dynamic? Those. each portfolio will have its own separate page with its own address. And this is exactly what I don't understand how to do.
Am I thinking right? Can you please at least write what django tools I need to implement this all? Any help is welcome)
Answer the question
In order to leave comments, you need to log in
Find a video on how to make a blog in django
DB can be done through postgres and pg4admin
Good afternoon!
Data structure
If the Portfolio sheet does not have a name and some additional attributes, then it is better to make a schema like this
user --(one-to-many)-> portfolio.
Since one portfolio can contain 1 or more records, we will add the concept of "Record"
user --(one-to-many)-> portfolio --(one-to-many)-> item
Storage
in the Items table, you can make fields
id - unique identifier
portfolio_id - link to the portfolio
title - image name
url - link to the image (images should be stored separately in S3 or other file storage)
description - description
Form
You can add dynamics using JS (React js, etc.) or make an "Add work" button on the portfolio view form and upload a picture with a description in a separate form.
For this, you will need React js (if the form is dynamic), django and some kind of library for working with pictures (reception on the server, storage) ... I can’t say more precisely, I didn’t work with django. On RoR I would take React js, Rails, Dragonfly and the work took 2 hours with account registration in aws S3 and Heroku.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question