I started a django project (startproject
) and then I created an app (startapp
). Can I define models in my project directory and refer to them in my app code?
Asked
Active
Viewed 252 times
-1

three-cups
- 4,375
- 3
- 31
- 41
-
Generally no: you should always put models in your apps. Is it *possible*? I don't know, but it'd be ridiculous to try. – Thane Brimhall Jul 18 '15 at 02:35
1 Answers
0
from yourapp.models import Yourmodel

Undo
- 25,519
- 37
- 106
- 129

Alex Karahanidi
- 921
- 6
- 13
-
Thanks, but I'm looking to import models defined in my project dir, not my app dir. – three-cups Jul 20 '15 at 13:40