Skip to content

Instantly share code, notes, and snippets.

View sinar96's full-sized avatar

Sinar Mustika Ruslan sinar96

  • Makassar, Sulawesi Selatan, Indonesia
View GitHub Profile
sinar96 / layout.html
Created July 28, 2016 08:27
untuk memanggil layout-list yang telah kita buat.
View layout.html
<title>This is Title </title>
<!--% for user(as variable)-->
{% for user in users %}
<!--Dan disinilah dynamic route itu berfungsi-->
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
{% endfor %}
sinar96 / layout-list.html
Last active July 28, 2016 08:19
Contoh fungsi penggunaan Jinja
View layout-list.html
{% extends "layout.html" %}
{% block body %}
{% for user in users %}
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
{% endfor %}
{% endblock %}
sinar96 / Learn route in Flask
Last active July 28, 2016 12:42
Code ini akan membantu kalian untuk memahami perbedaan code pada Static Route dan Dynamic route
View Learn route in Flask
from flask import Flask
#create the application object
app = Flask(__name__)
def main():
# Static Route