Skip to content

UX Enhancement: Use project_name variable for dynamic log paths instead of hardcoded 'mysite'#21

Open
SatyamGupta-py wants to merge 2 commits intotendenci:masterfrom
SatyamGupta-py:fix-hardcoded-log-path
Open

UX Enhancement: Use project_name variable for dynamic log paths instead of hardcoded 'mysite'#21
SatyamGupta-py wants to merge 2 commits intotendenci:masterfrom
SatyamGupta-py:fix-hardcoded-log-path

Conversation

@SatyamGupta-py
Copy link

Hello! This pull request is to improve the onboarding experience for new developers by making a small adjustment to the settings.py project template.

Context:

When a new developer follows the installation.txt guide, they are encouraged to customize their project name, database, and other settings. For example, a user setting up a project named 'my-project' will create a database, virtual environment, and log directory all using the 'my-project' name. This is a great, intuitive process.

The first time the user runs a command 'python manage.py initial_migrate', they may encounter a:

FileNotFoundError: [Errno 2] No such file or directory: '/var/log/mysite/debug.log'

This happened to me.

This happens because the log path in the settings.py template is currently hardcoded to use 'mysite', while the user has created a log directory matching their custom project name (e.g., /var/log/my-project/). This can cause a pause in the setup process while the user investigates their settings file to align the paths.

UX Enhancement:

This PR replaces the hardcoded 'mysite' in the log path with the {{ project_name }} template variable.

This change ensures that the generated settings.py file automatically uses the correct, custom project name for the log directory, aligning the template's behavior with the instructions in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant