Installing Django (windows)
Django is a free and open-source web framework written in Python that adheres to the model template view (MTV) software architectural pattern. The MTV pattern is Django’s take on the model–view–controller (MVC) pattern. With Django, you can take Web applications from concept to launch in a matter of hours. Django takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.
The reason you use django because,
- Ridiculously fast.
- Fully loaded.
- Reassuringly secure.
- Exceedingly scalable.
- Incredibly versatile.
1. Install Python
Get the latest version of Python at https://www.python.org/downloads/ or with your operating system’s package manager.
If you are just starting with Django and using Windows, you may find How to install Django on Windows useful.
2. Install PIP
We assume that you are using Python3 as you have download the latest version of Python. So for Linux run this command
sudo apt-get install -y python3-pip
For windows open command prompt and run
3. Install Virtual Environment and Django
virtualenv and virtualenvwrapper provide a dedicated environment for each Django project you create. While not mandatory, this is considered a best practice and will save you time in the future when you’re ready to deploy your project. Simply type:
pip install virtualenvwrapper-win django
4. Project Folder
Lets assume you want to create a project in different drive, use bellow command in CMD
~ e:\ ~ mkdir DjangoProject ~ cd DjangoProject ~ mkvirtualenv venv (this will create venv folder in djangoProject) ~ django-admin start-project myfirstApp .
then you will see myfirstApp folder has been created with bunches for files. Among them make sure you see mange.py file.
Run follow command as well
~ venv\Scripts\Activate ~ python manage.py runserver
done!!!! Happy coding. If you have any question please comment bellow.
if you are looking to develop any project python/django you can hire microdreamit.com
Creator of Shapecss, full stack developer and founder of MicroDreamIT. I wish to feel good if my blog help you developing your coding and career. I am also looking for project and consultancy. Please keep in touch with me in my twitter, facebook or other social network.