0
votes

I want to use Django for a web application I'm building that will have an admin panel. I know that you need to just activate the admin app and you're ready to go. However, I would like to have a custom panel, I mean, I want to design the layout myself, I want to add menus and forms for the admin to insert new data in the database etc. Is it possible? or I should write a similar application that will have such features?

3
So don't use the admin just use Django forms.agf
Can I also customize their look? I mean, I want to first design my pages and then use Python to handle the controls and models etc.user1115538
Yes, of course. You use Django's templating language in your HTML to pull in the form and whatever other info you need. Look at the Django tutorial and Django form docs.agf
So i can start by creating my pages and then embed the Python script in them? I didn't know Python does it à la PHP..user1115538
No, you don't embed Python in your pages. You embed HTML in templates, which are written using their own language, which are loaded and parsed by Python. So you can write the display HTML/CSS yourself, but the HTML for the form itself is written by Django. Read the docs.agf

3 Answers

1
votes

For more control over the layout (custom menus etc.) you should check django-admin-tools.

And if you take a look at Django's docs you'll learn that you can easily tweak and override most parts of the admin. For example here is a demonstration on how to use a custom form: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-custom-validation-to-the-admin

So the admin is pretty customizable. But the question if you should build your own app or reuse the admin depends pretty much on your specific needs. At least make sure you know in which directions the admin can be easily bend.

0
votes

The sole purpose for Django's admin is to allow you to manipulate (add/edit/remove) data in your database. I think you should at least try to check what the admin is capable of before trying to reinvent the wheel. You'll soon discover the level of complex insight the admin allows you to have. Then you'll discover that making it yourself is unnecessary excess of work and you'll end up with modifying a couple of admin-templates and CSS styles.

0
votes

Yes, you can customize Django Admin Panel, Django provides some sort of customization for showing database tables structure from their own, for that you can follow DJANGO ADMIN SITE DOC , it will really help you.

For the customizations beyond the Django admin site settings, you can customize admin panel add manual layout, by adding manual detailing in Django template files which are stored in Django environment, django/django/contrib/admin/templates/admin/index.html of your current Django version. You can update its HTML, CSS, and JS according to need.