Wednesday, February 10, 2016

Re: Front End and Back End separation

If you don't want FE guys to touch your Python code, I will suggest to go with option 1. DRF is a great library and creating REST API is dead simple. Data validation is pretty easy in DRF using serializers. 
I tend to write my own authorization methods with DRF but they are also easy. It is just plug and play for DRF. 

On Wed, 10 Feb 2016 at 15:33 Radek Svarz <radek.svarz@gmail.com> wrote:
Hi,

I am deciding about the new architecture of the Django business app.

The web frontend app constists of 1 highly interactive part - visual editor (using D3js) and several configuration pages.

I am strong in the Django backend part, but outsourcing the JS front end to the freelancer.com guys.

My main repo is in git. I am deploying automatically upon master push towards Openshift (i.e. pushing the whole master HEAD).

I am considering to have 2 git repos - 1 for Django and 2nd for HTML/JS FrontEnd app.
    Motivation:
        1. I do not want freelancers to touch django BE part
        2. mindset of some FE guys - they do not like Python and just want to interact against mockup BE server

Please help me choose the best approach of FE vs BE architecture. My options so far:

alt 1. Separate FE code with bower/npm packaging in own git repo
    - completely separated concern
    - communicating with Django via DRF API 
    - here I foresee issues like authentication, app versioning and data validation. I found something, but not sure whether it is still valid: http://richardtier.com/2014/03/15/authenticate-using-django-rest-framework-endpoint-and-angularjs/
    - any other issues with this approach?

alt 2. FE in Django templates with AJAX calls for the interactive editor
    - can I keep the JS in the separate git repo?  I read something about git submodules. But I am not sure whether there are any issues.

opt 3. Django crispy forms 
    - complementary option only for the app part of configuration pages
    - the idea is that these pages are rather data form driven so once the visual FE template is done, the JS FE guys do not need to focus on this

note: I tried to inspire myself from the source of great djangopackages.com and sentry, but they seam to mix FE and BE within 1 repo.

Thanks for any advice,
Radek

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/dce205dc-6c55-4873-8be5-f98efcca5780%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAByqUgjWqtofouTyU9qkk49U4Pa%3D5nGqpfG%3DaUy9RFM5S8v35A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment