{"id":20255434,"url":"https://github.com/qbason/django_portfolio","last_synced_at":"2026-04-03T23:36:36.513Z","repository":{"id":184806821,"uuid":"530653650","full_name":"Qbason/Django_Portfolio","owner":"Qbason","description":"Django portfolio using HTML, CSS, JS, Django, Django REST Framework, Python, PostgreSQL, Docker, Bash","archived":false,"fork":false,"pushed_at":"2022-09-18T09:04:38.000Z","size":5428,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T17:47:00.494Z","etag":null,"topics":["apache2","bash","css","django","django-rest-framework","docker","docker-compose","dockerfile","html","js","json","letencrypt","postgresql","python3"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Qbason.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-08-30T12:46:53.000Z","updated_at":"2022-09-07T07:25:04.000Z","dependencies_parsed_at":"2023-07-30T11:38:38.021Z","dependency_job_id":null,"html_url":"https://github.com/Qbason/Django_Portfolio","commit_stats":null,"previous_names":["qbason/django_portfolio"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Qbason/Django_Portfolio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qbason%2FDjango_Portfolio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qbason%2FDjango_Portfolio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qbason%2FDjango_Portfolio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qbason%2FDjango_Portfolio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Qbason","download_url":"https://codeload.github.com/Qbason/Django_Portfolio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qbason%2FDjango_Portfolio/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260341251,"owners_count":22994629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache2","bash","css","django","django-rest-framework","docker","docker-compose","dockerfile","html","js","json","letencrypt","postgresql","python3"],"created_at":"2024-11-14T10:38:41.918Z","updated_at":"2025-12-30T19:52:04.740Z","avatar_url":"https://github.com/Qbason.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Portfolio made using Django\n## HTML, CSS, JS, Django, Django REST Framework, Python, PostgreSQL, Docker, Bash, Apache2, Let's Encrypt\n## Portfolio webpage\nWelcome to \n### [jakubk.pl](http://jakubk.pl)\n to see how does it work\n## PostrgreSQL\n### **Program contains only one model:**\nContentWebPage, which has fields like  \n**name** -\u003e CharField max length 100  \n**language** -\u003e CharField max length 5  \n**content** -\u003e JsonField (only in postgresSQL)  \n\n\nfor each field name content has another build (JSON!):  \n- for name =  **whoami**  \n    - first_info  \n    - studied_about  \n    - programming_languages  \n    - end_info  \n    - date_of_adding  \n\n- for name = **cv**\n    - telephone_text  \n    - telephone  \n    - date_of_birth  \n    - town  \n    - work_experience_title  \n    - work_experience:  \n        - period\n        - title\n        - where\n    - education_title\n    - education:\n        - period\n        - where\n        - major\n        - specialization\n        - education_level\n    - skills_title\n    - skills:\n    - programming:[list]\n    - systems:[list]\n    - network:[list]\n    - others:[list]\n    - training_courses_title\n    - training_courses:\n        - date\n        - name\n    - interests_title\n    - interests:[list]\n    - link_title\n    - link:\n        - github\n        - microsoft\n        - linkedin\n\n- for name = **contact**\n    - phone_number_info:str\n    - phone_number:str\n    - email_info:str\n    - email:str\n\nspecial row for links in navbar\n- for name = **navbarlinks**\n    - whoami: str\n    - cv: str\n    - contanct: str\n\n\nEach page on website has her own name like whoami, cv, contact.  \nIn this way per one page is one record in the table.  \nLanguage field contains shortened name of language.  \nIn my case I have PL for polish language on page\nand EN to english language on page.\n\nSpecial row for links in navbar is called navbarlinks(name in db).\nIf the navbarlinks is not founded 404 is thrown.\n\n\n**Why do I choose this approoach?**\n1. Simply adding new pages, by adding new record.\n2. Quickly and easily editing the specific page with specific language.\n3. In this case we do not need any relationship. (this simply model).\n\n**Cons:**\n- We need to document all content with all his types, which are created on specific page.  \nIt helps us to know, which field we can also add.  \nEx. name = contact, content -\u003e phone_number is for containg phone number\n\n\n## Django\nWe have two templates in templates called index.html and 404.html  \nIf page would not be found then template 404.html will be generated.  \nIn index.html file we have references to specific content in the model.  \nLike {{cv.content.date_of_birth}} -\u003e from model where name = cv takes content.date_of_birth json.   \nThis allows me to generate specific content in specific place.\n\n## Django rest api\nTo easily upload data to database I created endpoint,  \nwhere I can get,post,put,delete to do also another actions.  \nI applied BasicAuth to rest api to make sure, that \nonly me can have access to this page.  \nThere is an option to upload content or modify by Django administrion.\n\nIn future rest api can be used to send request from frontend application,  \nwhere someone could upload, edit, delete specific content in portfolio.\n\n## HTML JS\nUsing JS I made that we do not follow to each page separately.\nBut whole page is downloaded once.  \nThe JS controlls, which content will be loaded.\n## CSS \nBootstrap is used to make it responsive.  \nWebapge works on phones, tablets, PC's.\n\n## Apache\nTo make it full working page I decided to run our django project using apache.  \nIn dockerfile I declared, which packages should be installed to make sure, that  \neverything is wokring correctly.\n\n## HTTPS\nOur project serves ssl. To get free ssl I used let's encrypt project.\n\n## Docker\nOur environment is prepared in docker.  \nThis solution makes easier running our project and do editing it.\n\n# How to run?\n### We need to have installed:\n- Docker\n- Docker compose\n\nThe necesarry packages will be downloaded in container.\n## First to run\nTo get the ssl from let's encrypt. (You need to have your own domain)  \nGo to generator_lets_encrypt then go to .env and change to yours:  \n\n        email=youremail@gmail.com\n        server_full_name=www.domain.com\n        server_name=domain.com\n\nIn generator_lets_encrypt/ directory run:  \n\n        sudo docker compose up le-apache -d  \n        sudo docker compose up certbot  \nMake sure that  port 80 is opened.  \nThen:\n\n    sudo docker compose down\n### Configuration main docker:\n- Change .env in main directory  \n    Setup your database name, user, password, email etc.\n\n        POSTGRES_DB=postgres\n        POSTGRES_USER=user\n        POSTGRES_PASSWORD=1234\n        PGADMIN_DEFAULT_EMAIL=yoursaddressemail\n        PGADMIN_DEFAULT_PASSWORD=1234\n        PGADMIN_LISTEN_PORT=8001\n\n- Go to portfolio_manager/porfolio_manger/ and create secret.py and generate SECRET_KEY value\n\n        SECRET_KEY = 'yoursecret'\n\n- Run your project for first time:\n    It can take a while.\n\n        sudo docker compose up --build\n\n\n- When your docker is running open new terminal and add superadmin for Django by:\n    If you would like to know, what is your id container then:\n\n        sudo docker ps\n    To run bash in our container:\n\n        sudo docker exec -it \u003cid_container\u003e bash\n    To add superuser:\n    \n        python manage.py run createsuperuser\n    Write down your username and password then exit.\n\n- go to 127.0.0.1:8000/api/contentwebpage (or 127.0.0.1:8000/admin) and log in  \n    then setup navbarlinks for example like:\n\n        name - \u003e navbarlinks\n        language - \u003e en\n        content -\u003e \n        {\n            \"cv\": \"CV\",\n            \"whoami\": \"Whoami?\",\n            \"contact\": \"Contact\"\n        }\n    You can decide, which language can be set, but you have remember to change urls.  \n    Default is \"pl\" and \"en\".\n\n    Then you have to add content for each page by sending for example:\n\n        name - \u003e whoami # it is the name from navbarlinks\n        language -\u003e en # default can be en/pl\n        content - \u003e\n        {\n            \"title\": \"Whoami?\",\n            \"end_info\": \"last paragraph\",\n            \"first_info\": \"first paragraph\",\n            \"localization\": \"localization\",\n            \"studied_about\": [\n                \"1 element\",\n                \"2 element\"\n                # Subjects, which I studied in secondary school\n                \n            ],\n            \"who_made_page\": \"Webpage was made by \",#by who\n            \"date_of_adding\": \"21:37 22.05.2012\",\n            \"programming_languages\": [\n                \"Bash\",\n                \"Batch\",\n                \"...\"\n                # learnt programming languages\n            ],\n            \"additional_information\": \"Additional informations\"\n        }\n    Then do it for another pages based on PosgreSQL model, which I described.\n\n- Change index.html to changing place content, replace specific images, css etc.\n\n- And that's it :) \n\n\n### Commands\n- sudo docker compose up --build  \u003c-- for first run, ctrl+c to cancel\n- sudo docker compose up -d \u003c-- to run docker container in background\n- sudo docker compose down \u003c-- to shutdown docker container\n\n\n### Ideas \nMake Flutter app to configure portfolio\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqbason%2Fdjango_portfolio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqbason%2Fdjango_portfolio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqbason%2Fdjango_portfolio/lists"}