1👍
✅
Horizontally splitting django models across multiple files is a valid approach. A good explanation can be found here.
Django looks for your models in the models
module which can be a file or a valid python package.
If you have a valid python package( a directory with a __init__.py
file) it will try to discover the models based on the contents of __init__.py
.
Make sure that your __init__.py
file looks like this:
from Album import Album
from Artist import Artist
Then django should discover your models correctly.
0👍
In your models.py
add.
# myproject/app/models.py:
from models/Album.py import *
from models/Artist.py import *
Note about django-south: From django-1.7 migrations has been started supported. Please check Migrations.
- [Answer]-Django how to not use cached queryset while iterating?
- [Answer]-Django template rendering extend tag incorrectly
- [Answer]-Cannot find screen.css compass/sass in django project that is compiling correctly
- [Answer]-Displaying youtube video in django 1.8 by passing id as CharField
- [Answer]-Django throwing error with '/' in url
Source:stackexchange.com