12👍
The Django people are sensible people with a philosophy of decoupling things. So yes, in theory you should be perfectly able to use Django’s ORM in a standalone application.
Here’s one guide I found: Django ORM as a standalone component.
4👍
I would suggest using SQLAlchemy and a declarative layer on top of it such as Elixir if you prefer a Django-like syntax.
- Is npm in Node like virtualenv in Django?
- I cannot ignore pycache and db.sqlite on Django even though it refers them at .gitignore
- Django. Invalid keyword argument for this function. ManyToMany
- Django Class Based Generic Views URL Variable Passing
3👍
Yes it is. The Commonsense Computing Project at the MIT media lab does that for ConceptNet,
a semantic network. You can get the source here: http://pypi.python.org/pypi/ConceptNet/4.0b3
- Django: Custom User Model fields not appearing in Django admin
- Django – links generated with {% url %} – how to make them secure?
- How to create a filter form for a (class based) generic object list in Django?
- Perform a logical exclusive OR on a Django Q object
- How to annotate Django view's methods?
1👍
The peewee ORM has a declarative syntax that should be familiar to django users, and can be used as a standalone. Here are the project docs
- Is it possible to make a mobile app in Django?
- Pycharm error: Improperly configured
- Django – disable one of system checks
- What became available_attrs on Django 3?
0👍
I would suggest another ORM for a desktop application maybe SQLAlchemy or SQLObject.
It i possible to use the django ORM but I think other ORM are a better ones if you are going to use them standalone.
- Django conditional Subquery aggregate
- How to format django template in Sublime Text
- DeleteView with a dynamic success_url dependent on id
0👍
Camelot seems promising if you want to do Python desktop apps using a DB. It uses SQLAlchemy though. Haven’t tried it yet.
0👍
This is possible and is documented in the docs here:
You need to setup django like below:
import django
from django.conf import settings
from myapp import myapp_defaults
settings.configure(default_settings=myapp_defaults, DEBUG=True)
django.setup()
# Now this script or any imported module can use any part of Django it needs.
from myapp import models
- Why don't Django and CherryPy support HTTP verb-based dispatch natively?
- How to find top-X highest values in column using Django Queryset without cutting off ties at the bottom?
- How do I redefine functions in python?
- Filter a Django form select element based on a previously selected element