contact@digitalnotebooks.co
Stay Organized, Stay Inspired. Let's Write.

Project Setup, Modern Admin Panel Part 1

Back To All Notes
  • Notebook: Health Management System Using Django
  • Speaker: Udemy Instructor Destiny
  • Date Created: Sept. 28, 2024, 5:51 p.m.
  • Owner: Rosilie

1. Create a new folder and a new environment. Activate it. 

$ python -m venv venv
$ source venv/scripts/activate

$ pip freeze
$ pip install django

2. Create a new project: in this new folder.

$ django-admin startproject HMS_main.

3.  Run the server:

$ python manage.py runserver

http://localhost:8000/

4.  Open now a VS Code with this folder or type:

$ code .

* we have to use PIP INSTALL DJANGO again in VS Code's terminal.

5.  Create new apps and update SETTINGS.PY. I CHANGED THE PROJECT NAME FROM 'hms_prj' TO 'HMS_MAIN'

$ python manage.py startapp base

$ python manage.py startapp doctor

$ python manage.py startapp patient

$ python manage.py startapp userauths

6.  Create a new folder, TEMPLATES and update our SETTINGS.PY.

7. Set up the STATIC AND MEDIA configurations.

8. Update SETTINGS.PY to override default login/logout and user models:

9.  For messages and forms configuration, update our SETTINGS.PY:

10. Update our project URLS.PY to include the path to our static and media files:

11. To access our ADMIN PANEL, run the migrations to see the default model.

$ python manage.py migrate

12. Create your superuser

$  python manage.py createsuperuser

13. Install the packages from the RESOURCE folder. This will install the packages used by the instructor.

$ pip install -r requirements.txt

14. Instead of using default DJANGO ADMIN DASHBOARD, we use the package DJANGO JAZZMIN for a more customizable and modern look.

Include JAZZMIN in your INSTALLED_APPS in SETTINGS.PY

BEFORE JAZZMIN:

AFTER JAZZMIN:

15.  To add a more customizable look to the admin panel, add in the SETTINGS.PY the JAZZMIN_SETTINGS. Documentation here.

16. Reload your page and in the admin dashboard, you will see the UI builder, you need to copy this code and add this as JAZZMIN_TWEAKS. COPY THIS CODE INTO YOUR SETTINGS.PY.



No PDF file attached.

Notebook
Notebook Details
Title: Health Management System Using Django
Category: Coding