Splitting up Django models

  1. Create a models folder under myApp.
  2. Delete models.py and add a _model_name.py_ file in the models folder for each model _model_name_.
  3. Add the following to each model file
    class Meta: 
        app_label = 'myApp'
  1. Add a line in models/_init__.py_ for each model file :
    from myModelFile import myModel

    More information at djangoproject.com



One Response to “Splitting up Django models”  

  1. 1 Thomas Güttler

    Thank you very much for this hint!

Leave a Reply