python django, why cs+js are working on localhost styles, but they don't work at remote server, purely html.



  • Css + js + images on the local server, but the remote grey does not display the naked html

    {% load static %}
    <!doctype html>
    <html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0">
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <base href="./">
        <title>Umbrella Co - Главная страница</title>
        <meta property="og:title" content="Umbrella Co - Главная страница" />
        <meta name="twitter:title" content="Umbrella Co - Главная страница" />
        <meta name="og:image" content="assets/uploads/leon.jpg?p=l6pHObFi" />
        <meta name="twitter:image" content="assets/uploads/leon.jpg?p=l6pHObFi" />
        <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
        <!-- Compressed Styles -->
        {# <link href="css/slides.min.css?521351" rel="stylesheet" type="text/css"> #}
        <link type ="text/css" href="{% static 'umbrella/css/slides.min.css'%}" rel="stylesheet" />
                                                           <!-- пример css  -->
        <!-- Fonts and Material Icons -->
    


  • In brief, your server does not find / does not provide correct static files. I think you didn't build a web server on your remote car, but you just started projecting standard local methods.

    I recommend reading https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-20-04-ru in which the fascination reveals the way in which a project is being launched using Linux, Django, Postgres, Nginx and Gunicorn, in the process of study, you will be able to change the technology that you need, good luck!

    Supplement:

    Could be useful for Apache:

    Alias /static/ /path/to/mysite.com/static/
    

    <Directory /path/to/mysite.com/static>
    Require all granted
    </Directory>



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2