-2

Html code of the program i have collected static files and stored it in ASSET and gave load static in every img and a tags but still didnt able to get the static files in browser

{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="{% static 'STYLES.css' %}">
    <link rel="shortcut icon" href="{% static 'favicon-32x32.png' %}" type="image/x-icon">
    <title>HOMEPAGE</title>
</head>
<body>
    <div class="TOP">
        <table>
           <tr>
                <td><img class='LOGO' src="{% static 'LOGO.png' %}" alt="LOGO" width="150px" 
                     height="150px"></td>
                <td><p class="COMPANY">SJ-EVENTS</p></td>
                <td class="BUTTONS">
                    <ul class="BUTTONS">
                        <li class="LINK"><a href="{% url 'SERVICE' %}" 
                            target="_blank">SERVICES</a></li>
                    <li class="LINK"><a href="{% url 'CONTACT' %}" target="_blank">CONTACT</a> 
                     </li>
                    <li class="LINK"><a href="#ABOUT">ABOUT</a></li>
                </ul>
            </td>
        </tr>
    </table>
</div>
<br><br><br>
<br><br><br>
<div class="TOP1">
    <p>EVENT SERVICES</p>
    <h1>Flawless Event Management</h1>
    <h2>Whether planning an in-person, virtual, or hybrid event, there is an exciting new 
 world of opportunities available — but also new complexity.</h2>
    <br><br><br>
</div>
<img class="PICTURE1" src="{% static 'HOMEPAGE1.jpg' %}" alt="HOMEPAGE" width="1250px" 
height="550px">
<br><br><br><br>
<hr class="LINE">
<div class="MIDDLE">
    <p>Pull your event together effortlessly with expert assistance from the leading event 
 management company.</p>
    <br>
    <p>
        We work behind the scenes to keep everything moving and on time for our customers. Our 
    simplified, smart solutions make it easy for exhibitors to show up and show off — with no 
   surprises. The result? Happy customers who keep coming back to your show!
    </p>
    <br>
    <p>
        From small exhibitions to mega international events, lean on the integrated, full- 
 service solutions of our event management agency to bring your vision to life. Ensure that 
  every detail of your trade show, exhibition, conference, or event is on track and unexpected 
 hiccups are handled.
    </p>
    <br>
    <p>
        And with our SafeConnect promise, you can be confident that your in-person and hybrid 
 events will not only be flawlessly executive, you can trust they will be safe.
    </p>
</div>
<div class="MIDDLE1">
    <h3 class="LISTHEADER">If You Want</h3>
    <h3 class="LISTHEADER1">We Can Help</h3>
    <br>
    <ul class="LIST">
        <li class="POINT">A seamless attendee experience</li>
        <li class="POINT">Happy sponsors and exhibitors</li>
        <li class="POINT">Close relationships with vendors</li>
        <li class="POINT">Peace of mind that every detail is handled</li>
    </ul>
    <ul class="LIST1">
        <li class="POINT">Fill any resource gaps</li>
        <li class="POINT">Expertly manage all the moving pieces of your event</li>
        <li class="POINT">Improve exhibitor relations</li>
        <li class="POINT">Ensure the safety of attendees, exhibitors, and staff</li>
        <li class="POINT">Plan for the expected, the unexpected, and the opportunities</li>
    </ul>
</div>
<br>
<hr class="LINE">
<br><br>
<div class="BOTTOM1" id="ABOUT">
    <img src="{% static 'IMG1.JPG' %}" class="BOTTOM_IMAGE" alt="IMAGE1" width="250px" 
 height="250px">
    <table class="ABOUT_TABLE">
        <tr >
            <th class="ABOUT_HEADER"><h2 >ABOUT OUR ENTREPRISE</h2></th>
        </tr>
        <tr>
            <td class="ABOUT_CONTENT">
                <p >
                    Fugiat asperiores pariatur. Fugiat laboriosam quisquam iure. Fuga atque 
 qui vero tempora numquam. Eos sint repellat aut est debitis.
                    Pariatur neque quaerat totam repudiandae perferendis quia pariatur id. Ea 
  adipisci qui omnis. Eius molestias iusto dolorem.
                    Odio excepturi saepe dolores molestiae dolorem alias ab soluta. Eum 
  deserunt molestias voluptate consequuntur rerum.Aut aperiam facilis voluptates cupiditate s 
ed maxime quisquam. Consequatur quidem earum. Eligendi et labore ut ut quas. Natus nulla 
 necessitatibus est assumenda voluptas voluptates.
                </p>
            </td>
        </tr>
    </table>
</div>
<br>
<hr class="LINE">
<br><br>
<footer>
    <ul class="BUTTONS1">
        <li class="LINK"><a href="#" class="LINK1">PRIVACY POLICY</a></li>
        <li class="LINK"><a href="#" class="LINK1">TERMS OF POLICY</a></li>
        <li class="LINK"><a href="#" class="LINK1">ACCESSIBILTY</a></li>
    </ul>
</footer>

The above one is the html section

Django setting.py code

 STATIC_URL = 'static/'
 STATICFILES_DIRS=[os.path.join(BASE_DIR,'STATIC FILES')]
 STATIC_ROOT=os.path.join(BASE_DIR,'ASSET')

The image is the file arrangement of the project

FOLDER SECTION OF THE SITE

I have collected static files and placed {% static '' %} in all Img and a tags but I can see the html contents alone in brower not the images and css, bootstrap properties.

Pouya Esmaeili
  • 1,265
  • 4
  • 11
  • 25
  • If you inspect the **LOGO** element using the Developer Console in your browser (F-12), what does the `src` attribute say?- You can also use the Network Panel in the Developer Console + Hit Refresh and it'll show you all the URLs it tries to ping. Both those might help you narrow it down – Nealium Sep 15 '22 at 17:20

1 Answers1

0

Try removing the space in "STATIC FILES" with an underscore: "STATIC_FILES" to ensure Django can find the file.

Also, you could try and add the path in your static tag: "{% static 'STATIC_FILES/IMG1.JPG' %}"

Lewis F
  • 34
  • 7