Build any blog with Django - Part 5

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

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

  • @MrPherez
    @MrPherez 3 года назад

    Cannot believe this video is 2years old ,its so relevant to this time and very educative ...good job

  • @TheDarrenJones
    @TheDarrenJones 5 лет назад +2

    Another great video - I've learnt an enormous amount that I am already using from this series!

  • @GeneralBlorp
    @GeneralBlorp 3 года назад

    I might allow Editor or Author roles the ability to Create and Edit up front but then only admin or staff for deletions, via backend, so it's harder and makes you answer "are you sure", and shows you what else you're also about to delete potentially...

  • @elijahonchwari
    @elijahonchwari 5 лет назад +2

    I love this channel thank you

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

    Thanks bro. I hope you can make some videos about class-based view's method and attribute and explain the difference between get_queryset, get_object and get_context_data

  • @amanyerpude9542
    @amanyerpude9542 5 лет назад +4

    Thank you ❤️

  • @korcankomili7398
    @korcankomili7398 4 года назад

    thanks man, you are really good at what you are doing! Wish you the best!

  • @tomekkitespy8958
    @tomekkitespy8958 4 года назад

    I add this becouse I think noone want random user for deleteing and updating posts. Big thanks for your work Master !
    {% if request.user.is_staff %}
    Update
    Delete
    {% endif %}

  • @roman701
    @roman701 5 лет назад +1

    Awesome content!

  • @ahsanbaloch8546
    @ahsanbaloch8546 5 лет назад +3

    can you make a tutorial on connectings ads to django website

  • @MirrorNeuron
    @MirrorNeuron 4 года назад +2

    Thanks man, really good tutorial. The tinyMCE is not letting upload images, it just asks for a Source but doesn't open an explorer

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

    I wanna make a similar thing as this form but the ImageField is a ForeignKey to another model that uploads images, so when I create a post I can display all the images that are already in my db and choose one of them or I can upload a new one (means I contain the Image form from the image model in the same page)
    So the post model is not going to upload images by itself, instead it's gonna references the images of the Image model by the id just like any other ForeignKey field
    Can you make a video of how to do this if it's possible?

  • @bulltrades
    @bulltrades 5 лет назад +5

    I am getting an error when I am updating the post it display on comment section but not update the post

    • @SumonAhmed7530
      @SumonAhmed7530 4 года назад +3

      I am facing the same Issue. If you find any solution Please share with me.

    • @TheRexy009
      @TheRexy009 4 года назад

      @@SumonAhmed7530 did you guys solved this issue as I am also facing it

    • @opensauce
      @opensauce 4 года назад

      Hi Guys. Any solution to this yet?

    • @mayurg2661
      @mayurg2661 4 года назад

      Hi guys. This is the solution if still interested. In your views.py file, go to post-detail function:
      form = CommentForm(request.POST or None)
      if request.method == "POST":
      if form.is_valid():
      form.instance.user = request.user
      form.instance.post_id = post
      .id
      form.save()
      return redirect(reverse("post-detail", kwargs={
      'id': post.pk
      }))

    • @jasonwilliams676
      @jasonwilliams676 4 года назад

      @@mayurg2661 This doesn't work for me

  • @stkontra7
    @stkontra7 4 года назад

    Thanks for the tutorial, but did I miss linking the Categories??? Or is it just unfinished?

  • @davidbrown2806
    @davidbrown2806 4 года назад +1

    If you are not going to allow others to create posts, then why would you not just us the Admin Panel to do all the CRUD ?

  • @TheRexy009
    @TheRexy009 4 года назад +1

    getting an error when I am updating the post it display on comment section but not update the post, kindly guide me where i might be going wrong

    • @mayurg2661
      @mayurg2661 4 года назад

      Akshay, this is the solution if still interested. In your views.py file, go to post-detail function:
      form = CommentForm(request.POST or None)
      if request.method == "POST":
      if form.is_valid():
      form.instance.user = request.user
      form.instance.post_id = post
      .id
      form.save()
      return redirect(reverse("post-detail", kwargs={
      'id': post.pk
      }))

  • @saadahmed5532
    @saadahmed5532 4 года назад +2

    Image is not upload to tinymce from my computer

    • @MirrorNeuron
      @MirrorNeuron 4 года назад

      even I am facing the same error. It only asks for a source bbut doesn';t open the file explorer. Also how to add youtube viewer/thumbnai/emded image

  • @ExplaineRKhaN
    @ExplaineRKhaN 5 лет назад

    how the youtube ads embed in upload video.?
    how to get that algorithm in django.>

  • @trueprogresstp2308
    @trueprogresstp2308 4 года назад +1

    great tutorial you are good please i want to build a website for my work i sell fashion goods , cloths , bags , shoes and lot more how can i build it can you do a tutorial on that or have you done it

    • @tejassingh2971
      @tejassingh2971 4 года назад +1

      he already done tutorials on ecommerce website you can follow that

  • @agamdoshi3101
    @agamdoshi3101 4 года назад +1

    While updating content it updates comment not content..can you please help ?

  • @Jirkavesely
    @Jirkavesely 4 года назад

    Please full blog git clone tutorial. Thanks

  • @Shmoji
    @Shmoji 5 лет назад

    If it was just the admin running the blog, could they simply create posts from /admin instead of making a post_create.html?

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @Shivam_Manswalia
    @Shivam_Manswalia 4 года назад

    everytime i am trying to update my post it's adding ** asdfsd what the  ** this in comments and nothing on post.
    help please..

    • @dspec126
      @dspec126 4 года назад

      In the template you need to add the 'safe' filter to render the html. {{ post.content | safe }}

    • @AMC-throwaway
      @AMC-throwaway 4 года назад +1

      Currently trying to debug this issue as well, had it working before but now getting the same issue of each update being submitted as a comment

    • @Shivam_Manswalia
      @Shivam_Manswalia 4 года назад

      @@AMC-throwaway there is a one more issue : users can update or delete each others posts.
      Unable to hide options (delete and update) for those users who are not the author of the post.

    • @opensauce
      @opensauce 4 года назад

      Hi Guys. Any solution to this yet?

    • @wadelkane
      @wadelkane 4 года назад +1

      @@Shivam_Manswalia add update and delete between the {% if request.user.is_staff %} INSTRUCTION {%endif%}. it means that the user has to be and admin for see the links

  • @klee6167
    @klee6167 3 года назад

    Hello, for updating a post, each update being submitted as a comment. Has anyone solve this issue?

    • @dw8200
      @dw8200 3 года назад

      I have the same issue. Did you solve the issue?

  • @Toplad2653
    @Toplad2653 4 года назад

    MultiValueDictKeyError at /
    'email'
    Request Method: POST
    cant seem to submit the 4th post anyone know how to fix this?

  • @Shivam_Manswalia
    @Shivam_Manswalia 4 года назад

    What is the solution for users so they can't update or delete each others pots.

    • @dw8200
      @dw8200 3 года назад

      That would be an admin's previliage. It can be done in the admin panel.

  • @itdropout
    @itdropout 5 лет назад

    I tried to deploy it to pythonanywhere, but I'm stuck with operational error / no table named posts_post

    • @maheshroyals6534
      @maheshroyals6534 5 лет назад +1

      perform python manage.py migrate --run-syncdb..it worked for me

    • @itdropout
      @itdropout 5 лет назад

      Hell yeah.... Thank you very much bro. Your a hero

    • @itdropout
      @itdropout 5 лет назад

      @@maheshroyals6534 Thank you Very much

  • @SumonAhmed7530
    @SumonAhmed7530 4 года назад

    Hello,
    When I am Updating posts, It added to the comment section the post is not updating. How can I solve the issue?

    • @lucastavares4908
      @lucastavares4908 4 года назад

      Try reload the page... or ctrl+F5... sometimes, my cache bug and it's solve...

    • @oogieboogie7028
      @oogieboogie7028 4 года назад

      @@lucastavares4908 still not working

    • @PythonicPath1
      @PythonicPath1 4 года назад

      @@oogieboogie7028 did you solve it ?

    • @opensauce
      @opensauce 4 года назад

      Hi Guys. Any solution to this yet?

  • @raghavbansal358
    @raghavbansal358 4 года назад +1

    19:13 When I press submit, this error occurs.
    IntegrityError at /create/
    NOT NULL constraint failed: posts_post.author_id
    Help please!
    Edit- I solved it myself. If anyone faces the same error, contact me.

    • @hdsmsmart
      @hdsmsmart 4 года назад

      i got the same error, please help!

    • @raghavbansal358
      @raghavbansal358 4 года назад +1

      @@hdsmsmart learndjango.com/tutorials/django-best-practices-referencing-user-model
      Use get_user_model instead of creating new class Author in models.py

    • @hdsmsmart
      @hdsmsmart 4 года назад +1

      @@raghavbansal358 could you be more specific, so I remove Author class ? and in model.py change author field in Post like author = models.ForeignKey(get_user_model(), on_delete=models.CASCADE) ??

    • @hdsmsmart
      @hdsmsmart 4 года назад +1

      @@raghavbansal358 because in class Author we create models.OneToOneField(User, on_delete=models.CASCADE) with User = get_user_model() , should it still work ?

    • @raghavbansal358
      @raghavbansal358 4 года назад

      sonho See the link I send of that reddit post. In comments, you will find out that person has put his code of models.py. He is also working on same project using these tutorials

  • @sddjango1510
    @sddjango1510 4 года назад

    request.method == "POST" return False
    need help

  • @dillanteagle3726
    @dillanteagle3726 5 лет назад

    How are you going to handle user auth?

    • @mattfreire
      @mattfreire  5 лет назад

      I won't be covering it in this tutorial series but you can follow this tutorial to show how you can add it -> ruclips.net/video/BiHSP6bTsrE/видео.html

    • @sergeymarkov8567
      @sergeymarkov8567 5 лет назад

      there is a video on this channel about it

  • @dipusarker8072
    @dipusarker8072 5 лет назад

    when i delete my all post will be deleted automatically how i solve it

    • @dspec126
      @dspec126 4 года назад

      The posts are tied to the author class with on_delete=modles.CASCADE
      See: stackoverflow.com/questions/38388423/what-does-on-delete-do-on-django-models

  • @Funtoshi
    @Funtoshi 4 года назад

    need confirm deleting :D

  • @csandreas1
    @csandreas1 4 года назад

    generic views are better for update , deleting, creating. Much less code

  • @keerthanaprakash1521
    @keerthanaprakash1521 4 года назад +1

    Hello,
    when I submit the form I am getting" No file chosen" although the image is uploaded. How can i fix this issue?

    • @Shivam_Manswalia
      @Shivam_Manswalia 4 года назад

      you must be missing or repeating something check your code.

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @trueprogresstp2308
    @trueprogresstp2308 4 года назад

    great tutorial you are good please i want to build a website for my work i sell fashion goods , cloths , bags , shoes and lot more how can i build it can you do a tutorial on that or have you done it

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd

  • @kashifrashid8090
    @kashifrashid8090 3 года назад

    plz sir make a video for django_comments_xtd