section/models.py
from django.db import models
from django.contrib.auth.models import User
class userProfile(models.Model):
user = models.OneToOneField(User)
admin.py
from django.contrib import admin
from section.models import userProfile
admin.site.register(userProfile)
If I add below entry with "on_delete=models.CASCADE"
user = models.OneToOneField(User,on_delete=models.CASCADE)
the error got subsided but the new class "userProfile" is not appearing in admin page, under Users tab.
Also, run migrations:
C:\Users\srini\djangoProjects\college>python manage.py makemigrations
No changes detected
C:\Users\srini\djangoProjects\college>python manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
No migrations to apply.
Could someone please guide me how to fix this?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPC7spgQAR0e28KtZG4Ljt%3Dk4Su39qipvZJaRy4%3DCJbD6CTMCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/D9BEB906A6B607A4.5302fd9d-847e-4878-88de-82caf2f9c69b%40mail.outlook.com.
4. Execute the makemigrations, but it prompting with the error.24-09-2018 16:37 <DIR> .24-09-2018 16:37 <DIR> ..23-09-2018 15:06 <DIR> college19-09-2018 08:56 554 manage.py19-09-2018 10:59 <DIR> section1 File(s) 554 bytes4 Dir(s) 32,464,281,600 bytes free
C:\Users\srini\djangoProjects\college>python manage.py makemigrations sectionApp 'section' could not be found. Is it in INSTALLED_APPS?
from django.apps import AppConfigclass ClassConfig(AppConfig):name = 'section'
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/42ee3cf4-5347-4371-b9aa-343aa946c191%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/765c04b2-1ed2-4e30-92a0-2a28f60c178d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.