I've been using the application Kanban Board
and the project board in GitHub to keep my project together. It has been working really well and has helped me structure up my work a lot. Trello was used on a more general plan and GitHub was used to plan and organize my user stories.
application draw.io.
Models used (besides standard user model) in this project are:
Just ask Blog website is a question-and-answer website where users can ask questions, answer questions, and interact with other users by liking or dislinking comments. It covers a wide range of topics from technology and business to health and entertainment. Users can follow topics, answer questions based on their expertise, and engage in discussions with a community of users. Just Ask's objective is to connect people with information and allow them to share knowledge and learn from each other.
The target audience is anyone curouis of the outside world and is interested to interact with other people.
like
or dislike
on postsdelete
or edit
his/her postsAs a thought process of the strategy plane, 9 epics were created and utilized. Please see below the detail list of epics with links, or a link to the project's Kanban Board. Those Epics were further sliced into USER STORIES.
User stories were created based on the Epics. Each user story uses the MoSCoW prioritization technique. Each user story on the Kanban Board was given (MoSCoW) labels.
Must-Have: Critical requirements that must be implemented for the project to be considered successful.
Should-Have: Important requirements that are not critical but add significant value.
Could-Haves: Desirable features that would be nice to have but are not crucial.
Won't-Have: Features that are explicitly excluded from the project scope.
I used primary, success, light, dark for my webpage as they are the defaults of bootstrap.
The banner explains what the website blog do and how to manover!
Template File : home.html
- extends base.html
Contains list of posts.
Provides user with all Posts published along with name of creator, date created and a snippet of Post body. Also number of votes and comments is provided to both logged in and not logged in users.
It is fully responsive and includes the just ask blog name on the left and member links and blog slogan on the right.
The blog name is wrapped in a link and can be used to navigate to the homepage.
After logging in, the links on the right side are replaced by the Read Later and a log-out button.
Every page has a footer at the bottom of the page.
The footer shows the copyright text and links to four different social media websites. Each link opens in a new tab.
User profile one can see all the reactions done by a user..
When you are in user profile and click view question like it takes you directly to the question and it highlights it like this.
Super user Admin can delete, edit and add all elements on the app. Back to top
AllAuth
extension*.html
in ./templates/account
- extends base.html
The responsive design tests were carried out manually with Google Chrome DevTools and Responsive Design.
Desktop | Display > 1280px | Display < 1280px |
---|---|---|
Render | pass | pass |
Links | pass | pass |
Images | pass | pass |
Tablet | Samsung Galaxy Tab 10 | Amazon Kindle Fire | iPad Mini | iPad Pro |
---|---|---|---|---|
Render | pass | pass | pass | pass |
Links | pass | pass | pass | pass |
Images | pass | pass | pass | pass |
Phone | Galaxy S5/S6/S7/S20+ | iPhone 6/7/8/ plus | iPhone 14pro max | |
---|---|---|---|---|
Render | pass | pass | pass | pass |
Links | pass | pass | pass | pass |
Images | pass | pass | pass | pass |
justask
blog was tested for functionality and appearance in the following browsers on desktop. No visible or funcional issues on all
the browsers below.
AmIResponsive - the responsive preview image on different gadgets.
iloveimg - to compress the images.
Google Fonts site was used to pick the best typography style. The most importance was given to balance between style and readability. As a developer I needed to ensure that all text is displayed clear.
Schemas - to create database structure.
Django/Jinja - main Framework of the project
Python - main BackEnd programming language of the project
HTML - templates programming language of this project (FrontEnd)
CSS - styling the project via external CSS file ./static/css/style.css
Java Script - dynamic templates programming language of this project (FrontEnd)
jQuery - API for JavaScript - dynamic templates programming language of this project (FrontEnd)
Bootstrap v. 5. - styling framework used in this project (FrontEnd)
Gitpod - online IDE - gitpod was used to create this project
Git - to make commitments of progress and push the results back to GitHub
GitHub - to keep the track of version control
Heroku - to deploy this project
Google Fonts - used for picking the best typography
PostgresSQL - used as a database storage
Cloudinary - used as a storage of static files
FavIcon.io - used to compress favicon
W3Schools - useful information and cheat sheets
Google Fonts site was used to pick the best typography style. The most importance was given to balance between style and readability. As a developer I needed to ensure that all text is displayed clear.
The version control was maintained using git within Codeanywhere to push code to the main repository.
From the codeanywhere terminal type "git add ."
, to make changes and/or updates to the files.
Type "git commit -m (insert a short descriptive text)"
, which commits the changes and updates the files.
Use the "git push"
command, which pushes the committed changes to the main repository.
The app was deployed to Heroku CLI. The steps to deploy are as follows:
After creating an account and logging in, click "creat new"
to create a new app from the dashboard.
Create a unique name for the app and select my region; press "Create app"
.
When you create the app, you will need to add two buildpacks from the Settings tab. The ordering is as follows:
heroku/python
heroku/nodejs
Go to "Settings"
and navigate to Config Vars
.
Add Config Var.
KEY
= PORT
: VALUE
= 8000
.Add buildpacks Python
and NodeJS
- in this order.
Click the Deploy Branch
.
Scroll Down to Deployment Method and select GitHub.
Select the repository to be deployed and connect to Heroku.
Scroll down to deploy:
Option 2
it selects manually deploys (Will Update manually with every "git push"). To see my progress and changes.Option 1
it selects Automatic deploys (Will Update automatically with every "git push"). This was chosen for this project.Live deployment Python quiz
I used lighthouse testing and these are the results for desktop
I used lighthouse testing and these are the results for mobile devices
Tested for responsiveness manually and it was responding well.
wrong count in likes, dislikes and comments but got fixed
[Stackoverflow Django annotate() multiple times causes wrong answers] (https://stackoverflow.com/questions/1265190/django-annotate-multiple-times-causes-wrong-answers) - It helped in fixing bug with likes and dislikes showing wrong counts by adding distinct=True in my multiple annotation in the home view see below
This project is designed to have custom error pages. In case of user clicks on broken link, submits action that isn't supported or tries to reach certain view without permission, then user isn't completely "cut off" from browsing, instead an error page with header and footer appears and user is informed of the situation.
The following custom error pages were created :
git add [filename]
was used to add specific file to staging area, alternatively command git add .
was used to add all changed files to staging areagit commit -m "[commit description]"
was used to add commitments into queuegit push
was used to push all commitments to remote repository on GitHubIt is possible to do a copy of a GitHub Repository by forking the GitHub account
. The copy can then be viewed and it is also possible to do changes in the copy without affecting the original repository. To fork the repository, take these steps:
logging in to GitHub
, locate the repository
. On the top right side
of the page there is a 'Fork' button
. Click on the button to create a copy
of the original repository.To create a local clone of your repository, follow these steps:
code tab
and click it.left of the green GitPod button
, press the 'code' menu
. There you will find a link to the repository. Click on the clipboard icon
to copy the URL.
Use an IDE and open Git Bash
. Change directory to the location where you want the cloned directory to be made.Type git clone
, and then paste the URL that you copied
from GitHub. Press enter and a local clone will be created.
Code -> HTTPS -> Copy button
. after those steps open your local coding environment and type git clone [copied link]
.Task : Obtain GMail username and app key (password) - GMAIL SMTP to be used as mailing client.
Method :
https://accounts.google.com/
and follow all steps for registering new email addresshttps://accounts.google.com/
once againSecurity > Signing in to Google > 2-Step Verification > App Passwords
Generate
xxxx xxxx xxxx xxxx
settings.py
in the project directoryTask : Obtain database URL to be used as project's database.
Method :
below will be deleted
https://dbs.ci-dbs.net/
and follow all steps for registering new account+ Create New Instance
Name, Plan and Region
Create Instance
settings.py
in the project directoryTask : Obtain Cloudinary URL to be used as project's static storage
Method :
https://console.cloudinary.com/
and follow all steps for registering new account+ Add a new environment
cloudinary://USER:PASSKEY@ENVIRONMENT
settings.py
in the project directoryTask : Prepare settings.py
adn file-tree for deployment
Method :
env.py
to keep all sensitive information inenv.py
file ( Appendix 48 )env.py
into .gitignore
file to ensure this fill won't be uploaded to GitHubsettings.py
with import os
VARIABLE = os.environ.get("VARIABLE")
settings.py
with if "DATABASE_URL" in os.environ: DATABASES = {"default": dj_database_url.parse(os.environ.get("DATABASE_URL"))} else: DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", "NAME": os.path.join(BASE_DIR, "db.sqlite3"), } }
settings.py
with STATIC_URL = "/static/" STATICFILES_STORAGE = "cloudinary_storage.storage.StaticHashedCloudinaryStorage" STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")] STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles") CLOUDINARY_URL = os.environ.get("CLOUDINARY_URL") MEDIA = "/media/" DEFAULT_FILE_STORAGE = "cloudinary_storage.storage.MediaCloudinaryStorage"
settings.py
with EMAIL_HOST = "smtp.gmail.com" EMAIL_PORT = 587 EMAIL_HOST_USER = os.environ.get("EMAIL_HOST_USER") EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD") EMAIL_USE_TLS = True
python manage.py migrate
command.\static
and .\templates
New > Create New App
Settings > Reveal Config Vars
env.py
to ConfigVars of Heroku App PORT:5000
COLLECT_STATIC:1
ALLOWED HOSTS
in settings.py
Procfile
Deploy > GitHub > Connect
Deploy > Deploy Branch
Before running the system install all requirements by running the command below
pip install -r requirments.txt
asgiref==.8.1
dj-database-url==0.5.0
Django==4.2.13
django-bootstrap-v5==1.0.11
django-fontawesome-5==1.0.18
django-gravatar2==1.4.4
django-static-jquery==2.1.4
Faker==26.0.0
gunicorn==22.0.0
psycopg2==2.9.9
python-decouple==.8
sqlparse==0.5.0
whitenoise==6.7.0
following commands to set environment variables in developement:
Press enter after every export command
export DEBUG=True
export SECRET_KEY='random_striing'
export DATABASE_URL='my postgreSQL datbase'
Then python manage.py runserver
to go to the browser.
The application Just Ask
was completed as the Portfolio Project 4 for the Full Stack Software Development Diploma at the Code Institute.
Ms. Kay Welfare
for her advice and support her quick feedback was very helpful and encouraging.I would like to thank my mentorMr. Precious Ijege
for relevant feedback during the project.