Skip to main content

Django Framework : My first looks



I had heard about Django framework 5 to 6 month ago, my friends used it to create various API's , beautiful website and other various stuff. At the time I was learning Laravel frameowrk and was improving my python skills. I learnt Laravel without the prior knowledge in PHP, I did manage to make a social media clone however the logic writing there was bit difficult. On top of that my interest recently grew in machine learning and data science. So couple of weeks ago I quit learning laravel, and decided that i wanted to master Django.

One of the main reason I got interested in Django was this ability to create sub groups, which Django calls 'apps' , and it allowed various work to be distributed in various apps . For example if we create an E commerce website, we could create app to handle users and other apps to handle shops. This allows the code to be very distributed and easy to understand. There were other various benefits , one major one for me personally was that it was completely in python which i am very handy with.

About a week ago i started learning Django basics. Django works in MVT( Model View Template ) format. The model is a component that handles the Database. We can create a model by using python class. The view is the component where you write the logic, and template is the website that is rendered.

To start django , we will first need to install the Django package,
I recommend you start by creating python virtual environment
python -m virtualenv {virtual_env_name} will create a virtual environment for you
pip install django will install the Django package in your virtual environment
to create your first django project we can used django-admin command ,
django-admin createproject {Project_Name} this will create a folder with your project name
and inside there you will find a one very important file called settings.py
To run the server , we can just type the following ,
python manage.py runserver
By default your server will run in localhost:8000, or you can also specify the port you want to use
Congratulation you just created your first Django project


Comments

Popular posts from this blog

National Socialism

When we talk about Nazism that rose in Germany we often relate it to the patriots who wanted revenge and gave rise to Nazism, there was also a difficult economy at that time that people often relate it to. Others say Germans are just that, war hungry which of course is an insult to all Germans who fought the Nazies with all their might who sacrificed themselves. Another popular explanation is of personal feelings , like Hitler was unable to attend the art school or he was homosexual but was unable to show his feelings which of course is a very weak explanation. Another is that Nazies were able to fool people through propaganda, and miscommunication and were able to take control which of course is also a weak explanation because it was through democracy that they achieved power, and as stated earlier, in 1920s 1930s Germans were the most educated people in the world with high level of education. The primary cause of the rise of Nazism was not economy or revenge but rather the abstract p...

Aerodynamics of Sphere

** The article below has been compiled from various sources online and through other various video from platform such as youtube to provide a proper understanding of aerodynamics and fluids. ** Understanding fluid Fluid is understood as the homogeneous matter of the body where molecules are loosely bound together, which does not have any specific shape or form and can take the form of the container. The molecules in fluid are in a constant motion and are loosely bound together, This means that molecules collide with each other and with the surface of the solid object and hence there is transfer of kinetic energy with each other and with the solid surface. This  mutual transfer of kinetic energy means that the aerodynamics can be viewed from two different perspectives. One with the  perspective of the fluid itself and other with the perspective of the solid. Each of these perspective poses a challenge, in the perspective of the fluid the major challenge is to explain the motion...