6

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

2
  • The Django REST framework will probably help you get started. django-rest-framework.org Commented Sep 5, 2013 at 19:15
  • Definitely use something like Django REST Framework or Tastypie. They will be part of your django project and will use your existing models. You can use it on the public site as well especially if you want to do a lot of ajax stuff. Commented Sep 5, 2013 at 19:25

3 Answers 3

9

Django REST Framework

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

Very well maintained, great documentation, easy to use.

Sign up to request clarification or add additional context in comments.

Comments

1

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

3 Comments

Thanks for the tip! I also found django-rest-framework.org earlier today. This may sound like a stupid question, but is it recommended to use REST frameworks like these or is it better to create your own implementation? Since REST is not really a standard...
Well I recommend you use Django REST Framework. Mostly because you already use Django and realize the benefit of being able to focus on your app.
OK - I'm playing with the Django REST Framework as I speak. Thanks for the tip.
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.