Skip to content

digitarald/python-sample-vscode-django-tutorial

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python/Django Tutorial Sample for VS Code

To run the sample:

  1. Clone the repo by running git clone -b tutorial https://github.com/microsoft/python-sample-vscode-django-tutorial.git
  2. In VS Code Terminal, run python -m venv env to create a virtual environment as described in the tutorial.
  3. Press Ctrl + Shift + P and run command Python: Select Interpreter. If possible, select the interpreter ending with "('env': venv)"
  4. Activate the virtual environment by running env/scripts/activate if you are on Windows or run source env/bin/activate if you are on Linux/MacOS.
  5. In terminal, run pip install django.
  6. Create and initialize the database by running python manage.py migrate.
  7. From Run and Debug section, select Python: Django launch configuration and hit F5.
  • For steps on running this app in a Docker container, see Python in containers on the VS Code Docs website.

Known issues

  • CSS is lost if you set DEBUG=False in settings.py; the workaround is to include an added script at the end of dockerfile.txt to serve static file differently. See Issue 13 for details.

Contributing

Contributions to the sample are welcome. When submitting changes, also consider submitting matching changes to the tutorial's source file tutorial-django.md.

Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and willingly choose to, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

Additional details

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Sample code for the Django tutorial in the VS Code documentation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 67.9%
  • HTML 18.8%
  • Dockerfile 8.3%
  • CSS 5.0%