Skip to content

Instantly share code, notes, and snippets.

@parkjoohwan
Last active February 3, 2020 08:08
Show Gist options
  • Select an option

  • Save parkjoohwan/7d4125b174fd82272b57c483bba350ce to your computer and use it in GitHub Desktop.

Select an option

Save parkjoohwan/7d4125b174fd82272b57c483bba350ce to your computer and use it in GitHub Desktop.
django static 사용법

settings.py

static 폴더 url 과 경로를 설정

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

views.py

호출시 로드후 2가지방법 모두로 사용할수 있음

{% load static %}

<script type="text/javascript" src="/static/js/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="{% static 'js/jQuery.XDomainRequest.js' %} "></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment