# Create a Virtual Environment It’s common practice to use a virtual environment for your Python projects in order to create self-contained development environments. The goal of pyenv is to prevent different versions of Python and libraries/packages from messing with each other. It’s like an isolated, soundproof room within your home where you can scream as loud as you want, about anything you want, and nobody else outside that room can hear it. Use pyenv-virtualenv to create a virtual environment for your project: ``` pyenv virtualenv [project-name] pyenv activate [project-name] ``` ## Create environment variables file - `.env` This file will serve as environment variables that will serve our project. Django and Docker mostly will use this file. Here is an example of `.env` file: ``` SECRET_KEY=[secret-key] DEBUG=true DJANGO_SETTINGS_MODULE=django_config.settings.local ALLOWED_HOSTS=localhost 127.0.0.1 0.0.0.0 DATABASE_URL=postgres://django:[password]@localhost:5432/[project-name] MAILGUN_API_KEY=[mailgun-api-key] MAILGUN_DEFAULT_FROM_EMAIL=[email] POSTGRES_PASSWORD=[password] POSTGRES_USER=django POSTGRES_DB=[project-name] EMAIL_PORT=1025 EMAIL_HOST=localhost EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend DEFAULT_FROM_EMAIL=[email] ```