New to Django question about using it without ORM

398 views
Skip to first unread message

krmane

unread,
Nov 7, 2014, 2:35:25 PM11/7/14
to django...@googlegroups.com
Hello all,
I am absolutely new to Django.
I am really impressed with it's features.
I have used Pylons before, but I realise now that it just does not fit my way of doings things.
I am into writing financial applications.
As a matter of Fact I have GNUKhata a free and open source accounting software which I did develop with Pylons.
However my core logic is a separate xmlrpc package developed using twisted.
I have a desktop based (browserless ) frontend for the same core logic module writen in SWT Java.
But now I wish to revamp the entire webapp from pylons to Django.
Now I have a few questions.
1, I don't wish to use Django's ORM, because I won't write my models in Django.  They have been taken well care of in my xmlrpc based Python backage.
2, I only need to make use of the control logic (view as I understand ) and the templates.  For this I wish to know if this can be done.
3, I have herd about krispy-forms, any views on using them to make my ajax calls as well as forms?
4, I am looking at the Django tutorial for version 1.7, it says tutorial is ment for Python 3X.  How can I get a tutorial for Django 1.7 but for Python 2.7X?
It is just a requirement which I am not able to do away with so I will need a tutorial for Python 2.7.
Or do you guys still recommend me to go with Django 1.6 for this given case?
Lastly, Please if possible mail your replies to my email directly, I am a totally blind programmer and the google interface is not that good.
I like mails dropping into my Thunderbird inbox so that I can reply them easily.
Happy ahcking.
Krishnakant.






Andreas Kuhne

unread,
Nov 7, 2014, 3:16:02 PM11/7/14
to django...@googlegroups.com, krm...@gmail.com
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2c5faea9-5522-42e5-982b-09334ee75aff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi,

A couple of your questions answered:
1. You don't need to use Django's ORM, but you will not be able to use certain features, for example the model based class based views (ListView, DetailView, UpdateView).
2. To use djangos views and templates, you should really first understand Djangos MVC philosophy. In the view you should get all of the items you want to show to the user and make the template as "dumb" as possible. It should ideally not have any advanced logic in it (think of dumb HTML).
3. No comment on the forms (haven't used them), but it shouldn't be that hard to implement.
4. The difference between Python 2 and Python 3 has been easier from version 3 to version 2. I don't think you will have that much problems using python 2 instead of python 3 in the tutorials. And if you do, it shouldn't be that hard to fix. Django 1.7 requires at least version 2.7 though. If you find that going through the tutorial with python 3 doesn't work, try to do the 1.6 tutorial with 2.7 first and then try the 1.7 tutorial. You will get the hang of things and should be able to see where the problems are.

Good luck!

Regards,

Andréas

Aliane Abdelouahab

unread,
Nov 7, 2014, 3:16:51 PM11/7/14
to django...@googlegroups.com
- Google groups hide your email so crawler dont use it to gather emails for spams.
- Django 1.7 has the features people always waited it, the the 'migrate' which allows you to change your schema and let Django rédapate it :)
- the orm is independant, you can directly write raw sql if you want, the orm has been made for people who are not made to learn sql again, and to stay in object programming.
- for python 2.7 i think all tutorials make it to work on 2.x because not all the packages have migrated to python 3 (i talk about third parties), the difference in tutorials, is about using the unicode .

Krishnakant Mane

unread,
Nov 7, 2014, 3:28:55 PM11/7/14
to Andreas Kuhne, django...@googlegroups.com
On 11/08/2014 01:44 AM, Andreas Kuhne wrote:
A couple of your questions answered: 1. You don't need to use Django's
ORM, but you will not be able to use certain features, for example the
model based class based views (ListView, DetailView, UpdateView). 2. To
use djangos views and templates, you should really first understand
Djangos MVC philosophy. In the view you should get all of the items you
want to show to the user and make the template as "dumb" as possible. It
should ideally not have any advanced logic in it (think of dumb HTML).
Yes I am aware of this philosophy. Infact I have all my core business
logic in my xmlrpc service based engine which is actually the real software.
Thus my views will only query the APIS (getters and setters etc) and
either send data to the templates or get data from templates and send to
the core rpc engine.
SO I wonder for such a minimalistic middle layer logic, do I need a lot
of special features of views?
3. No comment on the forms (haven't used them), but it shouldn't be that
hard to implement. 4. The difference between Python 2 and Python 3 has
been easier from version 3 to version 2. I don't think you will have
that much problems using python 2 instead of python 3 in the tutorials.
And if you do, it shouldn't be that hard to fix. Django 1.7 requires at
least version 2.7 though.
yes I do work with only Python 2.7.
The only thing I am not understanding is that in the tutorial it says
"if you are still using Python 2.7 you will need some changes in the
code, for more details see the comments ".
I did not say any special comments so far.
Can you please tell me which things should I look out as pitfalls.
And except the migrate system instead of syncdb, do we have some other
things which are fundamentally different from Django 1.6?
happy hacking.
Krishnakant.

Krishnakant Mane

unread,
Nov 7, 2014, 3:38:48 PM11/7/14
to django...@googlegroups.com
On 11/08/2014 01:46 AM, Aliane Abdelouahab wrote:
> - Django 1.7 has the features people always waited it, the the 'migrate'
> which allows you to change your schema and let Django rédapate it :)
In my project, all the core logic and database queries (using sqlalchemy
) are in a different rpc based service written in twisted.
I don't need the model part of Django, just the views to get or send
data to the rpc service called the core_engine and get data from there
and send to dum html templates.

> - the orm is independant, you can directly write raw sql if you want, the
> orm has been made for people who are not made to learn sql again, and to
> stay in object programming.
Again as I mentioned, I don't need to think about databses or models at
all, I just need to do the frontend logic here, it will have very
minimal processing in views and of course templates will make good use
of AJAX and JSON.

> - for python 2.7 i think all tutorials make it to work on 2.x because not
> all the packages have migrated to python 3 (i talk about third parties),
> the difference in tutorials, is about using the unicode .
>

Can you give me one example where the difference will be obvious?
If the syntax from the official 1.7 tutorial can work with Python 2.7
out of the box, then I will hav no issues lerning directly with version 1.7.
I just wish to only elaborate the fact that I only need to use the views
as the middle layer between the templates on one side (the client facing
side ) and the logic in a Python based core_engine written in xmlrpc.

If I am not loosing out the ease by which templates can be built using
Django and some libraries like krispy-forms then I am more than happy.
I would ideally love to have integrated libraries generate good deal of
css for me to make forms look good and be accessible.
Happy hacking.
Krishnakant.

Aliane Abdelouahab

unread,
Nov 7, 2014, 4:12:26 PM11/7/14
to django...@googlegroups.com
if you are in twisted, why you dident look at tornado?

Aliane Abdelouahab

unread,
Nov 7, 2014, 4:14:30 PM11/7/14
to django...@googlegroups.com
and here is an excellent tutorial on python 2.7 :
Reply all
Reply to author
Forward
0 new messages