Online store on Steemit blockchain| Step Eight | Backend and Frontend.

in Steem Alliancelast year

Hello, friends!

Step 08.jpg

Let's start with the frontend.
I cut it into pieces in order to avoid repetition of the code. Thus, I have two new files sidebar .html and navbar .html. In which you think you already guessed and there is a code from the sidebar and navbar.

Screenshot_32.png

After that, I integrated these pieces of code into the base file in this way. Through the standard django system. Block principle of integration.

Screenshot_33.png

Leaving in the main template the main class and the main content block.

Screenshot_34.png

I also integrated categories into the menu. Thus, when adding any category through the admin panel, it will automatically be displayed in the menu.

Screenshot_35.png

This function is implemented through a for loop, thereby sorting through and showing all the categories that are in the database in the product model.

Screenshot_36.png

We can observe that there are no other menu categories and subcategories. Since we have only one main category and four subcategories.

Now not much of a view.
I created views to filter products by category. So that the user can choose a programming language, and the site gives him the entire list of courses that are currently available.

Screenshot_37.png

If we need a Python category, then we just need to write the category and the name of the category itself.
The link looks like this:
http://127.0.0.1:8000/category/python

Screenshot_39.png

Be sure to write the path in the urls .py file.

Screenshot_40.png

Another of the points that we managed to implement today is to change a little design. Home page and category pages. Having made courses in the grid. And also highlight the time of the course.

Screenshot_41.png

The style of the main pictures was also changed, as they were displayed crookedly. And now they are the full width of the container.

Screenshot_42.png

I also solved the problem with displaying images from statics. I didn't forget a lot about the fact that the project must specify the path of the statics in order for it to start working correctly.

This is done in the project in the urls .py file.

Screenshot_43.png

In the next post, most likely there will already be a full-fledged template for a full course card. And we will also make automatic links to categories and buttons in more detail.

Thanks for supporting the project.

@rme , @rex-sumon , @shy-fox , @hungry-griffin, @pennsif

The project is being created in partnership with @steemit-market.

Above may be wrong. Since I wrote the code from memory and then corrected it. But git will have no errors.

Link to the git.

steem blockchain.jpg


You can get acquainted with the project here.

This is the first part: Step one
This is the second part: Step two
This is the third part: Step three
This is the fourth part: Step four
This is the fifth part: Step five
This is the sixth part: Step Six
This is the eightth part: Step Eight

To be continued...

Sincerely, your @HardPhotographer

Sort:  

Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)

The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.

Upvoted! Thank you for supporting witness @jswit.

Coin Marketplace

STEEM 0.29
TRX 0.11
JST 0.033
BTC 63945.57
ETH 3135.76
USDT 1.00
SBD 4.00