Django

Hosting Django on Google App Engine with djangae for FREE

  • Posted on: 29 May 2017
  • By: oon
Django Free Hosting on Google App Engine

note: this post based on my experience hosting Django on Google App Engine. FREE on this article means I didn't have any billing every month, it's only personal site with not-too-much load or traffic. BUT, I set this with "activated billing setting" on my Google Cloud account, still have no time to try without activate billing.

This article written in Bahasa Indonesia.

Django Rilis Terakhir untuk Python Versi 2

  • Posted on: 4 April 2017
  • By: oon
Django 1.11 is the last to support Python 2

Django 1.11 LTS rilis di bulan April 2017 merupakan seri Django terakhir yang mendukung Python versi 2.x, selanjutnya Django hanya akan dibuat untuk mendukung Python versi 3.x.

Tapi tidak perlu kuatir, soalnya versi LTS ini setidaknya didukung sampai 3 tahun untuk versi update keamanannya.

Cukup banyak update dari versi ini, lengkapnya bisa dilihat di tautan [1].

Django versi LTS sebelumnya yaitu 1.8, dirilis bulan April 2015 (2 tahun sebelumnya), dan akan berakhir dukungan pembaruan keamanannya April 2018, 3 tahun setelah rilis.

 

SELinux for nginx connect to gunicorn

  • Posted on: 7 January 2017
  • By: oon
SELinux on CentOS

Biasanya saya sering menonaktifkan SELinux begitu pertama kali masuk ke console linux yang diinisialisasi oleh penyedia cloud.

Kali ini ingin mencoba bagaimana mengaktifkan setting SELinux hanya agar nginx bisa connect ke gunicorn socket file saat memberikan layanan untuk Django.

Oke semua bermula dari log nginx:

Django Edit or Delete Permission

  • Posted on: 18 April 2016
  • By: oon
Django Edit or Delete Permission

If you add Permission in Django via Meta or programatically [1], then you realized that you need to edit or even delete the permission.

How to edit or delete Permissions?

If you are really sure you want to edit or delete it with any risk, you can add Permission to your admin page. [2]

from django.contrib.auth.models import Permission
admin.site.register(Permission)

and of course you should change (or delete it) first on your model or code.

Django REST Framework with ForeignKey Example

  • Posted on: 10 September 2015
  • By: oon

If you are a noob in Django or Django REST Framework (DRF),
it's pretty hard to find (complete) example about providing REST API for system with (sql relationship) foreign key on its database.

this example on SO is quite straigth forward and complete, about DRF with foreignkey.

http://stackoverflow.com/a/19414405/3991504

ya, you also get django.test.Client information as a bonus. nice!

mostly my problem is about reverse relationship [1][2][3].

Django Template Not Support Simple Math Calculation

  • Posted on: 27 May 2015
  • By: oon
Django, web framework for perfectionists with deadlines

I used to use Jinja2 for templating, and it support Math calculation [1].

Now when try Django template, I can't calculate simple math (only add available via builtin filter), so I have to implement filter by myself, or using django-mathfilters [2].

What do you need is only install mathfilters with pip then add mathfilters to INSTALLED_APPS on your settings.

Pages