Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{"detail":"Not Found"} at http://127.0.0.1:8000 immediately #5075

Closed
turian opened this issue May 17, 2024 · 1 comment
Closed

{"detail":"Not Found"} at http://127.0.0.1:8000 immediately #5075

turian opened this issue May 17, 2024 · 1 comment
Labels

Comments

@turian
Copy link

turian commented May 17, 2024

What happened?

I create a simple cookiecutter and didn't modify anything but when I launch the server, I don't get a home page. http://127.0.0.1:8000 returns:

{"detail":"Not Found"}

What should've happened instead?

home.html should have rendered.

Additional details

You can find the repo here: https://github.com/turian/cookiecutter_django_simple

I create a simple cookiecutter with the following config, following the docker instructions.

The JSON is below, I enable DRF + Docker + Heroku.

Then I run:

docker compose -f docker-compose.local.yml build
docker compose -f docker-compose.local.yml up

with no issue. Here are the logs:

cookiecutter_django_simple_local_postgres  |
cookiecutter_django_simple_local_postgres  | PostgreSQL Database directory appears to contain a database; Skipping initialization
cookiecutter_django_simple_local_postgres  |
cookiecutter_django_simple_local_postgres  | 2024-05-17 07:17:16.681 UTC [1] LOG:  starting PostgreSQL 16.3 (Debian 16.3-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
cookiecutter_django_simple_local_postgres  | 2024-05-17 07:17:16.681 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
cookiecutter_django_simple_local_postgres  | 2024-05-17 07:17:16.681 UTC [1] LOG:  listening on IPv6 address "::", port 5432
cookiecutter_django_simple_local_postgres  | 2024-05-17 07:17:16.705 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
cookiecutter_django_simple_local_postgres  | 2024-05-17 07:17:16.713 UTC [29] LOG:  database system was shut down at 2024-05-17 07:17:15 UTC
cookiecutter_django_simple_local_postgres  | 2024-05-17 07:17:16.720 UTC [1] LOG:  database system is ready to accept connections
cookiecutter_django_simple_local_django    | PostgreSQL is available
cookiecutter_django_simple_local_django    | Operations to perform:
cookiecutter_django_simple_local_django    |   Apply all migrations: account, admin, auth, authtoken, contenttypes, mfa, sessions, sites, socialaccount, users
cookiecutter_django_simple_local_django    | Running migrations:
cookiecutter_django_simple_local_django    |   No migrations to apply.
cookiecutter_django_simple_local_django    | WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
cookiecutter_django_simple_local_django    |  * Running on all addresses (0.0.0.0)
cookiecutter_django_simple_local_django    |  * Running on http://127.0.0.1:8000
cookiecutter_django_simple_local_django    |  * Running on http://172.19.0.3:8000
cookiecutter_django_simple_local_django    | Press CTRL+C to quit
cookiecutter_django_simple_local_django    |  * Restarting with watchdog (inotify)
cookiecutter_django_simple_local_django    | Performing system checks...
cookiecutter_django_simple_local_django    |
cookiecutter_django_simple_local_django    | System check identified no issues (0 silenced).
cookiecutter_django_simple_local_django    |
cookiecutter_django_simple_local_django    | Django version 4.2.13, using settings 'config.settings.local'
cookiecutter_django_simple_local_django    | Development server is running at http://0.0.0.0:8000/
cookiecutter_django_simple_local_django    | Using the Werkzeug debugger (https://werkzeug.palletsprojects.com/)
cookiecutter_django_simple_local_django    | Quit the server with CONTROL-C.
cookiecutter_django_simple_local_django    |  * Debugger is active!
cookiecutter_django_simple_local_django    |  * Debugger PIN: 810-138-774

Notice that there is not even any logging for the request to the webserver (!?)

  • Host system configuration:

    • Version of cookiecutter CLI (get it with cookiecutter --version): 1.7.2

    • OS name and version:
      ProductName: macOS
      ProductVersion: 14.4.1
      BuildVersion: 23E224

    • Python version, run python3 -V: Python 3.12.3

    • Docker version (if using Docker), run docker --version: Docker version 24.0.6, build ed223bc

    • docker compose version (if using Docker), run docker compose --version: Docker Compose version v2.23.0-desktop.1

    • ...

  • Options selected and/or replay file:
    On Linux and macOS: cat ${HOME}/.cookiecutter_replay/cookiecutter-django.json
    (Please, take care to remove sensitive information)

{
  "cookiecutter": {
    "project_name": "Cookiecutter Django Simple",
    "project_slug": "cookiecutter_django_simple",
    "description": "Simple cookiecutter Django",
    "author_name": "Joseph Turian",
    "domain_name": "example.com",
    "email": "lastname@gmail.com",
    "version": "0.1.0",
    "open_source_license": "MIT",
    "username_type": "username",
    "timezone": "UTC",
    "windows": "n",
    "editor": "VS Code",
    "use_docker": "y",
    "postgresql_version": "16",
    "cloud_provider": "AWS",
    "mail_service": "Mailgun",
    "use_async": "n",
    "use_drf": "y",
    "frontend_pipeline": "None",
    "use_celery": "n",
    "use_mailpit": "n",
    "use_sentry": "n",
    "use_whitenoise": "n",
    "use_heroku": "y",
    "ci_tool": "Github",
    "keep_local_envs_in_vcs": "y",
    "debug": "y",
    "_template": "gh:cookiecutter/cookiecutter-django"
  }
}%
Logs:
$ cookiecutter https://github.com/cookiecutter/cookiecutter-django
project_name [Project Name]: ...
@turian turian added the bug label May 17, 2024
@turian
Copy link
Author

turian commented May 17, 2024

Closing because I had another server running on this port. Nonetheless, I'm perplexed that there was no error or warning, which Django would typically have if there was a port collision.

@turian turian closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant