• sadakopanorama_fish_eye
    9 posts
    4 years ago

    Hi!

    I am currently working on a project that uses Misago as a base to create a Forum specialized in the COVID situation. Right now my task is to render COVID news into Misago's base.html, so it would look something like this...
    Expectation
    ^ As you can see I am displaying some cards and in theNews card, I use GoogleNews to change the new's title and image daily

    Right now I am trying to inject my code into Misago, and I already have the layout of where I will place the cards
    Current progress

    So, I decided to create a new app inside Misago that would control the logic and would send the GoogleNews information to the template I used for the cards.
    Right now, the structure looks like this:
    CodeStructure for Cards app
    ^ As a test, for now I am just trying to send the greetings variable

    The problem is that I am not receiving the data in the template and I believe that the problem is in the urls folder.

    This is what I have in api.py
    Urls/api.py

    And this is what I have in init.py
    urls/init.py

  • sadakopanorama_fish_eye
    9 posts
    4 years ago

    To be honest, I just followed what I saw other folders had in api.py and __init__.py because in other projects I just create a urls.py which has a different structure. Hopefully, you can help me to find the problem

  • sadakopanorama_fish_eye
    9 posts
    4 years ago

    I just discovered that when I add /news to the URL, then I receive the information xD
    localhost:8000/news

    But the template is then destroyed ┐(‘~`;)┌

    I don't know if the problem is in my template so I will include it here:
    gallery.html

  • rafalppanorama_fish_eye
    4 years ago

    Your template is not extending the base template, so it renders without any layout HTML as well as <head> section containing JS and CSS.

  • sadakopanorama_fish_eye
    9 posts
    4 years ago

    Thank you so much! I was able to solve it!!
    Sorry, I have been writing dumb questions but it has helped me to learn a lot

  • rafalppanorama_fish_eye
    4 years ago

    Please spend few moments to familiarize yourself with the Django Framework, that will make it much easier to work with Misago's codebase.

Search
  • Enter search query (at least 3 characters).

Your options