15👍
✅
use:
from library.models import MyClass
and you should be good to go 🙂
(the basic structure is from <app>.models import <ModelName>
)
update:
the problem is (almost!) certainly that your model begins with ‘7’ — change it to a letter character, and all will be well, I’m (almost!) sure 🙂
3👍
for example in your models.py
you got :
from django.db import models
from django.contrib.auth.models import User
class register(models.Model):
user = models.OneToOneField(User)
Then in your views.py
, you can call like this :
from library.models import register
- [Django]-Saving post from tweepy to django model in a good way
- [Django]-Django default foreign key value for users
- [Django]-Is there a framework like now.js for Django?
Source:stackexchange.com