Using Blockly in Django

33 views
Skip to first unread message

Ikum Kandola

unread,
Dec 2, 2022, 6:19:07 AM12/2/22
to Blockly
Hi

I want to use blockly within a Django web app.

I am attempting to build a custom generator for the language .QL similar to SQL.

I want to use the code from the 'Build a Custom Generator' in the Django app.


As part of the codelab, I am building on code from the 'advanced playground' as found in the blockly repository.


To run the advanced playground I need to run 'npm install && npm run start'. 

To run my django app I need to run 'python manage.py runserver'.

1) How can I add the advanced playground to Django?

2) How can I run the npm commands while running the python manage.py runserver command?

Ikum


Neil Fraser

unread,
Dec 2, 2022, 7:27:22 AM12/2/22
to blo...@googlegroups.com
I don't think anyone on our team has experience with Django, but maybe someone else here does?

This is the previous time the topic came up:

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/5b730707-b1b3-4e91-a0a0-9b64636c4b3cn%40googlegroups.com.


--
Neil Fraser, Switzerland
https://neil.fraser.name

Murali Manohar Varma

unread,
Dec 2, 2022, 5:50:23 PM12/2/22
to Blockly
First thing to note is that,

Blockly is a frontend part
Django is mainly focused on backend.

You can get the desired outcome by two approaches:

Strategy 1 :
Run a frontend service like react or similar and decoupling the blockly part with Django and make api calls for CRUD service.

Strategy 2 :
Make a static Blockly page in Django using Jinja template and run your scripts.

If your project is heavily dependent on Blockly then, Strategy 1 is recommended , if you just wanted a small part, with less custom blocks then you can go with Strategy 2.

For doubts :
My DISCORD ID : "dev. mmv#4248"

Ikum Kandola

unread,
Dec 5, 2022, 5:48:03 AM12/5/22
to Blockly
Thank you 
Reply all
Reply to author
Forward
0 new messages