Creating the shared application
The shapeEditor.shared
application will hold the core database tables and Python modules we use throughout the system. Let's go ahead and create this application now. Use the cd
command to change the current directory to the top-level shapeEditor
directory and type the following:
python manage.py startapp shared
This will create a new Python package named shared
that will hold the contents of the shared
app. Note that, by default, a new application is placed in the topmost shapeEditor
directory. This means you can import this application into your Python program like this:
import shared
Django's conventions say that applications in the topmost directory (or anywhere else in your Python path) are intended to be reusable—that is, you can take that application and use it in a different project. The applications we're defining here aren't like that; they can only work as part of the shapeEditor
project, and we would like to be able to import them like this:
import...