d-demirci / django-adminlte3

AdminLTE Templates, Template Tags, and Admin Theme for Django
https://django-adminlte3.herokuapp.com/admin
Other
248 stars 113 forks source link

Question about installation #5

Closed craph closed 4 years ago

craph commented 4 years ago

Hi,

I'm writting this issue because I have question about the installation of your django-adminlte3.

INSTALLED_APPS = [
     # General use templates & template tags (should appear first)
    'adminlte3',
     # Optional: Django admin theme (must be before django.contrib.admin)
    'adminlte3_theme',

    ...
]

What is the difference between 'adminlte3', 'adminlte3_theme' and 'django_adminlte3' and why the order is mandatory ?

d-demirci commented 4 years ago

One is for admin area the other one is for user area. Django_admjnlte3 is the project name which holds sample application. I think this answer needs some explanation, so here it is:

for example : you start a project with Django (assuming you created and env and Django is installated) django-admin startproject sampleproject then you run pip install django-adminlte3 this will install the latest version from pypi

you edit your settings.py adding the lines you mentioned above to installed apps and (for "static_root" or "static files dir" if not already done)

then, because this is a newly created project you will need to migrate and collect statics, after all these done, you run the project (don't forget to createsuperuser if not done yet) python manage.py runserver 0.0.0.0:8080 and when you navigate to localhost:8080/admin you will see the login page and after login the admin interface is ready for you by the help of "adminlte3_theme"

now comes the user interface, all necessary things are ready for use in base.html. if you create a page e.g. index.html and this includes {% extends 'adminlte/base.html' %} {% block content %} your content here {% endblock %} the above code, your page will be able to use adminlte templates tags and etc.

if you want further customization such as menubar and leftmenu you should copy adminlte3/templates/lib folder to your project and play with the files within.

I hope this answer clarify your questions.