Django with Autocomplete JQueryUI

Adi Ramadhan
2 min readMay 24, 2022

Django form field with autocomplete jquery. Data is stored in model django and autocomplete by 3 letters typed by user.
Autocomplete JQueryUI official docs here.

Autcomplete field based on data in movie model

Step 1: Preparation, Create Django Project, Initial Migration
create virtualenv: virtualenv venv
start virtualenv: venv/Scripts/activate
install Django in virtualenv: pip install django==3.2
Create Django: django-admin startproject myproject
Go to myproject folder: cd myproject
Initial Migration: python migrate

Step 2: Create Django Apps
Create apps: python startapp myapp
Add myapp to INSTALLED_APPS in myproject/

INSTALLED_APPS in myproject/

Step 3: Add Model


Step 4: Register Model in Django Admin


Step 5: Makemigrations and Migrate
Make migrations: python makemigrations
Migrate: python migrate

Step 6: Create Superuser
Create superuser: python createsuperuser
Type username, email password and retype password

Step 7: Run Server and Add Some Data
Run Server: python runserver
Login with superuser and add some data

admin site, add some data

Step 8: Set up Templates Folder
Create folder templates in myapp

Add template directory in TEMPLATES parameter in myproject/

Step 9: Create HTML Files in myapp/templates Folder


Step 10: Create Function Based View in myapp/
Update myapp/


Step 11: Setup URLs in myapp and myproject Folder

Create myapp/

Update myproject/

Step 12: Run Server and Test
Run Server: python runserver

Autcomplete field based on data in movie model