КОМЕНТАРІ •

  • @CodingForEverybody
    @CodingForEverybody 5 років тому +1

    For more videos like this, check out learnwagtail.com and the entire UA-cam playlist at wagtail.io/course

  • @RukyasuX
    @RukyasuX 5 років тому +11

    I'm not much into commenting but thank you very much for this series, Kalob. This is undoubtedly the best learning source for Wagtail so far

  • @casumoto2115
    @casumoto2115 3 роки тому +1

    A brilliant tutor, I just couldn't wait until end of the lesson to make this comment.

  • @addohm
    @addohm 5 років тому +15

    In wagtail 2.6.1 it is required to specify a name for a streamfield block.
    ('title_and_text', blocks.TitleAndTextBlock(classname='text_and_title')
    or you will get the exception:
    env/lib/python3.7/site-packages/wagtail/core/blocks/stream_block.py", line 44, in __init__
    block.set_name(name)
    TypeError: set_name() missing 1 required positional argument: 'name'

    • @MortenRostved
      @MortenRostved 4 роки тому +1

      Thanks :)

    • @NoahSky
      @NoahSky 3 роки тому

      thx you literally saved my day xD

  • @boasorte6808
    @boasorte6808 2 роки тому +1

    Brother, you are amazing. I have learned a lot and incredibly fast, you have an innate talent for teaching. And I am also following the videos with a low level of English, only with the automatic translation of the UA-cam subtitles.
    Greetings from Chile!

  • @DarrenbyDesign
    @DarrenbyDesign Рік тому

    This is awesome! Thanks for your time and energy

  • @umut2243
    @umut2243 4 роки тому

    After 11:25 when i run 'runserver', error occurs:
    OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: ''
    When I run 'migrate' or 'makemigrations', error occurs:
    No module named 'streamswagtail'
    Python: 3.6
    Wagtail: 2.9.3
    Django: 2.2.15

  • @SpiffyguyAdventures
    @SpiffyguyAdventures 4 роки тому

    Why are you creating a new app for each page? Wouldn't it be better to just add it to the original models.py and create a new html template? Just getting started with the series so there is probably a good reason. But so far there are now 3 apps created.

    • @CodingForEverybody
      @CodingForEverybody 4 роки тому +2

      In these videos, practice. And to also split out larger chunks of logic, should we need to. Separating the apps now is easier than having to do it in the future and writing a data migration.
      Though I've seen pages all living under one models.py file and there was nothing wrong with that.

    • @SpiffyguyAdventures
      @SpiffyguyAdventures 4 роки тому

      @@CodingForEverybody ok thanks for the reply. That makes sense. My previous Django project has a singular models and used views, so wagtail is a bit different. Thanks for these tutorials they have really helped.

  • @marquesjohnson870
    @marquesjohnson870 5 років тому +1

    Not sure what I'm doing wrong, but my StreamField shows :
    title
    Name of title
    text
    Text I put in.
    Is that just because it's development mode, or am I doing something incorrect? I tore the whole project down and started over, and still got this output.

    • @CodingForEverybody
      @CodingForEverybody 5 років тому

      I'd need to see more of your code. You can put it up in a GitHub Gist. But generally you need to:
      1) Add the StreamField field (ie. blocks.CharField) to your StreamField, and
      2) Add the new field to your template (ie. {{ self.new_field_name }}

    • @marquesjohnson870
      @marquesjohnson870 5 років тому +1

      @@CodingForEverybody the reason none of this is working for me, is at this step templates are not even being looked for. After putting the info for streams/blocks.py and trying to refresh "About" the page refreshes without the template error. So it seems its not even trying to access templates any more. Everything in flex_page.html and home_page.html, seems to go through the template, though.

    • @CodingForEverybody
      @CodingForEverybody 5 років тому

      @@marquesjohnson870 If there's no template error, it means it's found the template. Your loop looked like it was working.
      But this thread is getting a bit long to provide support on UA-cam. Have you joined the Slack community yet? wagtail-slack.now.sh/ We can help you out a lot more in there!

    • @marquesjohnson870
      @marquesjohnson870 5 років тому

      @@CodingForEverybody I have joined there. But it couldn't have found the template because I hadn't made one yet.

    • @CodingForEverybody
      @CodingForEverybody 5 років тому +1

      @@marquesjohnson870 If you have DEBUG = True in your settings, and you're using a StreamField on a page and you're requesting a template that doesn't exist, you'll get a Template Does Not Exist error.
      First step is to get ANY streamfield template to render. It doesn't need dynamic content, it just needs SOMETHING to show up.
      I'm looking forward to seeing you in the Slack community!

  • @harsha44467
    @harsha44467 5 років тому +1

    I keep getting this error on creating a StreamField, the block has 2 simple CharBlocks, please help?
    ERROR: AttributeError: 'list' object has no attribute 'get_prep_value'

    • @CodingForEverybody
      @CodingForEverybody 5 років тому

      Can you put your StreamField into a gist (gist.github.com/) and share the URL with me? And maybe also include your page class that's trying to use this streamfield.
      My first thought is that you might be using a ListBlock. Or the `content = StreamField(...)` property is misconfigured.

    • @ruchitmicro8409
      @ruchitmicro8409 5 років тому

      I've got the same issue

    • @harsha44467
      @harsha44467 5 років тому +2

      @@ruchitmicro8409 deleting all migrations and dropping the table helped for me. Just makemigrations again

    • @ruchitmicro8409
      @ruchitmicro8409 5 років тому +3

      I got it solved this is what I did,
      find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
      find . -path "*/migrations/*.pyc" -delete
      paste the above two code in a terminal targeting your project directory (It will remove your migrations).
      Then, remove db.sqlite3 from your project directory.
      Then makemigrations and migrate
      My mistake was I didn't watch the entire video where Kalob skipped giving default value when asked during the migration and I gave the default value. Hence my code got fucked up

    • @ArjitRaj
      @ArjitRaj 4 роки тому

      @@ruchitmicro8409 Thank you.

  • @votelearn1244
    @votelearn1244 4 роки тому +1

    Hi Thanks for the great course, I have a blog which users can add articles and I want user to have the ability to make collection or group and add their articles to it (something like youtube where you can add videos to playlist) .. what is the best way to do it with wagtail ?

    • @CodingForEverybody
      @CodingForEverybody 4 роки тому +1

      Good question! There are LOTS of ways to do this. The simplest method would be to create another page (ie. ArticleCollectionPage) and use an Orderable to select blog pages.
      You could also use a StreamField as well but imo that's not using StreamFields for its intended use (that's not official, just my opinion). But a StreamField would work!

    • @votelearn1244
      @votelearn1244 4 роки тому

      ​@@CodingForEverybody thanks for your replay, I love you man :D
      okay, your suggestion is great if I want to make users add articles to his collection from (ArticleCollectionPage) .. but what if I want to give him the ability also to choose the collection in the article page (ArticlePage), something like when you create article and choose category or tags.
      how to make this ?
      and thanks again you are a life saver.

    • @CodingForEverybody
      @CodingForEverybody 4 роки тому

      @@votelearn1244 Same way, its just one more layer of recursive code.
      You could create a Clusterable Model with an Orderable, register the Clusterable Model with the model admin and register as a snippet, and then use a SnippetChooserPanel.
      You'll see an example of this in the Menus app github.com/CodingForEverybody/learn-wagtail/blob/master/menus/models.py#L17-L80

  • @abdulia1194
    @abdulia1194 5 років тому +1

    Everything works but I keep getting this:
    --module streams
    --unresolved import 'streams'
    Server still runs but the error annoying. How can I remove it.
    Btw, great video tutorials. I can see big potential for Wagtail.

    • @CodingForEverybody
      @CodingForEverybody 4 роки тому +1

      "streams" isnt a module in your code. You just ned to remove the line that starts with `from streams import ....`

  • @patriotlightning7791
    @patriotlightning7791 5 років тому +1

    It seems django-debug-toolbar is causing some weird bug in the latest release of Wagtail "index error out of range" something, when I try to edit a page in the admin area. Disabling it fixes the problem. :P

    • @CodingForEverybody
      @CodingForEverybody 5 років тому

      So I've heard. Very strange. I havent upgraded to Wagtail 2.5 with Debug Toolbar yet. When I do, and if I can find a solution, I'll make a video about it!

    • @SeanCotton
      @SeanCotton 5 років тому +1

      I'm getting the same error "list index out of range" when I try to edit the about page in the admin panel. @@CodingForEverybody Is there a way to downgrade Wagtail from 2.5 or remove the DDT?

    • @CodingForEverybody
      @CodingForEverybody 5 років тому +1

      Of course there is. I'd suggest removing DDT instead of downgrading Wagtail though.
      To remove DDT you can remove the DDT lines from your middleware and installed apps in dev.py. And to remove it entirely you can use `pip uninstall django-debug-toolbar`
      And if you really wanted to downgrade Wagtail, you could use `pip install wagtail==2.4`
      If you're on Wagtail 2.5 right now, make sure you upgrade to 2.5.1 as there was a bug that was fixed. `pip install wagtail --upgrade` or `pip install wagtail==2.5.1`

  • @abdojoba8932
    @abdojoba8932 5 років тому +2

    server gives me an error "no module named streamswagtail"

    • @CodingForEverybody
      @CodingForEverybody 5 років тому

      Make sure you're adding "streamswagtail" to your base.py file (in the INSTALLED_APPS) and make sure your directory is called "streamswagtail". In this video and the the source code I'm using a module called "streams", the name is slightly different but very important.

    • @abdojoba8932
      @abdojoba8932 5 років тому +2

      I forgot the comma after the app (streams)
      Thank you very much
      @@CodingForEverybody

    • @alexmangir
      @alexmangir 4 роки тому

      I have same problem, but my base.py is correct. (Django==3.0.6, python==3.8, wagtail==2.9)

    • @danielabrahams4061
      @danielabrahams4061 4 роки тому

      @@alexmangir Me too - did you solve this issue? I can't find much online about it