How to develop a frontend web app for using REST services

90 views
Skip to first unread message

kk

unread,
Oct 16, 2015, 2:10:30 AM10/16/15
to django...@googlegroups.com
Dear all.
I got some very important suggestions from members of this list on using Django for an accounting and inventory system, including Point of Sale.
After the POS topic was discussed,
OUr team decided to write a RESTfull server with all the business logic in API.
We plan to do this using some thing like Flask micro framework and then write a complete web app using Django to consume these services.
Of course it could be argued that why not use Django REST framework?
But here I am a bit surprised as well as a bit disappointed.
Contrary to what we have all seen and experienced about Django's documentation, the rest framework is not at all comprehensively documented.
I am still not totally understood the use of
serializers.HyperlinkedModelSerializer.
 viewset is also not totally explained properly.  the tutorial is pretty fast and confusing.
I think a better example would have served it more understandable.
Or perhaps the documentation there asumed that every one who reads it is a Django as well as REST expert, even then it is confusing.
Any ways coming back to the topic.
So What suggestions could I get about my main query?
happy hacking.
Krishnakant.

kk

unread,
Oct 16, 2015, 6:02:06 AM10/16/15
to django...@googlegroups.com
hello again,
I haven't got my doubts solved but a few got added.
I was again going through the tutorial on Django REST framework.
I am trying to know if I can use a serialiser without tying it to the DJango ORM or for that matter without tying it to any thing?
I prefer using SQLAlchemy and get the data out using sql expression language.
Then I would like to convert this data to json format for sending as response.
Is this possible?
Happy hacking.
Krishnakant

Xavier Ordoquy

unread,
Oct 16, 2015, 6:10:17 AM10/16/15
to django...@googlegroups.com
Hi,

I wrote a short blog post about getting most of Django REST framework without using Django models.

You will loose the integration with the Django Models and will need to do a few things by yourself (pagination for example) but it’s still perfectly possible to do that.
Note that most of the documentation covers Django Models because it’s where most of the options are. When you don’t use them, it’s up to the developers to provide the content which will be very different from a project to another.

Hope this will help,

Regards,
Xavier,
Linovia.


--
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/5620CACC.2060702%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

C. Kirby

unread,
Oct 16, 2015, 10:30:58 AM10/16/15
to Django users
Hi,
The reason the quality of the documentation for DRF is different than that of django proper is because DRF is a third party application with its own development, workflow, and documentation practivces.. Also because of that, you should probably be using the DRF group for questions about the rest framework specifically:
https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework

Best,
Kirby

kk

unread,
Oct 17, 2015, 10:01:19 AM10/17/15
to django...@googlegroups.com
Hi Xavier, well I am just not using the Django ORM.  That does not mean I am not going to use ORM at all.
I will be using sqlalchemy which my team is very proficient with when it comes to do even complex tasks.
In addition we will be using baked queries etc for performance enhancements.
So I guess the approach you suggested will be good.
I will ask more questions after reading your blog, but thanks again.
Happy hakcing.
Krishnakant.

kk

unread,
Oct 17, 2015, 10:28:33 AM10/17/15
to django...@googlegroups.com
Hi again,
Xavier, I have gone through the main DRF documentation and also seen your blog.
I am wondering if you can send me an off line email which can explain the relation between serializer and viewset?
I have not got the concept clear, I am beginner to REST and all I understand is that the response is generally in form of json.
happy hacking.

Krishnakant.


On Friday 16 October 2015 03:39 PM, Xavier Ordoquy wrote:

bobhaugen

unread,
Oct 18, 2015, 9:21:05 AM10/18/15
to Django users
krmane, are you posting these same questions in the REST framework forum?

I'm guessing they would like a SQLAlchemy plugin.

Unlike you, however, I like their documentation, and have found the DRF gang to be responsive to issues.  That being said, I haven't actually used it in production yet. Just experimenting.

kk

unread,
Oct 19, 2015, 1:28:13 AM10/19/15
to django...@googlegroups.com


On Sunday 18 October 2015 06:51 PM, bobhaugen wrote:
krmane, are you posting these same questions in the REST framework forum?

I'm guessing they would like a SQLAlchemy plugin.
If such a plugin does exist it is great.

Unlike you, however, I like their documentation, and have found the DRF gang to be responsive to issues.  That being said, I haven't actually used it in production yet. Just experimenting.
I too don't find the documentation bad or unorganized, just that there are some situations not covered.
And I feel enough time should have been given to explain fundamentals of serializers or viewsets.
For example no matter which ORM I use, I do not totally rely on the Object mapping in any big project.
The approach I take is to use ORM for small result sets and using sqlalchemy expression language for big tasks.
Data objects have an overhead and the convenience comes at a cost of speed for huge data such as those with more than 50000 records and that too when queries are complex enough.
Of course I will write to them in a short while.
happy hacking.
Krishnakant.
-- 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/730ad048-30e4-4c15-95b0-b76c2ee2d582%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

Xavier Ordoquy

unread,
Oct 19, 2015, 4:35:50 AM10/19/15
to Django users
There isn't much to say.
ViewSet exposes the CRUD part, while serializer maps an object to native Python types.

Regards,
Xavier,
Linovia.
Reply all
Reply to author
Forward
0 new messages