Skip to content

Make the documented quickstart work on a fresh clone - #124

Open
konradvoelkel wants to merge 1 commit into
python:mainfrom
konradvoelkel:fix-quickstart
Open

konradvoelkel wants to merge 1 commit into
python:mainfrom
konradvoelkel:fix-quickstart

Conversation

@konradvoelkel

Copy link
Copy Markdown

Following the Installation section of README.md on a fresh clone fails in three independent places. This fixes all three and makes the documented path work end to end.

Closes #120.

1. No local_settings.py, and nothing says to create one

Both site settings modules end in from .local_settings import *, but local_settings.py is deliberately untracked and no file in the repo told you to create it. So every management command died with a bare ModuleNotFoundError: No module named 'speed_python.local_settings', which does not tell a newcomer what to do about it.

Each site now ships a local_settings.py.example to copy (SECRET_KEY, DEBUG, commented ALLOWED_HOSTS and DATABASES), and a missing local_settings.py raises ImproperlyConfigured naming the file to copy from and the README section to read.

2. 'gunicorn' in INSTALLED_APPS made speed_python unimportable

speed_python/settings.py listed 'gunicorn' in INSTALLED_APPS, but gunicorn is only in deploy-requirements.txt — so a checkout installed from requirements.txt, as the README says to, could not run manage.py at all. gunicorn has not needed to be an installed app since it dropped run_gunicorn in 19.0 (2014).

3. The README pointed at sample_project, which is not importable

sample_project/ has neither __init__.py nor urls.py, so DJANGO_SETTINGS_MODULE=sample_project.settings raises ModuleNotFoundError: No module named 'sample_project.urls'. The installation and customization sections now describe the two real site packages in this repository instead. sample_project/deploy is still named, for the Apache and lighttpd examples it provides.

speed_python/README.md loses the same dead steps (easy_install pip, copying sample_project, the PYTHONPATH symlink, syncdb, manage.py run_gunicorn) and the pip install codespeeed typo reported in #120.

Verification

Exported the working tree into an empty directory, created a virtualenv with requirements.txt alone, and walked the instructions as written: copy the example, generate a SECRET_KEY, migrate, createsuperuser, loaddata, runserver — then checked every page renders. Also python manage.py test (112 tests, 1 skipped) and flake8 clean; the two new tests assert the example file keeps existing and stays valid Python, since settings.py now depends on it.

Three things I deliberately left alone — maintainers' call

  • speed_python/deploy/supervisor.conf still invokes gunicorn_django, removed from gunicorn in 19.0. Should that file be updated to gunicorn speed_python.wsgi:application, or is it stale beyond repair?
  • speed_python/generate_secret.py writes a secret_key file that nothing in the repository reads. Dead since the settings were restructured?
  • sample_project/ is referenced by the docs only as a deploy-config example now. Would you like it removed, or kept as-is?

Happy to split this into smaller commits or drop any part of it.

🤖 Generated with Claude Code

Following the installation instructions in README.md failed in three
independent places.

* Both site settings modules end in `from .local_settings import *`, but
  local_settings.py is deliberately not tracked by Git and nothing told
  you to create it, so every management command died with a bare
  ModuleNotFoundError (pythongh-120). Each site now ships a
  local_settings.py.example to copy, and a missing local_settings.py
  raises ImproperlyConfigured naming the file to copy from.

* speed_python/settings.py listed 'gunicorn' in INSTALLED_APPS, but
  gunicorn is only in deploy-requirements.txt, so a checkout installed
  from requirements.txt could not start at all. gunicorn has not had to
  be an installed app since it dropped `run_gunicorn` in 19.0.

* README.md pointed newcomers at sample_project as the starting point,
  but that directory has neither __init__.py nor urls.py, so
  `DJANGO_SETTINGS_MODULE=sample_project.settings` raises
  ModuleNotFoundError for sample_project.urls. The installation and
  customization sections now describe the two real site packages;
  sample_project/deploy is still named for the Apache and lighttpd
  examples it provides.

speed_python/README.md loses the same dead steps (easy_install, copying
sample_project, syncdb, run_gunicorn) and the `pip install codespeeed`
typo reported in pythongh-120.

Verified by installing requirements.txt alone into a fresh virtualenv and
walking the instructions end to end: migrate, createsuperuser, loaddata
and every page rendering.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Missing local_settings.py

1 participant