Braek
Braek

Reputation: 601

Python/Django REST API Architecture

I'm trying to build a niche social network like Instagram as a Python/Django application.

So the things I need, regarding architecture, are (I guess):

  1. REST API (e.g. api.mystagram.com).
  2. Public website (www.mystagram.com or mystagram.com).
  3. URL shortener (e.g. mystagr.am).
  4. Android app
  5. iPhone app
  6. Windows Phone app
  7. ...

Before this I only built simple to some less-simple websites, but never extremely complex with own custom APIs or so. I have never build my own REST API before (I have used other REST APIs though) or even built an Android/iPhone app and distributed it in the Play Store/App Store (I have made some typical hello world examples though).

So, the most important thing to me seems to create a kick-ass REST API first and proceed from there. I am blocked however by a few questions.

  1. How should I organize the projects for the public website and REST API? Should these be separate Django projects or should I create only one Django project and add both the public website and REST API as an internal Django module?
  2. Should the public website also make use of the REST API? Or is it better to just use the plain Django models for this?

Thanks in advance for any help! If somebody knows some great presentations or so on this topic (architecture), always welcome!

Kind regards, Kristof

Upvotes: 6

Views: 7881

Answers (3)

Jayesh Vaghasiya
Jayesh Vaghasiya

Reputation: 216

To Answer your first question, It would be good practice to put public web site and REST APIs into one django project. Now days every web application contains public web site as well as rest apis for mobile app. So it would be easier to maintain both website and rest apis if they both in one application. Below is Django REST Framework link. https://github.com/tomchristie/django-rest-framework

For second question, Yes you can use rest apis in website also. But in general you don't need to do it. In most of the cases django model works for you.

Upvotes: 0

stormlifter
stormlifter

Reputation: 3841

Django REST Framework

https://github.com/tomchristie/django-rest-framework

Very well maintained, great documentation, easy to use.

Upvotes: 9

Robin
Robin

Reputation: 5486

I think Tastypie will do what you want. And its simple and easy. Check this out - http://django-tastypie.readthedocs.org/en/latest/!

Upvotes: 1

Related Questions