Open Source Publishing Development

Thanks Nysautro!

I’m very new at anything web-related and unfortunately I’ve gotten a unique response from each developer I’ve asked… So it has been very difficult to narrow it down!

From what I gather, backbone.js was the main event up until angular.js came along and alongside backbone.js there was knockout.js; both of which seem to have given way for angular.js.

Breakdown here:

Comparisons here:

I take it you have experience with web development? I’d love to get closer into contact with you as I try and tame this beast, would you be available via Hangouts or the like? Feel free to email me at the address above!

Best,
Marcus

Thanks for sharing that information.

I do mainly front-end work, recently got a little bit into back-end. Nor sure how much I could help you as I am struggling myself atm, hehe

I will drop you an email to give you my contacts. You never know how I could be useful :slight_smile:

I’ve been doing work recently which interfaces with Shotgun/SGTK using that stack- Flask/AngularJS.

It’s really quite enjoyable- I’m able to implement standalone apps (node-webkit and PyQt webview), adobe extensions (using node and the new Chrome Embedded Framework), and web frontends that all share the same GUI code.

Angular takes a bit of getting used to, especially debugging, but so far it’s been worth it.

Hi cptincognito, great to hear there someone out there doing this. The little I’ve found about this particular stack so far has been some mishaps between the same use of delimiters for expressions in both Jinja2 and Angular ({{ }}), though it seems solvable and it looks like they are usable side-by-side with proper separation.

One question though, I’ve only briefly looked at them both and at first couldn’t distinguish where the responsibilities of one ended and the other began. For example, I initially had AngularJS handling routing but later found it quite a bit more intuitive to handle routing from Flask. Then I moved onto communicating with a server and found that to be quite a bit quicker from Flask than AngularJS.

One thing AngularJS seems to do however that Flask cannot is Single-Page Applications. But if I may ask, where do you typically divide responsibilities between the two, and which do you go to for certain functionality?

Best,
Marcus

nowadays, i usually have the server handle the REST requests and no or very little template rendering. Everything is done client side and data get sent/received through a REST service from the server

Hi TheMaxx,

Thanks for your input! Do you mean you aren’t using templates at all, or that templates are rendered client-side? Would this be something handled by something like AngularJS you mean?

I dont use flask to render html, well not with data anyways. Angular does all the rendering and stuff client side and sends requests when it needs data and needs to update the servers data.

Ah, that’s excellent, makes perfect sense. Sounds like it would relieve the server of a lot of template rendering and allow it to focus on pure business-logic and data persistence. What about markdown and code highlighting? Do/would you rely on client-side libraries for that as well?

It sounds like you’re using Angular together with Flask; that’s great! If I may ask, could you elaborate a little on what you’re using it for?

there are a ton of syntax highlighters out there for javascript, theres no reason to do that on the server.

We’re actually using django as we have a central web server and we can add different apps as needed. We use it for all sorts of stuff, for use with angular we have monitor apps for our build and bake farms. Angualr makes all of this ridiculously easy.

I forget if flask lets you define a bunch of urls up front or if you have to use decorators, but in django, I just define my api by the urls in one place so its very clear as to what can be done and which functions do what. Once that is done and tested, I move over to angular and just wire it all up and make it look pretty.

shameless plug: you may find this useful to test your REST api: https://github.com/theiviaxx/RESTAssist . You can just drop the rest.html file somewhere on your site and start firing off requests.

there are a ton of syntax highlighters out there for javascript, theres no reason to do that on the server.

That sounds amazingly obvious and yet blows my mind. This would make a server a pure data-provider which makes the most sense to me. Why are folks using server-side templating to begin with? Is it simply an older way of doing it? Sounds like it would suffer from much higher bandwidth as well. Does this make something like Jinja2 completely useless?

We’re actually using django as we have a central web server and we can add different apps as needed. We use it for all sorts of stuff, for use with angular we have monitor apps for our build and bake farms. Angualr makes all of this ridiculously easy.

That makes me happy to hear. Sounds like this is the way to go.

I just define my api by the urls in one place so its very clear as to what can be done and which functions do what.

That’s a bit above my head at the moment, and although I believe Flask encourages the use of decorators for routing, it is Python after all and I’m sure the method you speak of could apply equally well here.

you may find this useful to test your REST api

Once I get a little further into actually creating and using anything RESTful, I’ll keep this in mind, thanks!

What sort of studio are you in, film, games, commercials? With “build and bake farms” I’d assume a film facility.

jinja2 can be used for any sort of templating. I use it for html as well as documentation stuff or for our in house data format. Some times it makes sense to just let flash render the html. but for larger apps that have a lot of data, i would go with the Rest approach. Theres a better separation and better use of bandwidth. And yes, it’s somewhat of an antiquated way of doing things, e.g. php

we’re a games studio

Why not use angular for documentation as well? Sorry if it’s a little rudimentary, I just came into contact with both templates and the angular “views” and can’t quite tell them apart.

About my question above, this answered part of it.

Sorry it took a while to reply. I’m not really doing any html rendering with Flask. Flask just handles http/REST requests and serves up JSON responses. The angular apps can then be html/js embedded in client side apps, or even just html/js sitting on a network share.

[QUOTE=marcuso;25850]Hi cptincognito, great to hear there someone out there doing this. The little I’ve found about this particular stack so far has been some mishaps between the same use of delimiters for expressions in both Jinja2 and Angular ({{ }}), though it seems solvable and it looks like they are usable side-by-side with proper separation.

One question though, I’ve only briefly looked at them both and at first couldn’t distinguish where the responsibilities of one ended and the other began. For example, I initially had AngularJS handling routing but later found it quite a bit more intuitive to handle routing from Flask. Then I moved onto communicating with a server and found that to be quite a bit quicker from Flask than AngularJS.

One thing AngularJS seems to do however that Flask cannot is Single-Page Applications. But if I may ask, where do you typically divide responsibilities between the two, and which do you go to for certain functionality?
[/QUOTE]

Hey cptincognito,

Thanks for getting back to me. That makes sense now, I’ve been going through a few tutorials and developed a few applications in the past few days to familiarise myself with Angular.

For reference, and for those who are looking to contribute to this part of Pyblish (you’re very welcome to), here’s what you can do to get up to speed.

On-going Angular docs.

To get familiar with Bootstrap, I found these.

And Flask.

Finally, GitHub Pages provides free hosting of server-less apps, like you could potentially create with Angular and Heroku does the same for client/server apps.

For example, here’s the app I created using from the “From Scratch” tutorial above, but adapted for Flask and MongoDB and deployed on Heroku.

Go on, create a few “contacts”. :slight_smile:
(It might take a few seconds to load sometimes, due to limitations in the free account)

Best,
Marcus

GitHub repo for the above Contacts app is here, for those interested in seeing how a Flask/Angular app could look like.

Hi all,

Frontend is live!

Interact with it using it’s RESTful API

Early, of course, but do let us know what you think of it!

Best,
Marcus

Graphical user interface on the way!

Maya Integration

Let us know what you think!

Best,
Marcus

Linting for Content Creation

We’re talking about the possibility of taking linting as-is from source code development into content creation - how it would work, whether it would work and how it might look and act.

If you have a moment, have a look through the conversation and provide your input. We’re also looking for developers with knowledge of PySide and Maya for prototyping a first version to augment the Outliner with error highlighting.

If you’re interested, either pop a comment here, in the issue or contact me directly.

Thanks,
Marcus

After almost 6 months of development, I’m happy to announce that Pyblish is now ready for use by the public!

It currently contains minimal implementations of the minimally required ingredients to form a fully fledged publishing-based pipeline.

What you’ve got here is a free, open source publishing framework, that:

  • Works on any platform and any app that supports for Python 2.6 and upwards.
  • Can publish assets based on any arbitrary variable - such as type of asset, department, project, application, user etc. etc.
  • Has a minimal GUI implemented in the next-generation GUI framework “QML”.
  • Has a minimal web front-end for real-time updates of publishes, to be run either on-line or within an intranet.

The website is currently being worked on, but it’s got some information on how to get up and running, along with an animation of how it works from the perspective of someone who doesn’t know anything about programming or cg or film or anything.

The next and current step is actually making it easier to get started, including refining the docs but also the implementation in various areas.

Once you give it a go, and if you get lost or into trouble, I’ve got the chat open most of the day and would love to take you through getting started in there. :slight_smile: You’re also welcome to make an issue in the GitHub repository.

Let me know what you think!

Best,
Marcus