# Python + Django + HTML in RaspberryPi

**URL:** <https://forum.djangoproject.com/t/python-django-html-in-raspberrypi/3638>\
**Category:** Getting Started\
**Created:** [July 27, 2020, 7:37pm UTC](https://forum.djangoproject.com/t/python-django-html-in-raspberrypi/3638 "2020-07-27T19:37:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mekano69](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mekano69](https://forum.djangoproject.com/u/mekano69)\
**Post date:** [July 27, 2020, 7:37pm UTC](https://forum.djangoproject.com/t/python-django-html-in-raspberrypi/3638/1 "2020-07-27T19:37:42Z")

</div>

Hello,

I really new in django, i’m starting to learn how to work with this and I have a question.

I have done some scripts in python, their working fine in my RaspberryPi  
(as you can see: [https://youtu.be/qnEMZDzuY2E?list=PLkW5GG7wE8EI2dvLTMzjECLvhfdUsL-\_J&t=26](https://youtu.be/qnEMZDzuY2E?list=PLkW5GG7wE8EI2dvLTMzjECLvhfdUsL-_J&t=26) )

But as you can see in the video thats not “pretty”.  
Do you know if Django can help me to put this to work in the browser ?  
And add some buttons, see the code running just like you see in my video.

Some help, or tips or something would be great 🙂  
Thanks

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 28, 2020, 2:12am UTC](https://forum.djangoproject.com/t/python-django-html-in-raspberrypi/3638/2 "2020-07-28T02:12:14Z")

</div>

I’ve got a “website” that already runs on a Raspberry Pi 3B+, and it works great. Among other things, it runs shell scripts and displays the results in a web page.

So yes, in general, what you’ve done in the shell can be done as a Django app.

Keep in mind however, in Django, your program isn’t going to be running on the Pi while the web page is displayed. There’s a fundamental difference between a program running on a local machine and the “request / response cycle” of a web app. You may need to rearchitect your app to make it work in a web app environment. (Note to others reading this response - yes, I’m making a generalization, and there are ways around this. But this is fundamentally true in the “base case”.)

---

<div class="post-metadata">

**Author:** ![mekano69](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mekano69](https://forum.djangoproject.com/u/mekano69)\
**Post date:** [July 28, 2020, 2:54pm UTC](https://forum.djangoproject.com/t/python-django-html-in-raspberrypi/3638/3 "2020-07-28T14:54:52Z")

</div>

Ok thats really great …

Can you give me a small example so I can start.  
Can you use WeTransfer or something to send me the example code.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 28, 2020, 3:21pm UTC](https://forum.djangoproject.com/t/python-django-html-in-raspberrypi/3638/4 "2020-07-28T15:21:56Z")

</div>

What are you looking for a sample for?

If you’re needing help with getting started with Django, I suggest you work _all_ the way through the standard [Django Tutorial](https://docs.djangoproject.com/en/3.0/intro/tutorial01/)

Beyond that, I don’t know if there’s any code I can give you that would be of any use to you without knowing a lot more detail about what you’re trying to do, or what it is you think you need assistance with.
