I am new in django , I am developing admin panel first for my site. I need to have dependent select fields, so that after selecting country, user will be able to select city. I want that when I select country then cities of that country options load in city select box but I don't know how to customize django admin. I have done so in JS, using AJAX and PHP. So I know how to do it manually but don't know how to use ajax in django and how to customize it.
On some other questions I read that one should read, django documentation, so I tried to read and find at admin documentation but couldn't found way to customize django admin panel. Do I need to customize full page for those select boxes? Or please tell that how can I add some jquery code to it so that I can do it via JS?
You probably want to use the feature Grouped Selects in django smart selects. From the README:
If you have the following model:
And you want that all countries are grouped by the Continent and that Groups are used in the select change to the following:
There is indeed good documentation on how to customize the django admin. Here for example, you can see how to redefine the admin templates.
In the case you present, though, the easier approach as you suggest is to add some JavaScript code that adds the fields extra behavior. You can point the js file with that code in the model's admin, as explained here.