1. Unlinke using the default USER MODEL, we use the ABSTRACTUSER class, so we can customize the default USER model. Update the userauths' app MODELS.PY:
COMMON FIELDS HERE USE 'blank = True'
FOR THE PURPOSE OF IMPORTING THE DATA FROM CSV FILE, so as not to break our code.
2. Update the doctor's app MODELS.PY
3. Update the patient's app MODELS.PY
4. Update the base's app MODELS.PY
5. Update the ADMIN.PY
PATIENTS - ADMIN.PY
DOCTORS - ADMIN.PY
BASE - ADMIN.PY
6. We commented out PATIENTS AND DOCTORS and BASE MODELS.PY AND ADMIN.PY and ran migrations app by app, so as not to have dependency conflict (CIRCULAR DEPENDENCY i.e. doctor
is dependent to base
, base
is dependent to doctor
.)
7. We first did our makemigrations and migrate command on USERAUTHS. It was causing us an error, so we removed the SQLITE and everything in the MIGRATIONS folder of USERAUTHS EXCEPT THE __init__.py
We run our migrations and USERAUTHS model works now. We then add our migrations on BASE app.
Since we commented out DOCTORS AND PATIENT model.py and admin.py, We undo this and execute our migrations next on them.
We then remove the commented lines in our BASE APP\MODELS.PY
We then run the general migrations for all the default models of Django project.
Create a new superuser now.
Run the server again and use the email as the login credentials. This Login interface shows up instead.
When you remove the comments around ADMIN.PY of BASE, PATIENT, DOCTOR, the ADMIN DASHBOARD now looks like this:
When you open the model like SERVICE, its interface shall be:
No PDF file attached.