Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Django SamplesNew to Visual Studio Code? Get it now.

Django Samples

MengsiCode

|
28,466 installs
| (2) | Free
Provides some samples code to code fast using django
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Django Samples

Provides some boilerplate code for commons operations in Django If like me you always use django, you may that a lot of tasks are just repetitive. This extension will solve the issue for you with a simple !cmd + TAB and your up and running with a full sample.

Alt text

Shortcuts/Commands

Command Function
!fbv Creates a function based view
!cbv Creates a class based view
!form Provides a sample for forms.Form
!modelForm Provides a sample for model.ModelForm
!model Provides a sample for model.Model
!email Send email with one line
!c_email Generates a function to send email with alternatives
!paginate Provides a simple pagination code
!django_pdf Generate pdf from html
!object_404 Get Object or 404
!list_404 Get List or 404
!f_field Provides a ForeignKeyField sample
!c_field Provides a Charfield sample
!m2m_field Provides a ManyToMany field sample

Requirements

Note that xhtml2pdf.pisa is used to render pdf from html, you may want to install it for this to work.

Known Issues

Calling out known issues can help limit users opening duplicate issues against your extension.

Release Notes

This is my first extension, hope you find it useful.

1.2.0

Initial release of Django Samples

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft