Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 Errors in console many assets are missing from the static folder & template folder #543

Open
arunt1991 opened this issue Mar 1, 2025 · 7 comments

Comments

@arunt1991
Copy link

Bug Report

Description

404 Errors in console, it seems many assets are missing from the static folder & template folder

Steps to Reproduce

  1. I Installed the application according to the documentation.
  2. When I Login to the dashboard, I can see the dashboard, but if I check the console, it's showing many 404 errors of js files etc.
  3. When I try to configured SMTP, and tried to send a test email, it's showing some template not found.

Expected Behavior

All static folder items has to be there, also the missing templates must be there.

Actual Behavior

A lot of 404 errors & template missing errors

Screenshots

CLI ERROS
BROWSER CONSOLE ERRORS

Environment

  • Django Version: [4.1.4]
  • Python Version: [ 3.10.12]
  • Operating System: [Ubuntu 20.04]
  • Browser: [Chrome, Safari]

Priority

['high']

@unreal0901
Copy link
Contributor

@arunt1991 Try to use this command .

python manage.py collectstatic

@horilla-opensource
Copy link
Owner

horilla-opensource commented Mar 1, 2025

Hi @arunt1991 ,

To resolve the issue, when testing the Horilla mail server, run the following command in the terminal:

python manage.py collectstatic

(If you are using Ubuntu/macOS, replace python with python3.)

If you need any further assistance, please let us know.

Best Regards,
Team Horilla

@arunt1991
Copy link
Author

Thanks for the reply, When I execute this command, I can see that a new folder called staticfiles is created with many assets,

But, still when i run the project, I can see the same issue.

Screenshot

Settings.py

Anything need to be updated in the settings.py ?

The new called staticfiles is created with the above command you provided, but the http request is looking for some files under the path /static/build/js and /templates/sidebar.html

Regards,

@unreal0901
Copy link
Contributor

Hello @arunt1991,

It seems that JavaScript in the build files is making AJAX requests to templates/sidebar.html and templates/navbar.html. Additionally, the summernote.min.js.map file is missing.

Details:

LoadLayout.js file:

loadHeader() {
    $("#sidebar").load("./../../templates/sidebar.html");
    $("#mainNav").load("./../../templates/navbar.html");
}

The build files web.frontend.js and webfrontend.min.js contain AJAX calls using jQuery.

Missing File:

python manage.py findstatic build/js/summernote-lite.min.js.map
No matching file found for 'build/js/summernote-lite.min.js.map'.

@horilla-opensource, is there a way to rebuild the static files to resolve this issue?

@horilla-opensource
Copy link
Owner

Hi,

Thank you for reporting this issue!

The mentioned lines in LoadLayout.js are not used for Django HTML templates — they were originally used for designing static HTML pages. These lines are no longer required for the Django project.

We have removed the unnecessary lines and added the required static files. Please pull the latest code from the repository, rebuild the static files, and try running the project again.

If the issue persists, feel free to reach out for further assistance.

Best regards,
Team Horilla

@unreal0901
Copy link
Contributor

These two 404 AJAX requests are being made by web.frontend.min.js, which is built using the LoadLayout.js file and triggered by the loadHeader method.

Image

Image

horilla-opensource added a commit that referenced this issue Mar 3, 2025
@horilla-opensource
Copy link
Owner

Hi @unreal0901 ,

Fixed unnecessary AJAX requests from LoadLayout.js in Django templates.

Removed redundant lines used only in static HTML designs.

Please pull the latest code, clear cache, and rebuild static files. Let us know if any issues persist.

Best Regards,
Team Horilla

unreal0901 pushed a commit to unreal0901/horilla that referenced this issue Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants