[Python] Static no Django

Discussão em 'Python' iniciado por Stack, Outubro 4, 2024.

  1. Stack

    Stack Membro Participativo

    Galera, Queria um conselho ou ajuda sobre os 'static' no 'Django', meus arquivos que estao na pasta 'Static" eles nao vem ser carregados apresentando os seguintes erros abaixo:

    System check identified no issues (0 silenced).
    December 30, 2020 - 15:49:40
    Django version 3.1.4, using settings 'core.settings'
    Starting development server at http://127.0.0.1:8000/
    Quit the server with CTRL-BREAK.
    [30/Dec/2020 15:49:47] "GET / HTTP/1.1" 200 6889
    [30/Dec/2020 15:49:47] "GET /static/js/plugins/plugins.js HTTP/1.1" 404 1689
    [30/Dec/2020 15:49:47] "GET /static/js/bootstrap/popper.min.js HTTP/1.1" 404 1704
    [30/Dec/2020 15:49:47] "GET /static/site.css HTTP/1.1" 404 1650
    [30/Dec/2020 15:49:47] "GET /static/js/active.js HTTP/1.1" 404 1662
    [30/Dec/2020 15:49:47] "GET /static/js/jquery/jquery-2.2.4.min.js HTTP/1.1" 404 1713
    [30/Dec/2020 15:49:47] "GET /static/js/bootstrap/bootstrap.min.js HTTP/1.1" 404 1713
    [30/Dec/2020 15:49:47] "GET /static/img/core-img/pizza.png HTTP/1.1" 404 1692
    [30/Dec/2020 15:49:47] "GET /static/static/img/bg-img/foto_receita.png HTTP/1.1" 404 1728
    [30/Dec/2020 15:49:47] "GET /static/img/core-img/logo.png HTTP/1.1" 404 1689
    [30/Dec/2020 15:49:47] "GET /static/js/bootstrap/popper.min.js HTTP/1.1" 404 1704
    [30/Dec/2020 15:49:47] "GET /static/js/bootstrap/bootstrap.min.js HTTP/1.1" 404 1713
    [30/Dec/2020 15:49:47] "GET /static/js/plugins/plugins.js HTTP/1.1" 404 1689
    [30/Dec/2020 15:49:47] "GET /static/js/active.js HTTP/1.1" 404 1662


    Na minha pasta settings.py esta da seguinte maneira

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


    e minha urls.py esta assim:

    urlpatterns = [
    path('',include('receitas.urls')),
    path('admin/', admin.site.urls),
    ] #+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)


    Alguem que ja passou por isso que possa dar uma luz ?

    Continue reading...

Compartilhe esta Página