글

[Django API] webapp

[Django API] homepage

[Homepage] - Homepage APP 설치 cd cd [ project ] python manage.py startapp homepage - Bootstrap4 Template 설치 HTML, scss, css, js, img, font 설치 (Education Template) project/homepage/templates/homepage/education/    *.html project/homepage/static/homepage/    css    scss    js    images    font - base.html 작성 base.html - *.html Template 작성 template.html - models.py 생성 models.py - admin.py 생성 admin.py - views.py 생성 views.py - urls.py 생성 urls.py - *.html 생성 index.html

[Django API] homepage

[Homepage APP 설치] cd cd [ project ] python manage.py startapp homepage [Bootstrap4 Template 설치] HTML, scss, css, js, img, font 설치 (Education Template) project/homepage/templates/homepage/education/    *.html project/homepage/static/homepage/    css    scss    js    images    font [base.html 작성] base.html [*.html Template 작성] template.html [models.py 생성] models.py [admin.py 생성] admin.py [views.py 생성] views.py [urls.py 생성] urls.py [*.html 생성] index.html

[Django APP] django-chartjs

[설치] pip install django-chartjs [설정] INSTALLED_APPS = (     '...',     'chartjs', ) [활용] 1. Create the HTML file {% load staticfiles %} <html>     <head>         <title>django-chartjs line chart demo</title>         <!--[if lte IE 8]>             <script src="{% static 'js/excanvas.js' %}"></script>         <![endif]-->     </head>     <body>         <h1>Some Line Charts loaded in Ajax!</h1>         <canvas id="myChart" width="500" height="400"></canvas>         <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>         <script type="text/javascript" src="{% static 'js/Cha...

[Django APP] django-bootstrap-datepicker-plus

[설치] pip install django-bootstrap-datepicker-plus [설정] INSTALLED_APPS = [     # Add the following     'bootstrap_datepicker_plus', ] [활용] # Use BOOTSTRAP3 if you are using Bootstrap 3 BOOTSTRAP4 = {     'include_jquery': True, } {% load bootstrap4 %}       {# import bootstrap4/bootstrap3 #} {% bootstrap_css %}         {# Embed Bootstrap CSS #} {% bootstrap_javascript jquery='full' %}  {# Embed Bootstrap JS+jQuery #} {{ form.media }}            {# Adds date-picker required JS and CSS #} # File: views.py from django.shortcuts import render from .forms import UserForm def create_user(request):     user_form = UserForm()     return render(request, 'my_template.html', {'my_form': user_form}) [사례] Custom Form usage # File: forms.py from bootstrap_datepicker_plus import DatePickerInput from d...

[Django APP] django_bootstrap4

[설치] pip install django-bootstrap4 [설정] INSTALLED_APPS = [      ...      'bootstrap4',      ... ] [활용] {% load bootstrap4 %} {# Display a form #} <form action="/url/to/submit/" method="post" class="form">     {% csrf_token %}     {% bootstrap_form form %}     {% buttons %}         <button type="submit" class="btn btn-primary">Submit</button>     {% endbuttons %} </form>

[Django Homepage] Develop Homepage