- [Answered]-Python/Django development, windows or linux?-django
- Similar question
- Related Query
- More Query from same tag
- Python/Django Development: Windows or Linux?
- Windows
- Advantages
- Disadvantages
- Linux
- Advantages
- Disadvantages
- Code Examples
- Python
- Django
- Conclusion
- Python/Django development, windows or linux?
- Answers
[Answered]-Python/Django development, windows or linux?-django
I have been working on Python quite a lot recently and started reading the doc for Django, however I can’t deny the fact that most of the video tutorials I find usually shows Linux as the chosen OS. I’ve ignored this mostly, but I started to come upon some problems with people using commands such as «touch» for which I have no idea about what the equivalent is in the Windows 7 command prompt. I’ve heard about New-Item in Power Shell, however it’s messy and I am fearing that this «equivalent hunt» might come again and again.
So I started to wonder why were most of the people using Linux with Python, would be a good move (knowing that my Linux knowledge is completely null) to learn to use Linux for development purpose? Would it allow me to be more efficient at developing with Python in general? Would it be possible to list the benefits of doing so?
I used Windows for quite some time for Django development, but finally figured out that Linux is simply the better way to go. Here are some reasons why:
- some Python packages can not be installed at all or correctly in Windows OR it will create a lot of hassle for you to do so
- if you need to deploy your Django app it makes more sense to use a Unix-flavored system, simply because its 99% likely that you deployment environment is the same. Doing a dry run on your local machine with the same configuration will save you a lot of time later on + here you are «allowed» to make mistakes.
- If your apps gets complex its way easier in Linux to get the required dependencies, be it extensions, libraries, etc.. In Windows you end up looking for the right site to download everything and go through some hassle of installation and configuration. It took me lots of time to just search for some specific things sometimes. In Linux its often just an «apt-get» (or similiar) and you are done.
- Did I mention that everything is faster to get and install in Linux?
Of course if your app is simple and you don’t need to care about the deployment then Windows is fine.
Torsten Engelbrecht 12882
Similar question
django is written in pure python, so using Windows + Eclipse + PyDev for development is enough.
if you really want to follow the cool guys using some Linux commands, then have cygwin or mingWin installed and set the system PATH to BIN directive. Then, you could use them (include your touch).
Linux is best choice for deployment of a django project, where you can easily compile / install / configure some cool things like nginx, uWSGI, mod_wsgi, Apache2, and many many useful Python C extensions.
Another reason for using Linux, is that virtual private servers, which are used to host projects, are more likely to support it.
I normally use OSX on my desktop, but I use Linux for Python because that’s how it will get deployed. Specifically, I use Ubuntu Desktop in a virtual machine to develop Python applications and I use Ubuntu on the server to deploy them. This means that my understanding of library and module requirements/dependencies are 100% transferrable to the server when I’m ready to deploy the application.
If I used OSX (or Windows) to develop Python apps I would have to deal with two different methods of handling requirements and dependencies — it’s just too much work.
My suggestion: use VMWare Player (it’s free) and find a Ubuntu VM to start learning. It’s not too complicated and is actually quite fun.
Raj 3625
It depends what operating system do you like most. You could use Aptana 3 with pydev(included) for development.
When developing remember about use of «os» python lib for paths to dirs, so your application will work correctly under windows and linux.
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) MEDIA_ROOT = os.path.join(PROJECT_DIR, 'site_media')
Although there are some benefits in using Linux for Python development (for example, some libraries only work on Linux); there is nothing stopping you from using Windows for django work; I use it everyday and nothing has yet to crop up.
The right IDE that you are comfortable with will go a long way towards making your development experience more enjoyable. Many people use Pydev with Eclipse; but I prefer PyCharm
A lot of the tutorials will show you a Linux or Mac desktop (and shell) and you can get the equivalent commands (like touch , ls and others) by installing unixtools — which are native versions of common unix tools.
You should bookmark this website which has Windows installers for common Python libraries.
Related Query
- Error importing a Django project from windows to linux
- Python 2.6.2, Django 1.0.3, Windows XP, Page not found: /
- python 3.5 — django 1.10 — mysqlclient windows 7 installation error
- Error 0x80070585 when running Fastcgi with IIS 8 + Python 3.4 + Django 1.8 + Windows Server 2012
- Proxy error while django installation on python 3.7 in windows
- How to get a file from a network windows directory and move to my Python Django project directory?
- Django development server seems to be using old version of python source file
- How to stop the Django development server on windows
- How to configue apache and mode_wsgi for local django development on windows
- Heroku Django app development on Windows
- Start Django development server on AWS EC2 Amazon Linux
- How handle or convert // to / in url address in python django and apache — linux
- Django Move Project from Windows Host to Linux Host (and Deploy)
- Configure Python 3.4 and Django on Windows Azure
- Web development using Python framework Django
- Is Django and Active Python 2.x for production environments on Windows 2008 R2 with IIS 7.5?
- TinyMCE popup windows not working in Django development server
- Python Django website not showing on Ubuntu like on Windows
- Creating a JSON response using Django and Python
- How to execute a Python script from the Django shell?
More Query from same tag
- How can I write the regex for those urls
- django multiple image uploading store uploaded image in a list
- mysite.wsgi file is missing after creating django project
- multiple load tags in django templates
- Django-CMS: Multiple domains on same project
- RabbitMQ or Redis exploding Celery queues with Django 2.0
- How to run django development server at startup?
- Create Read-Only MySQL Database Connection in Django
- Heroku migrate causes: (staticfiles.E001) The STATICFILES_DIRS setting is not a tuple or list
- Filter date by month DRF
- django entry_set definition
- Braintree JSv3 payment_method_nonce Value Bad With HostedFields
- Django dump : models don’t validate
- Django get_object_or_404 in details view not returning all the fields from the Page model
- How to use Weasyprint with AWS Lambda? (Django & Zappa)
Python/Django Development: Windows or Linux?
When it comes to Python/Django development, one of the most common questions is which operating system to use – Windows or Linux. The answer is not straightforward, as it ultimately depends on your personal preference and project requirements. However, there are some considerations to keep in mind that can help guide your decision.
Windows
Advantages
- Windows is a popular and widely-used operating system, so it has a large user base and plenty of resources available for troubleshooting and support.
- Many developers prefer the Windows interface and find it more user-friendly than Linux.
- If you’re already using Windows for other applications, it can be convenient to stick with the same operating system for your development work.
Disadvantages
- Python/Django development on Windows can be challenging at times. Some libraries and tools may not be fully compatible with Windows, and you may encounter issues with file paths or environment variables.
- Some developers find that Windows is slower and less efficient when running certain tasks, such as server processes or virtual machines.
Linux
Advantages
- Linux is a popular choice for Python/Django development, as it is open-source and highly customizable.
- Many developers find Linux to be faster and more efficient than Windows, especially when it comes to running server processes or virtual machines.
- Linux has a large and active community of developers, which means there are plenty of resources and support available.
Disadvantages
- Linux can have a steeper learning curve than Windows, especially if you are not familiar with the command line interface.
- Some developers find the Linux interface to be less user-friendly than Windows.
Code Examples
Regardless of which operating system you choose, the code for Python/Django development will be the same. Here are some basic code examples to get you started:
Python
# Hello World in Python print("Hello, World!")
Django
# views.py from django.shortcuts import render def home(request): return render(request, 'home.html')
Welcome to my website!
Conclusion
In the end, the decision of whether to use Windows or Linux for Python/Django development is a personal one. Consider your own experience and preferences, as well as the requirements of your project, to make the best choice for you. With the right tools and resources, you can successfully develop Python/Django applications on either operating system.
Python/Django development, windows or linux?
I have been working on Python quite a lot recently and started reading the doc for Django, however I can’t deny the fact that most of the video tutorials I find usually shows Linux as the chosen OS. I’ve ignored this mostly, but I started to come upon some problems with people using commands such as «touch» for which I have no idea about what the equivalent is in the Windows 7 command prompt. I’ve heard about New-Item in Power Shell, however it’s messy and I am fearing that this «equivalent hunt» might come again and again.
So I started to wonder why were most of the people using Linux with Python, would be a good move (knowing that my Linux knowledge is completely null) to learn to use Linux for development purpose? Would it allow me to be more efficient at developing with Python in general? Would it be possible to list the benefits of doing so?
Answers
I used Windows for quite some time for Django development, but finally figured out that Linux is simply the better way to go. Here are some reasons why:
- some Python packages can not be installed at all or correctly in Windows OR it will create a lot of hassle for you to do so
- if you need to deploy your Django app it makes more sense to use a Unix-flavored system, simply because its 99% likely that you deployment environment is the same. Doing a dry run on your local machine with the same configuration will save you a lot of time later on + here you are «allowed» to make mistakes.
- If your apps gets complex its way easier in Linux to get the required dependencies, be it extensions, libraries, etc.. In Windows you end up looking for the right site to download everything and go through some hassle of installation and configuration. It took me lots of time to just search for some specific things sometimes. In Linux its often just an «apt-get» (or similiar) and you are done.
- Did I mention that everything is faster to get and install in Linux?
Of course if your app is simple and you don’t need to care about the deployment then Windows is fine.