Yeah, it seems weird coding with your phone, but right now I don't have an option, so if you are like me or you just fancy the idea, you can also do this. This is not an introduction to Django tutorial but how to work on Django with your android.
First we need something like a Linux terminal(or CLI) for android. Lucky for us, there is a terminal emulator on Google play store called Termux, so head to playstore and install it.
Okay, so you have installed it, what next?
So basically you can do whatever you could do on a Linux terminal now with this app(create directories, move files, change directory). This is how Termux looks like.
So let's roll in. Enter this command to view where Termux saves your files.
So to be able to access your files..
run this command
N:B this command doesn't point to your external SD card but your internal SD card(storage).
Then let's create a folder to store our Django projects, let's call it django_projects.
So run this command.
Now let's install python
To install python, run this
To check if python is installed, run the python command to enter python console.
N:B Use ctrl + z to exit the terminal. Termux app comes with a ctrl key.
Let's create a project called mysite
So still in that django_projects, run this commands.
We need a virtual environment to avoid dependencies clash. So let's install a virtual environment, run this command.
After installing it, run
to create a virtual environment.. Then activate the virtual environment by running (note the full stop)
Now we have a virtual environment, let's install Django. run..
Okay, so Django is installed in our venv, let's create a Django project. run..
(note the full stop)
Then let's run migrations..
You can then run the server..
voilà, go to your phone browser and open http://127.0.0.1:8000 and you should see this.
You can always view your files by going to your file manager and searching for django_projects folder.
Feel free to indulge me, if any issues.