diff --git a/tech_docs/python/django.md b/tech_docs/python/django.md index 4da8628..bced8c7 100644 --- a/tech_docs/python/django.md +++ b/tech_docs/python/django.md @@ -226,4 +226,57 @@ my_project/ - Use feature flags for gradual rollouts - Document APIs and complex functionality - Conduct regular security audits -- Optimize for both mobile and desktop experiences \ No newline at end of file +- Optimize for both mobile and desktop experiences + +--- + +# Streamlined Django Setup with Conda and pip + +## 1. Create environment.yml file +Create a file named `environment.yml` with the following content: + +```yaml +name: django_env +channels: + - defaults +dependencies: + - python=3.9 + - pip + - pip: + - -r requirements.txt +``` + +## 2. Create requirements.txt file +Create a file named `requirements.txt` with your Python package dependencies: + +``` +django==4.2.5 +djangorestframework==3.14.0 +``` + +## 3. Create and activate the Conda environment +Run the following command in the directory containing your environment.yml file: + +```bash +conda env create -f environment.yml +conda activate django_env +``` + +## 4. Create Django project and app +```bash +django-admin startproject myproject +cd myproject +python manage.py startapp myapp +``` + +## 5. Update dependencies (when needed) +If you need to add new packages, update `requirements.txt` and run: + +```bash +pip install -r requirements.txt +``` + +## 6. Recreate environment (for team members or new setups) +```bash +conda env create -f environment.yml --force +``` \ No newline at end of file