Leverage the power and simplicity of the Django ORM in your non-web Python projects with ease.
Follow these steps to set up and use the Django ORM in your standalone Python project:
-
Clone this project:
git clone <repository_url>
-
Connect to your database: Configure your database settings in the
settings.pyfile as you would in any Django project. -
Write your models: Define your database models in
database/models.pyfollowing the standard Django model syntax.
You can import your models easily in your project files. Instead of the traditional way, you can now use:
from database import YourModelClass