Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Bug Report
about: Report a bug or issue with the template
title: '[BUG] '
labels: bug
assignees: ''
---

## Bug Description
<!-- Provide a clear and concise description of the bug -->

## Steps to Reproduce
1.
2.
3.

## Expected Behavior
<!-- What should happen -->

## Actual Behavior
<!-- What actually happens -->

## Environment
- OS: [e.g., Ubuntu 22.04, macOS 13, Windows 11]
- Python Version: [e.g., 3.12]
- Docker Version: [e.g., 24.0.0]
- Cookiecutter Version: [e.g., 2.5.0]
- JST-Django CLI Version: [e.g., 1.2.2]

## Cookiecutter Configuration
```json
{
"project_name": "",
"celery": "",
"silk": "",
"channels": "",
...
}
```

## Screenshots
<!-- If applicable, add screenshots -->

## Additional Context
<!-- Any other information about the problem -->

## Possible Solution
<!-- Optional: suggest a fix or reason for the bug -->
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Feature Request
about: Suggest a new feature or improvement
title: '[FEATURE] '
labels: enhancement
assignees: ''
---

## Feature Description
<!-- Provide a clear and concise description of the feature -->

## Problem Statement
<!-- What problem does this feature solve? -->

## Proposed Solution
<!-- How would you like this feature to work? -->

## Alternative Solutions
<!-- Have you considered any alternative solutions? -->

## Use Case
<!-- Describe how this feature would be used -->

## Example
<!-- Provide code examples if applicable -->

```python
# Example usage
```

## Additional Context
<!-- Any other context, screenshots, or references -->

## Benefits
<!-- Why would this feature be useful to other users? -->
51 changes: 51 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## Description
<!-- Provide a clear description of your changes -->

## Type of Change
<!-- Check all that apply -->
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Security fix

## Related Issue
<!-- Link to related issue: Fixes #123 -->

## Changes Made
<!-- List the specific changes made -->
-
-
-

## Testing
<!-- Describe how you tested your changes -->

### Test Configuration
- OS:
- Python Version:
- Docker Version:

### Tests Performed
- [ ] Template generation with default options
- [ ] Template generation with various package combinations
- [ ] Generated project builds successfully
- [ ] Generated project tests pass
- [ ] Documentation is up to date

## Screenshots
<!-- If applicable, add screenshots -->

## Checklist
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code where necessary
- [ ] I have updated the documentation (both Uzbek and English if applicable)
- [ ] My changes generate no new warnings
- [ ] I have tested the changes with different cookiecutter options
- [ ] All existing tests pass
- [ ] I have checked for security issues

## Additional Notes
<!-- Any additional information for reviewers -->
2 changes: 2 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# jst-django docs

**Til / Language:** O'zbek | [English]({{cookiecutter.project_slug}}/README.EN.md)

Assalomu Alaykum bu dasturni o’rganishdan avval bu dastur haqida biroz aytib bermoqchiman bu dastur nega kerak kimlar uchun shu haqida birlib olishingiz muhum.

bu dastur ikkita bo’lakga bo’lingan biri cli dastur ikkinchisi asosiy arxitiktura.
Expand Down
6 changes: 3 additions & 3 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"entrypoint.sh",
"entrypoint-server.sh"
],
"key": "key",
"key": "django-insecure-change-this-key-in-production",
"port": "8081",
"phone": "998888112309",
"password": "2309",
"phone": "998901234567",
"password": "changeme123",
"max_line_length": "120",
"silk": [
false,
Expand Down
16 changes: 14 additions & 2 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import shutil
import sys
from pathlib import Path


class Hook:
Expand All @@ -7,8 +9,18 @@ def __init__(self) -> None:
self.copy_files = {".env.example": ".env"}

def copy(self):
for key, value in self.copy_files.items():
shutil.copy(key, value)
"""Copy files with error handling"""
for source, destination in self.copy_files.items():
try:
source_path = Path(source)
if not source_path.exists():
print(f"Warning: Source file '{source}' does not exist. Skipping.")
continue
shutil.copy(source, destination)
print(f"Successfully copied {source} to {destination}")
except Exception as e:
print(f"Error copying {source} to {destination}: {e}", file=sys.stderr)
sys.exit(1)

def run(self):
self.copy()
Expand Down
4 changes: 3 additions & 1 deletion {{cookiecutter.project_slug}}/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Django configs
# WARNING: Change DJANGO_SECRET_KEY in production! Use a long, random string.
DJANGO_SECRET_KEY={{cookiecutter.key}}
DEBUG=True
DJANGO_SETTINGS_MODULE={{cookiecutter.settings_module}}
Expand All @@ -14,8 +15,9 @@ OTP_SIZE=4
OTP_PROD=false
OTP_DEFAULT=1111

# Databse configs
# Database configs
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
# WARNING: Change DB_PASSWORD in production! Use a strong, unique password.
DB_ENGINE=django.db.backends.postgresql_psycopg2
DB_NAME=django
DB_USER=postgres
Expand Down
8 changes: 4 additions & 4 deletions {{cookiecutter.project_slug}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build:

rebuild: down build up

deploy: down build up makemigrate
deploy: down build up migrations

deploy-prod:
docker compose -f docker-compose.prod.yml down
Expand All @@ -23,7 +23,7 @@ deploy-prod:
logs:
docker compose logs -f

makemigration:
makemigrations:
docker compose exec web python manage.py makemigrations --noinput

migrate:
Expand All @@ -35,9 +35,9 @@ seed:
reset_db:
docker compose exec web python manage.py reset_db --no-input

makemigrate: makemigration migrate
migrations: makemigrations migrate

fresh: reset_db makemigrate seed
fresh: reset_db migrations seed

test:
docker compose exec web pytest -v
Loading