Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I didn't know we needed to complete the exercises of CH5 when doing CH6, luckily I came across your question and this helped me get the desired output I wanted from the index.html.</p> <p>I haven't done any work with the admin side of things though, but it looks like your error is here:</p> <p><strong>populate_rango.py</strong></p> <pre><code> frame_cat = add_cat("Other Frameworks", 32, 16) </code></pre> <p>and</p> <pre><code>def add_cat(name, views, likes): c = Category.objects.get_or_create(name=name, views=views, likes=likes)[0] return c </code></pre> <p>You need to make the <code>views=0</code> &amp; <code>likes=0</code> in this line: <code>def add_cat(name, views, likes):</code></p> <p>Then you need to change this:</p> <p><code>frame_cat = add_cat("Other Frameworks", 32, 16)</code> to this:</p> <p><code>frame_cat = add_cat("Other Frameworks", views=32, likes=16)</code></p> <p>Also, you will have a database called DATABASE_PATH (or at least that is what mine is called). You need to <strong>delete</strong> this and run:</p> <p><code>python manage.py syncdb</code></p> <p>&amp; then just to make sure it worked, I ran:</p> <p><code>python populate_rango.py</code></p> <p>When you got the error in the admin section, did you first check the /rango page to see if you were getting the correct output? Chances are, you were also either getting an error like me or your categories weren't displaying (I could be wrong though on your output).</p> <p>I think my solution will display the views and likes now. Try it and let me know.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload