Re: login with token instead of password

2024-01-16 Thread Ahmed Iftikhar
python manage.py startapp pincode_auth_app # pincode_auth_app/models.py from django.contrib.auth.models import AbstractUser from django.db import models class CustomUser(AbstractUser): pin_code = models.CharField(max_length=4, blank=True, null=True) *** # pincode_auth_app/admin.py from

Re: Custom User models

2023-11-27 Thread Ahmed Iftikhar
# models.py from django.contrib.auth.models import AbstractUser from django.db import models class School(models.Model): # Your School model fields class SchoolUser(AbstractUser): school = models.ForeignKey(School, on_delete=models.CASCADE) # Add other custom fields as needed

Re: Encrypt entire Django project and decrypt it in ram when starting server

2023-11-14 Thread Ahmed Iftikhar
Obfuscation can make the code less readable, but it won't provide strong security. There are Python tools like *pyobfuscate *that can be used for this purpose. However, keep in mind that this is not encryption, and determined attackers can still reverse engineer obfuscated code. While you can

Re: Writing migrations to wrong database entirely

2023-11-14 Thread Ahmed Iftikhar
It's possible that there is a migration state issue. Try running the following commands: *python manage.py migrate zeropython manage.py migrate * This will revert all migrations for the specified app and then migrate all apps to the initial state. Be cautious, as this will reset your