Do I need an API?

55 views
Skip to first unread message

BikerJim

unread,
Feb 3, 2014, 2:17:57 PM2/3/14
to django...@googlegroups.com
Hi,

I have a fairly simple Django site up and running on Heroku kind of a test project for me, all is well and I'm pretty happy with my progress so far: easylaughs.herokuapp.com

Its a site for managing weekly theatre shows, workshops and courses and it was intended to run alongside, possibly eventually to replace, the flat HTML pages at www.easylaughs.nl, which is updated manually by three volunteers with an FTP account (bit old fashioned but there you go) :)

However there have been some grumblings about a few things, mainly that they are used to login with FTP, edit the HTML and upload the edited HTML/CSS, and they don't want to get into git, virtualenvs, python etc, but they still want to be able to edit the 'HTML pages' occasionally. I have given them a few flatpages to play with (the /press/ url for example), and explained that if there is data that changes it either should go in a flatpage or in the database...but that doesn't seem to cut it for (one of) them. (and I don't really want to end up being the only fella responsible for the website, so it would be nice to hand off some responsibility e.g. for the styling). There is also a worry about the hard won SEO... but that's for another thread...

I had a thought that they might be able to pull the django generated data from the flat HTML site and embed it, using javascript or something? For example, a stripped out version of the 'Next Show' and 'Next Workshop' data on the front page?

Do I need an API for this, or can they just pull the Django generated HTML in directly with Javascript somehow? I don't really want to suggest an iframe.. I understand they're even more old fashioned than FTP ;)

I've been reading up on django-rest-framework and it looks like just what I need, but I don't want to do work I don't need to (although it would be another interesting thing to learn!). They can CRUD the data from the admin, so it'll only be GET requests, so is an API just overkill?

Pointers for further reading very welcome, and I fully accept this might be a very, very stupid question. I really appreciate any advice you might have!

Thanks
Jim

m1chael

unread,
Feb 3, 2014, 9:31:18 PM2/3/14
to django...@googlegroups.com
I deal with the same thing... and i've set up the template directories
for them to access, and it works OK.. but I still hear complaints from
the old timers that won't want to conform to this new way of doing
things,

This isn't a stupid question at all. I'm hoping someone can give a
truly thoughtful response to this.


Mike
> --
> 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/04dce4d6-4fa8-4025-9668-200bf7788efc%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Drew Ferguson

unread,
Feb 3, 2014, 10:19:03 PM2/3/14
to django...@googlegroups.com
Hi guys

Have you considered using a Content Management System? This is what they
are designed for - to make it easy to add and manage content. Check out
the various Django CMSs and their plugins/extra modules. Or there are some
excellent non-Django OSS CMSs out their too.

There are good reasons to limit unrestrained access to CSS and HTML though
most good CMSs will allow you to relax such rules for your users if you
really need to.
--
Drew Ferguson
AFC Commercial
http://www.afccommercial.co.uk

BikerJim

unread,
Feb 4, 2014, 1:54:03 PM2/4/14
to django...@googlegroups.com
Thanks for the responses, I have thought about a CMS and that's kind of what I thought I was building albeit a very small one.

Mike, do you use heroku? I can't find a way to give ftp access to the templates, as I think its ethereal (not sure that's the right word!)..

But I guess this means that an API is overkill?

Thanks again!

Doug Ballance

unread,
Feb 4, 2014, 5:22:48 PM2/4/14
to django...@googlegroups.com
I'm not clear on your question.  I can't tell if you are wanting to allow them to edit the site layout (templates) or content that happens to contain html?  Either way, you might look into using the Ace javascript based code editor http://ace.c9.io/

If you are talking about letting them modify the templates, what we do is have a directory for each templates that is at the top of the template loader order, so all templates can be overridden.   A kind of 'theme' folder that contains the files we want to allow admins to edit.  It's fairly easy to walk that directory structure and give them a list of editable files, and then pull up a page with Ace to edit them. 

Things get a lot more complicated if you want to allow admins to override arbitrary app level templates, but it's possible too with some modified template loaders so you can track the source with regard to template resolution order.  Changes still get saved to the override directory, so no changes are made to the module level templates and they can just delete the custom file to return to original.

m1chael

unread,
Feb 4, 2014, 5:27:00 PM2/4/14
to django...@googlegroups.com
I think the point is: it's difficult for old-school tech people to
work with Django because there is a learning curve, and it's hard to
mimic exactly what they are used to, and it's difficult to persuade
them this is the right way to do things.

Mark Phillips

unread,
Feb 4, 2014, 6:20:50 PM2/4/14
to django users

I would second the idea for a full cms to solve your problem. Whether django, our some other cms.

Mark

--
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.

Avraham Serour

unread,
Feb 5, 2014, 12:41:18 AM2/5/14
to django...@googlegroups.com

I think it is dangerous to let users edit the HTML directly, in my opinion you should let them edit the content and maybe some formating

Reply all
Reply to author
Forward
0 new messages