[TUTORIAL]Installing and running Django service on Mobile
Hi steemians and fellow programmers,
Today, I will start a series of of tutorials about what's what in the world of programming, what could help us and what we really need. Today we will kick start our tutorial with "Django on mobile".
Have you ever imagined running one of the richest web framework in Python on your mobile device.
Contents in a snap
- Introduction to Django
- Tools needed
- Installing Pydroid3
- Navigating through Pydroid3
- Installing Django 1.1
- Testing Django 1.1
- Endnote
- Daily Quote
Introduction to Django
Never heard of Python before Click here to read my former post about Python, it's self-explanatory and easy to go.
Django is a web framework of Python, or in a simpler way, Django is one of Python tools used in designing web apps, simply put!.
Since we are not here to know a lot about Django, of you will like to know more about Django, you can visit their Official website, here.
Tools needed
- Patience
- An Android phone
- Network connection
- Some free space on phone's storage
Installing Pydroid3
Since we'll be using android as our developmental base, we need to install one of the best Python3 IDE on Android, which is Pydroid3.
Leta open our Google PlayStore and search for "Pydroid3" (without the quotes). Click on the first query as marked in the picture below.
Click on "install" button there and your Pydroid3 will start installing. This might take up your time as per your network speed.
Navigating through Pydroid3
After installing our Mobile IDE, we have the opportunity to set up the IDE to our own taste.
Features found in Pydroid3
- Terminal: We have the terminals, for different codes. This will be helpful when we are installing Django
- Interpreter: We have the Python3 interpreter also, this allows us to write Python codes and interpret it to what we all call output.
- PIP: PIP is one of the useful things we can find in Pydroid3. Ability to install libraries will little or no stress at all. This will be handy when we are installing Django.
There are more and more features found in Pydroid3, try to explore the beauty of this wonderful Mobile IDE and you will be wowed at how marvelous it could work.
Installing Django 1.1
After navigating through Pydroid3, I think we are set to install our web framework, Django. Life's below are the procedures to be used.
- Open Pydroid3
- Click on PIP
- Navigate to the the install tab and type the following in the space provided
Django~=1.1.0
- Click the "install" button and the installation will start immediately. The time taken for the library to finish installing is directly proportional to your network speed.
- Wait till to u receive the alert "Success", or "Done"
Congratulations, Django is installed on your Mobile phone, all thanks to Pydroid3
Testing Django
After installing our Django, let's try and rest our framework with a new project titled "steemit"
- Open Pydroid3
- Navigate to terminal
Type the following code to create a folder where our project will be
mkdir steem
This code will create a folder named "steem" in our sdcard. Then, after that code type the following to switch to the folder.
cd steem
- After that, we'll create our Django project titled "steemit" saved know our newly created folder,"steem". This can be achieved by entering the following snippets
django-admin startproject steemit
Note: You might encounter this kind of error, fear not, because it's normal,since Django is using different file system from Android File system.
Navigate to the folder of the newly created project by entering
cd steemit
Enter this snippet to migrate from the normal file system to Android own.
python manage.py migrate
This will patch the file system.
- After patching, let's start running our server by typing this little code;
python manage.py runserver
Voila, your Django server is running already!
Wanna confirm it, open your browser and type this url
http://localhost:8000
And boom it's time to start Django.
Endnote
You might still be wondering, how impossible this is, if you can read my lost very well, you can see that Python is "the impossible" and Pydroid3 is "A dream".
Thank you for your time and God bless.
Daily Quote
"Before you criticize somebody else, try to keep it in mind that you are a probably a piece of shit
Anonymous