0
votes

am trying to get my head around how to package a django project which contains number of apps. For that, I started a new project with following structure

PROJECT_PACKAGE
++ APPS
++++++ APP_A
++++++++++++ views.py
++++++++++++ models.py
++++++++++++ urls.py
++++++ APP_B
++++++++++++ views.py
++++++++++++ models.py
++++++++++++ urls.py
manage.py
urls.py
wsgi.py

then, I created new project and added the above structure as symbolic link in the python site-package. In my new django project, I went to the INSTALLED_APPS and added above project name.

I did not get errors on include, but when I try to view the model structure for APP_A

./manage.py sql APP_A

I was getting error that

App with label shopler is missing a models.py module.

what is he best way to include all my apps models and be seen each as independent app? is it possible?

1

1 Answers

1
votes

It sounds like your tried to add the entire first project as a symbolic link inside of the second project. That would be a problem.

A straightforward way to do what your want would be to add symbolic links for the individual apps of the first project inside of the second project. So you'd end up with something like:

Project 1/
  App A/
    models.py
    ...
  App B/
    models.py
    ...

Project 2/
  App A    [link]
  App B    [link]

And then in Project 2's INSTALLED_APPS, list the apps individually.