(CS50 WEB) WIKI - PROJECT 1 | SOLUTION

Поделиться
HTML-код
  • Опубликовано: 14 янв 2025

Комментарии • 116

  • @DorsCodingSchool
    @DorsCodingSchool  Год назад

    👨‍💻 Learn How to Code with Private Classes - www.dorscodingschool.com/coachingplans
    ❓Having a hard time with CS50, FreeCodeCamp or Odin Project? Practice with our exclusive free coding platform: www.codingdors.com/
    🎯 Are You A Coding Expert? Take Our Free Quiz and Find Out - www.dorscodingschool.com/quiz

  • @SolomonKhamlamchin
    @SolomonKhamlamchin 10 месяцев назад +4

    00:02 Overview of CS50 Web Programming Project 1 Wiki with Python and JavaScript
    05:53 Converting Markdown to HTML and Working with Entries
    11:48 Creating a Path for Encyclopedia Entry in Django
    17:40 Handling Display and Hyperlinks in Django HTML Templates
    23:34 Handling Search Queries and Form Submission in Django
    29:28 Creating a Recommendation Page and Adding New Entries
    35:22 Creating a New Page with HTML and Form
    41:15 Working with Text Area and Post Method in Django
    47:06 Creating an Edit Functionality for Entries
    52:58 Creating and Rendering Entries, Random Page Functionality

  • @ericzheng4815
    @ericzheng4815 2 года назад +17

    The best tutorial on RUclips. Period.

  • @NosProblemos
    @NosProblemos 5 месяцев назад +2

    I did it all by myself, but came across a bug problem i couldnt solve for a week, watching this video helped to find where was the issue so i could finally get over it. Like always it was a small thing that i missed. Thanks

  • @mon0theist_tv
    @mon0theist_tv Год назад +4

    21:30 they literally never explained this title=entry part of the URL tag in the lecture/notes, and you can try to read the Django docs but they're very difficult to understand. Idk how we were supposed to know how to do this.

  • @PeterReynolds2042
    @PeterReynolds2042 2 года назад +6

    This channel deserves more attention

  • @manuelguerra1385
    @manuelguerra1385 4 месяца назад +2

    It seems to me that the edit function can be simplified into a single function. When the edit button is clicked, a get request is sent and when the form is submitted, a post request is sent.

  • @dn2888
    @dn2888 2 года назад +5

    I'm having trouble with the url being case sensitive.. if I enter wiki/css in the url it will return an error message... only wiki/CSS will work... but yours seems to accept different cases.. appreciate if you could help me out. thanks

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      You should check what we did when in the functions. The util.get_entry is case insensitive and there are some cases where you need to convert the title to lowercase.
      If you want, you can join our Discord Community :)
      Check out: www.dorscodingschool.com/discord

  • @hassanamir2838
    @hassanamir2838 2 года назад +2

    As I insert a second path program, for the wiki/title , VS code , does not seem to register the program as valid, rather as an error.

  • @mr.blacknight1214
    @mr.blacknight1214 2 года назад +2

    Hi I'm almost finishing up the project but there is a bug , when i create a page with exist name but in lowercase it's also got saved, for example we have CSS in title but also when I try to create a new page with css title it's can be saved too! Please help I really haven't enough time , thanks a lot!

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      We’d love to help you more. Did you know you can join our Free Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @Nalanarud
    @Nalanarud Год назад +6

    First of all, thank you very much for all the work you do to help new programmers its amazing and clear.
    Now regarding the get_entry function being case sensitive, it just wouldn't work. the following was my approach, it work, however I feel like it can improve a lot, looks kinda forced would very much appreciate any input:
    def convert_md(title):
    content = util.get_entry(title)
    if content is None:
    content = util.get_entry(title.capitalize())
    if content is None:
    content = util.get_entry(title.upper())
    markdowner = Markdown()
    if content == None:
    return None
    else:
    return markdowner.convert(content)

  • @YSN596
    @YSN596 Год назад

    that's really very guiding...thanks...

  • @TheCsTutor-qk3uy
    @TheCsTutor-qk3uy Год назад +2

    amazing work!

  • @AudioBln
    @AudioBln Год назад +1

    I must use:
    urlpatterns = [
    path("", views.index, name="index"),
    path("wiki//", views.entry, name="entry"),
    ]
    if I drop the / at the end it´s not working

  • @vejsanabito6020
    @vejsanabito6020 Год назад +2

    I am facing problems in terminal because the vs is not recognizing the django module, neither the codespace nor the vs code desktop...trying to install it with pip install django in the terminal of vs code, gives me errors... can you please explain how you set up the environment and also how to submit the projects from vs code desktop? Many thanks in advance!

    • @DorsCodingSchool
      @DorsCodingSchool  Год назад +1

      Sure! You can try to use the virtual environment. You can follow the steps in here until the section "Installing Django": dev.to/nagatodev/how-to-connect-django-to-reactjs-1a71

  • @danielneves2050
    @danielneves2050 10 месяцев назад +1

    Just wanted to understand which extension ur using to run the website, I'm using live server, but it's no really working

    • @coder-z7j
      @coder-z7j 3 месяца назад

      You do not use any extension, you are supposed to run it with django

  • @brannstrom12
    @brannstrom12 2 года назад +2

    My project was almost completed but I checked your video to rectify a bug I was getting, but you did not have that bug.
    Could you please help me with that?
    My markdown library is returning None only.

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      Sure, if you want our help you can join our Free Discord Community: www.dorscodingschool.com/discord

  • @sim7017
    @sim7017 11 месяцев назад

    Hello, I am having problems with the end block and block and extend commands appearing as just text on my webpage. I have installed Jinja and it doesn't work.

  • @lhivea2345
    @lhivea2345 4 месяца назад

    I have a issue in saving my entry on a create new page

  • @coreyhill7775
    @coreyhill7775 2 года назад +2

    Thank you for helping me understand!

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      Happy to help!

    • @coreyhill7775
      @coreyhill7775 2 года назад

      Just spent an hour debugging my code just for there to be a missing indent......... yes mom I love programming!

  • @saranourimottaghi2558
    @saranourimottaghi2558 Год назад +1

    Hi there I have a problem when I go to edit it doesn't show the current entry and title and I don't know how to solve this even where is problem come from please help me

    • @DorsCodingSchool
      @DorsCodingSchool  Год назад

      Are you sending the data when you click in the button and display the edit page?
      We’d love to help you more. Did you know you can join our Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @nazarakmyradov1932
    @nazarakmyradov1932 Год назад +1

    thank you very much for all the work. if you shared URL bar with us it would be better :)

  • @blessmannewton4785
    @blessmannewton4785 2 года назад +1

    I'm having a problem with rendering the index page, it always gives me the Django default template.

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      This can be caused by multiple problems. Do you have the index.html file? Do you have a path in your urls.py that indicates the index route? Do you have a function called index? Are you rendering the correct html file?

  • @adisudhakar9674
    @adisudhakar9674 2 года назад +1

    Are you using Codespace or Visio studio desktop?

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      You can use both. I prefer using VSCode for Desktop

    • @vejsanabito6020
      @vejsanabito6020 Год назад

      @@DorsCodingSchool how can you submit the project on vs code for desktop? In another tutorial you explained how to submit the projects on codespace and I am finding it difficult to submit it from the vscode desktop...

  • @mahadusman6634
    @mahadusman6634 Год назад +1

    hi.i am having a major issue regarding the csrf token. when i write csrf then the tag wont show up in vs code or if i type it manually the csrf error still shows up. so basically the csrf tags arent working in vs code what should i do.

    • @DorsCodingSchool
      @DorsCodingSchool  Год назад

      We’d love to help you more. Did you know you can join our Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @sahil_0562
    @sahil_0562 Год назад +1

    do we have to manage session in this project?

    • @DorsCodingSchool
      @DorsCodingSchool  Год назад +1

      Yes, you have a manage.py file that is the root file for your Django project. However, you should not change this file :)

    • @sahil_0562
      @sahil_0562 Год назад +1

      sorry but i was talking about that request.session thing at the end of the lecture which gives different user different pages something like that, do we have to do this in this project ?

  • @Vitanergie
    @Vitanergie Год назад +1

    Please, tell us :
    WHICH THEME ARE YOU USING ?
    I Love it ! where can we find it ?
    It's impressing at differencing any type of function for each word in the code.
    I would love to be able to use it.

    • @DorsCodingSchool
      @DorsCodingSchool  Год назад

      Hahaha it’s the regular dark theme of VS Code. However, I’ve installed an extension to change the colors of the functions and variables. You should install the extensions of Django, html, css and Python :)

  • @goonkouseiken630
    @goonkouseiken630 2 года назад +1

    Thank you so much!!! i am subscribing

  • @amari0040
    @amari0040 2 года назад +1

    Edit page returns "None" in the textarea, can you help me out?

    • @DorsCodingSchool
      @DorsCodingSchool  Год назад

      Check if the indentation is correct ;)
      We’d love to help you more. Did you know you can join our Free Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @kay8379
    @kay8379 Год назад +1

    thank you so much.

  • @victorc5154
    @victorc5154 Год назад

    Hi, pls, why the function search is case-sensitive?

  • @marioortiz3805
    @marioortiz3805 2 года назад +1

    Hi, I wanted to know, did you put something like an .upper() or something? My GET only works if I give the exact string

    • @prathetic
      @prathetic 2 года назад +1

      GET and POST are html control messages in python we need to type "GET" and "POST" not to confuse them with any user defined variables eg post or something

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад +1

      If you check, we compare the string by putting all of them in lower case, otherwise you might not find your entry :)
      We’d love to help you more. Did you know you can join our Free Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

    • @bsykesbeats
      @bsykesbeats Год назад +1

      I don't see where shes is converting the strings to lowercase. Did you figure this out?

  • @Yash-yg1py
    @Yash-yg1py Год назад

    thanx a lot
    u r a gr8 teacher

  • @abdullhimad3249
    @abdullhimad3249 2 года назад +1

    all this files are already created or you create them one by one ? i found this hard one to do ):
    many thanks

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      All the files are already created beside the HTML files you'll build during your solution. By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 1 hour of group coaching every month!
      Check www.dorscodingschool.com/products

  • @FredSq
    @FredSq Год назад

    good as always❤❤✌✌

  • @ahmedalimuhammed8501
    @ahmedalimuhammed8501 2 года назад +1

    it gives to me ( MultiValueDictKeyError at /edit/ ) when i edit coffee page could you help me pls ?

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      Sure, if you want our help you can join our Free Discord Community: www.dorscodingschool.com/discord

  • @Mando-cv8oh
    @Mando-cv8oh 2 года назад +1

    There is a bug if you try to edit the page from /save_edit

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      Can you give us more details? Because for us it seems to be working ;)

    • @Mando-cv8oh
      @Mando-cv8oh 2 года назад

      in my case I open for example CSS page, than press Edit. I edit something, again press edit button. After this im on edited page /save_edit. But if i try to edit page from this link it doesnt take any parameters to edit… if it makes sense what ive typed .. 😂👍

  • @zivkovicigor
    @zivkovicigor Год назад

    Hello, I am currently having problems with this project. Namely, the {% %} commands. For example {% block %} {% endblock %}. They do not function, when I run it in Chrome, it just appears as text. The difference also is that in this video, {% is in yellow, in my code it's blue. I tried to find the extensions to make it work but I can't. So what extension do I need for those commands to register?
    Thanks in advance

    • @tedeye9542
      @tedeye9542 Год назад

      Try to install the Jinja template engine to have your template tags to work

    • @zivkovicigor
      @zivkovicigor Год назад

      @@tedeye9542 it is not working.

  • @TheyCensorUsHere
    @TheyCensorUsHere 2 года назад

    My Block Titles don't appear with the creation of new pages.
    Everything works - it's greyed out in the Inspector, although it has the correct title there "Coffee"

    • @TheyCensorUsHere
      @TheyCensorUsHere 2 года назад

      It says
      display none
      In the inspector under box properties. o.0

    • @TheyCensorUsHere
      @TheyCensorUsHere 2 года назад

      I'm also getting "Style sheet could not be loaded at stackpath/bootstrap bla bla .scss" right above my inspector.

    • @TheyCensorUsHere
      @TheyCensorUsHere 2 года назад +1

      The only solution I could do was to go into each of the .MD files and delete th titles from there, since when I add {{title}} to the body of Entry.html it gives me two titles for the old ones that had the markdown files pre-created.
      Why is this not mentioned?

    • @TheyCensorUsHere
      @TheyCensorUsHere 2 года назад

      Just finished, great video, took me hours to do.. Feel like an idiot.

  • @lakshika1210
    @lakshika1210 2 года назад +1

    What if the whole project is complete but I get 404 error

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      We’d love to help you more. Did you know you can join our Free Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

    • @lakshika1210
      @lakshika1210 2 года назад

      @@DorsCodingSchool yeah i will love to join the community.. form will be filled by tomorrow 😊

  • @devosama6243
    @devosama6243 2 года назад +1

    Thank you so much pls complete 💞😊

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      You're welcome! We will be doing all the projects again and uploading here :)

  • @JotaRDev
    @JotaRDev Год назад +1

    Eu só fiquei com dúvida em relação aos métodos GET e POST. Não é uma boa prática colocar o GET em formulários de pesquisa, e quando se trata de manipulação de dados usar o POST ? Não entendi porque no vídeo você faz o contrário. Ou eu que estou equivocado ? Obrigado pela aula !!

    • @DorsCodingSchool
      @DorsCodingSchool  Год назад

      O método GET é utilizado para renderizar o conteúdo de HTML na página (e assim podemos vê-la). Já o método POST é utilizado para guardar os dados do formulário :)

    • @JotaRDev
      @JotaRDev Год назад

      @@DorsCodingSchool
      Durante a aula do cs50 eu anotei isso:
      • Metódo Get
      • Um método utilizado que serve basicamente para escrever na URL, ou clicar em algum link pra ir pra outra página.
      • Metódo Post
      • Usado toda vez que estivermos mandando dados que tem o potencial de mudar o estado do app, por exemplo, adicionar um item em uma lista.
      Com isso, entendi que quando estivermos tratando com URL, como por exemplo o formulário de busca, utilizaríamos o método 'GET', até porque se o usuário enviar esse link de busca pra alguém, a URL vai manter a busca que o mesmo fez. Aí no vídeo vi que você fez o contrário, algum motivo específico ?
      Desculpe o questionamento, é porque realmente estou com dúvida nisso kkk, já fiz várias pesquisas, mas estão diferentes umas das outras.

  • @Mai_Tai_Meyers
    @Mai_Tai_Meyers Год назад

    THANK YOU!!!

  • @prathapprathap8035
    @prathapprathap8035 Год назад

    I have a doubt regarding recording and uploading videos. Is it mandatory to upload videos on RUclips and share the link? In these videos, we want to provide explanations with a voiceover.

    • @kay8379
      @kay8379 Год назад

      yeah its mandatory unfortunaly, but i guess you dont need to voice over the video, you only demonstrate the project working as long as I know

  • @faakhirzahid6284
    @faakhirzahid6284 2 года назад +3

    Hey, your visuals for html are amazing, can you tell about your respective extensions ?

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      I've downloaded the html snippets, css snippets and javascript snippets ;)

  • @iwanbotha8942
    @iwanbotha8942 10 месяцев назад

    what debugger is she using

  • @wenjiezhou8888
    @wenjiezhou8888 2 года назад

    Thank you!

  • @erickheuseler514
    @erickheuseler514 2 года назад

    I'm having problems edditing the styles.css, django don't recognize the changes, do you have any idea about what could it be? I even tried delete the file and run ctrl+F5, but the page still use the old CSS deleted. Also, the page is occupying more than the viewport, the scrollbar is always present and I don't know how to solve it (this problem it's present since the beginning)

    • @TheyCensorUsHere
      @TheyCensorUsHere 2 года назад

      Same here, whhe I changed the view field for the textarea to 50 nothing changed.
      I'm also having problems with my headers appearing on new pages that are created, they're greyed out but the backend all works. Some reason they're set to 'display none' when I view the header under inspector.

    • @dive8723
      @dive8723 2 года назад

      You need to clear the cache of the browser. I had the same problem and after clearing it everything worked.

    • @noahmayer7360
      @noahmayer7360 Год назад

      Weird, I had the same problem but CTRL+F5 worked.

  • @JotaRDev
    @JotaRDev Год назад +1

    Você é brasileira ? Tem um sotaque muito parecido. Thanks for the class!

  • @qaz7105
    @qaz7105 4 месяца назад

    46:03

  • @biggiestud9451
    @biggiestud9451 4 месяца назад +2

    I love you

  • @sofiyakucheras5758
    @sofiyakucheras5758 Год назад

    {% load static %}
    {% extends "encyclopedia/layout.html" %}
    ...
    {% block title %}
    Encyclopedia
    {% endblock %}
    {% block body %}
    ...
    {% csrf_token %}
    are not working, how can I solve these problems?

    • @marekpumex
      @marekpumex Год назад

      You should add {% csrf_token %} in the form that You are sending (in the search form) like this:
      {% csrf_token %}

  • @callmealex6761
    @callmealex6761 Год назад

    Whenever i click on the new page button, it doesnt do anything even tho i checked everything and it was right, can someone help me out?

  • @ozgelethe
    @ozgelethe Год назад +1

    you're amazing

  • @lilchicha5670
    @lilchicha5670 3 месяца назад +1

    You’re saying too many “okay”.. it’s annoying..( but the explanation is good

  • @dagiz0232
    @dagiz0232 Год назад +1

    Thank you very much....Although You could have done the markdown to html conversion by yourself using regular expression. I don't know maybe that would have made the video a bit longer. Anyways Thank you very much!!!

  • @Lava-bc7ez
    @Lava-bc7ez 2 года назад +1

    I'm not sure why but my random.choice doesn't work. It keeps show an AttributeError "'function' object has no attribute 'choice'"

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      Did you import random?

    • @Lava-bc7ez
      @Lava-bc7ez 2 года назад

      @@DorsCodingSchool Yes but I then tried using "from random import choice" and it fixed it

  • @opreastefan5371
    @opreastefan5371 2 года назад +1

    Are you Romanian?

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      No, Brazilian :)

    • @opreastefan5371
      @opreastefan5371 2 года назад

      @@DorsCodingSchool Really cool! Smart and pretty , all in one girl! Great job. I am doing the same course at the moment, hopefully I will become as knowledgeable as you at some point!

  • @dargtagnan3696
    @dargtagnan3696 2 года назад +1

    I have an issue with "get_entry": "content = util.get_entry(title)" , that line by itself, only returns 'None'. I think it may be because the URL is never capitalized, but then I don't understand how my "get_entry" is going to be any different from anybody else's. 🥲

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

      You should add the title of your markdown content, not the URL, when calling the util.get_entry(title). By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 1 hour of group coaching every month!
      Check www.dorscodingschool.com/products

    • @miguelmontoya3663
      @miguelmontoya3663 2 года назад

      I have the same issue, I tried with .capitalize() but it stop working with titles like CSS or HTML. 😥

    • @pheus_101
      @pheus_101 Год назад

      def entry(request, title):
      entry = convert(title)
      if entry == None:
      return render(request, "encyclopedia/error.html"
      "error": "the page you are looking for was n
      })
      else:
      return render(request, "encyclopedia/TITLE.html"
      "entry": entry,
      "title": title
      })
      make sure this part is correct

  • @my3NDmess
    @my3NDmess Год назад +1

    thank you very much