Skip to content

CoderSales/portfolio_project_5_v4

Repository files navigation

Introduction

Portfolio_Project_5_v4 is an E-commerce website built using the Python/Django Framework to sell Musical Instruments.

-am I responsive

  • Responsiveness of site across devices

References

Tutorials

Git commit messages

-Property Shark

Django Docs:

-template inheritance

Technologies used:

Django and Packages

Other technologies

Repositories

Bootstrap

Footer

How do urls work

urls - Django Documentation

Bug

Error:

Reference

import settings to views.py in contact app

Media References

(Note: image links are also in products/fixtures/products.json)

Ignoring Errors with Flake8

Note on dependabot security update

As per the LMS Tutorial which mentioned incorporating dependabot security updates, one of the options given was to simply merge the pull request from the dependabot which only added 3 characters to the project ".14" to update Django from 3.2 to 3.2.14 so that the project was no longer susceptible to what were deemed by the bot to be critical security vulnurabilities allowing the potential for SQL injection. However, the tutorial mentioned that this would not be applicable here, but since issued the severity had increased, so it was decided to merge the pull request, which led to 2 contributors being listed on the project i.e. the first being the author and the second being the dependabot (for adding ".14" to the requirements.txt file on a single merge commit). commit 0218233861c9ce95cf75731a46a584361da3a17f Showing 1 changed file with 1 addition and 1 deletion. In a previous trial run at this project, the commit was done manually, which did not result in the dependabot being listed as a contributor, so it was quite surprising when accept security update was selected that dependabot was listed as a contributor.

ToDo / Further work:

Testing

Unfinished elements

Due to time constraints:

  • the review model needs more refinement.
  • ideally edit button would handle the issue of one review per customer.

SEO

meta tags

Marketing

Facebook

Add link to contact app

Reference for todo app

Testing

the following sites are working on the local site: /todo/ /todo/task/1/ /todo/task/2/ /contact/

the following sites have been tested on the heroku deployed app: /products/

Bug Fixed

Was having an issue where by all pages were giving 500 errors with deployed and local images not showing.

Problem Statement

I have run migrations at least once today as I added two or three new models but now images are not showing on local at all except for background and not in individual product views on heroku, with the latter giving a 500 error.

Attempts

I discovered the issue on my local so I ran another deploy on heroku to see if it was just a local issue but now the individual products are not showing there either I am not sure what to do. I have not yet tried rolling back migrations.

Redeploy heroku

Solution:

rerun the commands:

python3 manage.py loaddata categories python3 manage.py loaddata products

add DEVELOPMENT = 1 variable temporarily to herokku config vars

run heroku login -i

run heroku run python3 manage.py migrate --app herokuprojectappname

Marketing

Facebook

Deployment

Reference

Heroku

Heroku notices python app as this files is in root folder:

AWS

Followed Code Institute Deployment Tutorials and Changes sheet.

Amazon Web services was used to host media and static files.

S3 used.

Changes to AWS deployment: On create bucket: ACLs enabled, allowing objects in bucket to be owned by AWS accounts.

Object ownership: Bucket owner preferred option selected.

Under S3 bucket settings: The new page is scrollable as opposed to the old one where you click through each option. Properties tab > scroll to bottom of page > static website hosting Permissions tab > 3 settings.

The Cross-origin resource sharing (CORS) section

The following was pasted into the CORS section:

[
    {
        "AllowedHeaders": [
            "Authorization"
        ],
        "AllowedMethods": [
            "GET"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]

Bucket Policy

ACL Access control list

enabled List for Everyone (public access)

  • Accepted warning box

At this point a disabled edit button would have indicated Object Ownership needed to be changed to ACLs enabled.

Access Control List (ACL) both list and write options under Objects column were selected. both read and write options under Bucket ACL column were selected.

Under Objects column: List was enabled

Identity and Access Management (IAM)

Create group

User groups selected on side bar

Create policy

Clicked Button to go to next page to add tags. Even though tags were not used, this step is necessary to get to the review policy page.

Attach policy

On sidebar User Groups clicked. Group selected.

Permissions tab

Opened add permissions dropdown

SEO

Search Engine Optimisation

Reference

3 steps:

  1. see where website ranks cueerntly online
  2. looking where competitors rank
  3. Finding the right keywords and search phrases that your target customers tend to use on a daily basis.

Reference

Methodology

In Google I searched: musical instruments musical instruments stores musical instruments stores online buy musical instruments found: - this used the terms Gear and marketplace reverb

from this I searched: musical instrument gear shop store online orchestral musical instrument gear shop store online

Further information on SEO

SEO theory

short tail vs long tail keywords short more competitive less focused

Further keyword research

other keywords less directly applicable that the user may use in which this site for musical instruments may turn up

musical instrument lessons learning a musical instrument how to play instruments listening to music composers musical analysis

Other considerations

What are questions that potential customers have? What are other things they will go online for?

Auto complete for search phrases or keywords

Further search terms

  • musical instrument online buy

Selection based on relevance authority and volume

Eliminate generic words

eliminate search terms inclined to look for results which which speak from a place of authority, as this ecommerce store is unlikely to compete with that. unlikely to work: best musical instrument store top 10 musical instrument stores where is the best place to buy musical instruments

Keyword volume

want ideally high volume low competition keywords

Reference

[WordTracker.com] searched musical instrument buy results:

string order guitar saxophones for sale clarinets for sale used drum sets for sale price of violin price of guitar harmonicas for sale pedal order guitar buy guitar

trending in last month

of these the following are relevant: string, guitar, saxophones, clarinets, violin, harmonicas, buy

from this search "buy violin" seems to have high volume and low competition.

[Google Keyword planner]

Testing

-Basic Unit Testing in Django

robots.txt

Deployment note

In settings.py, Debug set to False so that excess information used in Development is not presented in production, for security.

Credits

README

Tutorials

Django

Validators

Reference