Fakultas Ilmu Komputer UI

Commit 8fcc1b1c authored by Dwi Nanda Susanto's avatar Dwi Nanda Susanto
Browse files

Merge branch 'deploy_ch45' into 'master'

Deploy ch45

See merge request !5
parents 36d74343 ef6d63fe
db.sqlite3
geckodriver.log
__pycache__
*.pyc
......
File added
......@@ -17,6 +17,9 @@
{% endfor %}
</table>
<form action="reset-item/" method="GET">
<button type='submit'>RESET</button>
</form>
{% if items|length < 1 %}
<h3 style="color:green;">yey, waktunya berlibur</h3>
{% elif items|length > 0 and items|length < 5 %}
......
......@@ -82,4 +82,5 @@ class ItemModelTest(TestCase):
first_saved_item = saved_items[0]
second_saved_item = saved_items[1]
self.assertEqual(first_saved_item.text, 'The first (ever) list item')
self.assertEqual(second_saved_item.text, 'Item the second')
\ No newline at end of file
self.assertEqual(second_saved_item.text, 'Item the second')
\ No newline at end of file
......@@ -10,4 +10,11 @@ def home_page(req):
return redirect('/')
items = Item.objects.all()
return render(req, 'home.html', {'items': items})
def reset_items(req):
if req.method == 'GET':
Item.objects.all().delete()
return redirect('/')
items = Item.objects.all()
return render(req, 'home.html', {'items': items})
\ No newline at end of file
Brotli==1.0.7
Django==1.11.24
Django==2.2.5
djangorestframework==3.10.3
gunicorn==19.9.0
pytz==2019.2
selenium==3.141.0
sqlparse==0.3.0
urllib3==1.25.3
whitenoise==3.3.1
......@@ -14,11 +14,14 @@ Including another URLconf
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.urls import path
from django.contrib import admin
from lists import views
app_name = 'lists'
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', views.home_page, name='home'),
path('reset-item/', views.reset_items),
]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment