- Use VS Code for Python and Django Development
- Go to settings
- Configuring python
- Install python plugin
- Add virtual environment
- Using PEP8 and lint
- Generic configurations
- Format on save
- Ignoring unnecessary files
- Disable preview
- UI customization
- Add ruler in editor
- Increase zoom level
- Themes
- More customization
- Debugging
- Using Pylance(optional)
- Useful plugins
- In conclusion
- Get Better With Visual Studio Code
- 15 Best Visual Studio Code Themes for Developers
- 2.Vsc Material Theme
- 3. Dracula Official
- 4.Noctis
- 5.Vscode Theme Onedark
- 6. Vscode Winteriscoming
- 7.Shades Of Purple Vscode
- 8.Vsc Community Material Theme
- 9.Vscode One Monokai
- 10.Dark Plus Material
- 11.Vscode Ayu
- 12.Night Owl Vscode Theme
- 13.Synthwave Vscode
- 14.Dark Plus Syntax
- 15.Vscode Palenight Theme
Use VS Code for Python and Django Development
Visual Studio Code is an editor developed by Microsoft. I have been using this editor for Python development for sometime now. Previously I have been using PyCharm Community Edition for development, but I had to switch to an editor which was less resource consuming than PyCharm, since I have been using VS Code. It was initially suggested to me by one of my colleagues. My first impression was, what is this? Is it really usable? Is it as bad as Atom?(I have a dreadful experience with Atom, although Atom is maybe as good as VS Code). But instead, I found that it is really useful, user-friendly and has lots of useful features. Let us check out how we can use VS Code to develop Production grade Python applications.
Go to settings
You can check VS code’s documentation on how to go to User and Workspace Settings. I prefer to use Command Palette for them. To go to Workspace Settings, press CTRL+SHIFT+P(CMD+SHIFT+P for MacOS), it will open up Command Palette, then type Preferences: Open Workspace Settings. After pressing Enter(or click), you will go into Workspace settings(JSON). And to go to User settings,press CTRL+SHIFT+P(CMD+SHIFT+P for MacOS) and type Preferences: Open Settings(JSON).
Configuring python
Install python plugin
For using pythonic features, you need to install plugin Python VS Code To do that, go to Extensions Section of VS Code(marked blue in the image given below), in search section, type python; and install the red marked package called Python by Don Jayamanne(Now Maintained by Microsoft).
Add virtual environment
That should be enough to let you use the virtual environment for development. If you want to add your own modules, then add this settings:
Using PEP8 and lint
To use the above features, editor will prompt you to install pylint and autopep8, or you can install them directly in virtual environment:
pip install autopep8 pip install pylint
Generic configurations
Format on save
Add this like in dict: «editor.formatOnSave»: true It will auto format code (language does not matter).
Ignoring unnecessary files
Disable preview
When you open a file using an import file or try to go back to the declaration of the code, vs code intends to open it in a preview window, which sometimes is annoying when you want to do it multiple steps/times. To disable it, add this:
UI customization
Add ruler in editor
Adding rulers in the editor gives you a better idea of how many words you will put on a single line, in Pep8 Standard, it’s 79. So let’s add the following key and values in the settings dictionary:
Increase zoom level
Themes
You can download any theme from the vscode marketplace and install them. Currently I am using the Material theme.
More customization
Debugging
It is really cool to have debugging feature built-in VS Code. Although as far as I tested, it works perfectly fine on Ubuntu, but not in OSX. So please check before you configure it. Anyways, the best way to configure it for Django is to add the following lines in launch.js:
Or go to the Debug section (Marked green in the screenshot), click the section marked as yellow and then click add configuration.
Using Pylance(optional)
MS has also developed a tool called pylance which gives fast, feature-rich language support for Python. It can be an alternative to VS Code’s default language server for Python.
Useful plugins
- Use Code Settings Sync to synchronize your settings in between VS Code instances over multiple machines.
- You can use Git Blame to see Git blames.
- You can use Git LENS to supercharge git functionality.
- Intellij IDEA Keybindings allows you to use Idea’s shortcut keys in VSCode.
- Use VScode Icons to beautify VS Code’s icons.
- Use Material Icons for using material icons on the sidebar.
- Use Code Spell Checker to check spells in code.
In conclusion
It goes without saying that PyCharm is the best IDE for Python development. It supports refactoring, which makes life a lot easier; has advanced debugging, and its easy to configure. Still, VS code has its own charm. I prefer VS code’s UI, its configurations(which is really dynamic and lots of options) and most importantly, I can do front end development better in VS Code, as PyCharm community edition does not support JS. Also its lightweight(not resource hungry as PyCharm). Thanks for reading. Cheers!! — If you like this article, you can buy me a coffee. Thanks! Last updated: Jul 06, 2023
Get Better With Visual Studio Code
Thank you for subscribing to newsletters.
You will start receiving emails from next iteration.
Subscribe to get monthly articles about Visual Studio Code and more.
I won’t spam you. Unsubscribe at any time.
Chrome apps are really handy when you don’t want to overhaul your system with apps for every …
A simple deployment procedure to deploy Django in OpenShift, no fancy stuff.
15 Best Visual Studio Code Themes for Developers
Atom’s iconic One Dark theme, and one of the most installed themes for VS Code!
2.Vsc Material Theme
Material Theme, the most epic theme for Visual Studio Code .You can install this awesome theme through the Visual Studio Code Marketplace.https://material-theme.site/
3. Dracula Official
Dracula for Visual Studio Code
Dark theme for Visual Studio Code https://draculatheme.com/visual-studio-code
4.Noctis
Noctis is a collection of light & dark themes with a well balanced blend of warm and cold colors https://marketplace.visualstudio.com/
5.Vscode Theme Onedark
VSCode Theme based on Atom’s One Dark theme. Best rated One Dark theme port in the marketplace, features full Workbench theming.
6. Vscode Winteriscoming
This extension for Visual Studio Code adds themes titled “Winter is Coming”. There are dark, dark with no italics, and light themes.https://marketplace.visualstudio.com/items?itemName=johnpapa.winteriscoming
7.Shades Of Purple Vscode
Shades of Purple — A professional theme with hand-picked & bold shades of purple to go along with your VSCode. Reviewed by several designers and 75+ theme versions released to keep it updated. One of the top rated best VSCode themes on VS Code Marketplace. Download → https://marketplace.visualstudio.com/items?itemName=ahmadawais.shades-of-purple
8.Vsc Community Material Theme
The community maintained version of Material Theme with ”legacy» color schemes you love!
This project is community-maintained and the source is encrypted. If you want to maintain it and ship new fixes, ask to become a maintainer so you’ll have full access to the repository.
9.Vscode One Monokai
A cross between Monokai and One Dark theme
10.Dark Plus Material
I really love the default Dark+ Theme that comes with Visual Studio Code, but also love the Material Design Palette. The thing is I didn’t found a good material theme (the coloring is always ugly for my taste). So I made this theme that implements the Material Design Palette in the Dark+ theme that comes with Visual Studio Code.
11.Vscode Ayu
A simple theme with bright colors and comes in three versions — dark, light and mirage for all day long comfortable work.
https://marketplace.visualstudio.com/items?itemName=teabyii.ayu
12.Night Owl Vscode Theme
A Visual Studio Code theme for the night owls out there. Fine-tuned for those of us who like to code late into the night. Color choices have taken into consideration what is accessible to people with colorblindness and in low-light circumstances. Decisions were also based on meaningful contrast for reading comprehension and for optimal razzle dazzle. ✨
13.Synthwave Vscode
Synthwave inspired colour theme for VS Code 🌅🕶
Do you remember that endless summer back in ’84? Cruising down the ocean-highway with the top down, the wind in our hair and heads buzzing with neon dreams?
14.Dark Plus Syntax
15.Vscode Palenight Theme
Palenight Theme An elegant and juicy material-like theme for Visual Studio Code.
#vscode #theme #visual studio code #programming