Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've always only used REST to build web services for mobile apps, for example i use Django to build the website using templates, and build a REST API using django framework, but would it be a good approach if i make de web front-end separately from django, and just consume data from the REST API i made for the mobile app ?

share|improve this question

closed as unclear what you're asking by GlenH7, MichaelT, Kilian Foth, gnat, Doc Brown Nov 11 '14 at 12:52

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Why wouldn't it be? –  GlenH7 Nov 2 '14 at 0:15
1  
@GlenH7 well, i jut wanted to know if someone have had issues with this approach , some pros and cons they could've found. –  David T Nov 2 '14 at 0:58
    
As stated by others, this should essentially be the standard way to provide presentation/backend separation for a multi-platform app. It allows you to maintain a strict separation between the presentation and data layers, and allows you to code in the way that is most idiomatic for each platform by not restricting the front end to a specific interface or language. –  Jacob Harrington Nov 2 '14 at 4:44
    
Something similar is often done for git: a single web server with some URLs used by browsers and others by git clients; the latter are handled by git-http-backend. –  outis Nov 2 '14 at 5:33

1 Answer 1

up vote 2 down vote accepted

This is the preferred approach when you want multiple front ends to connect to the same server. Build a REST API and do not output any HTML or anything else other than JSON data. You can also have an authentication rest endpoint.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.