β Fullstack with Vue.jsQuestion 62 of 62
How do you create and activate a virtual environment for Django?
π Explanation
The correct commands, python -m venv .venv followed by source .venv/bin/activate, are the standard way to create and activate a virtual environment on macOS/Linux using Python's built-in venv module. The other options use incorrect tools or syntax, such as virtualenv with a Windows-style activation script mismatched to the platform, installing a nonexistent 'venv' package via pip, or a fabricated django-admin command that doesn't exist.
Related questions
- How does Django populate request.user?
- What does QuerySet.defer() do in Django ORM?
- How do you profile Python code to find performance bottlenecks?
- Given a Book model with a ForeignKey to Author, how do you query the most expensive book per author in Django ORM?
- With Celery, if you want to check the status of a previously submitted task, how do you retrieve information about thatβ¦
β PreviousNo login needed