22👍
✅
See Django ticket #10985: Explain how models can be organised in a directory
It may be that you aren’t importing your models into __init__.py
?
3👍
syncdb
will not create tables for models not located in <appname>.models
, so import it in there, e.g. from apps.foo.models import SomeModel
.
- Using height_field and width_field attribute in ImageField of Django
- Best practice when using folium on django
1👍
Here is a solution if you have a newer version of Django, supposing you have a subfolder named subfolder
:
in apps.py
of your folder app:
from django.apps import AppConfig
class MyappConfig(AppConfig):
name = 'myapp'
def ready(self):
from myapp.subfolder import models
Source:stackexchange.com