A few months ago I just convinced myself about not needing a PC on my daily basis, so since then I’ve been using my iPad for all the work-related stuff that I have to do such as interviews to QA candidates, create test cases and status reports and even coding for personal projects, and about this last one is what I want to tell you on this article.
I started learning Django a couple of weeks before I started this challenge, but when I decided to put my knowledge into practice I couldn’t find a bug-less article online that helped me to set that up on the iPad. So, after a little research on a couple of forums I kind of merge that knowledge together and I was able to get it working properly and without any issues (So far..), let’s jump into how I made it.
Here are the things we are going to need:
Pythonista-> A python IDE that will allow us to read, write and execute our code.
StaSH-> Is a Bash-like shell for Pythonista that will enable us to use the pip commands.
The first thing we are going to do is download “Pythonista 3” from the Apple Store, this app cost $9.99 and by the time I’m writing this article it is the only app that supports Django and other advanced development features.
Once you have downloaded the app, we need to install StaSH, this is because Pythonista does not support the pip command natively and we'll need that to install Django.
To install StaSH, launch Pythonista, click on the (+) in the bottom-left of the screen.
Then create a Python file.
import requests as r; exec(r.get('http://bit.ly/get-stash').text)
I recommend that you copy and paste the commands because sometimes the autocorrection just makes the execution to fail even if it looks "the same".
After adding the command, click on the Play button on the top of the screen, if the command is ok then Pythonista will start to download StaSH.
When the download is completed, re-start Pythonista by closing the app (don’t let the app in background) and open it again. To validate that the installation was successful, inside Pythonista go to “This iPad”, and there should be a file named launch_stash.py.
The last thing at this point is to download Django and create a test project; For that, Open the file launch_stash.py and click on the play button, this action will launch the StaSH shell where we can use the pip command.
On the StaSH shell, type the following command to download Django and hit “return” on your keyboard.
pip install Django == 3.0.7
This will start downloading the Django version that you specified and will install it on Pythonista.
Once the installation process is completed, re-start Pythonista again.
Now to create and start our first Django project on an iPad, launch the staSH shell, and type or copy the following command:
django-admin.py startproject DemoApp
After running this command a new directory with the name “DemoApp” will be created in the folder “This iPad”.
Finally to run our “DemoApp” project, re-start Pythonista (yes, again), go inside the project directory, open the “manage.py” file, hold the play button on the top of the screen and on the new field displayed paste the following code and hit the “Run” action on the top-right of the screen:
And finally, after that action Pythonista will launch the local server with the project that we just made and now you can type the IP for your local server in your browser and you will see the Django app running.
The only complaint I have about this tool (Pythonista), is that I have to re-start the app after every installation, but that’s not a big deal to me.
I really hope that the migration to ARM's CPUs on the Mac line-up finally brings more powerful tools to the iPads in the next couple years so it can be a real substitute of a PC, but currently there are certain limitations about what you can do on these devices.
Have you used an iPad or Tablet as your main work-related device? if so, let me know how was your experience or let me know if there's another tool that you want me to try on an iPad, or if you are interested in what other productivity apps I've used on my daily basis.