micah
September 28, 2022, 2:35am
1
I am trying to complete the Django application deploy tutorial. Deploy Django on Render | Render
During the process, after (or maybe while) installing dependencies, I get an error. Here is the log:
Sep 28 11:11:35 AM Installing dependencies from lock file
Sep 28 11:11:36 AM
Sep 28 11:11:36 AM Package operations: 8 installs, 0 updates, 1 removal
Sep 28 11:11:36 AM
Sep 28 11:11:36 AM • Removing setuptools (65.4.0)
Sep 28 11:11:37 AM • Installing asgiref (3.5.2)
Sep 28 11:11:37 AM • Installing sqlparse (0.4.3)
Sep 28 11:11:38 AM • Installing brotli (1.0.9)
Sep 28 11:11:38 AM • Installing django (4.1.1)
Sep 28 11:11:41 AM • Installing dj-database-url (1.0.0)
Sep 28 11:11:41 AM • Installing gunicorn (20.1.0)
Sep 28 11:11:41 AM • Installing psycopg2-binary (2.9.3)
Sep 28 11:11:41 AM • Installing whitenoise (6.2.0)
Sep 28 11:11:43 AM python: can't open file '/opt/render/project/src/manage.py': [Errno 2] No such file or directory
Sep 28 11:11:43 AM ==> Build failed 😞
I have PYTHON_VERSION set to 3.10.7.
I used the manual deployment method specified near the end of the tutorial.
What am I doing wrong?
jnns
September 28, 2022, 8:29am
2
Did you commit the manage.py
file to your project as well? It looks like it is missing.
al_ps
September 28, 2022, 8:59am
3
Hi Micah,
Thanks for reaching out.
As jnns suggested, the error is looking for a manage.py
in the root of your project/repo:
python: can't open file '/opt/render/project/src/manage.py': [Errno 2] No such file or directory
You may need to double-check the file is there/named correctly.
Kind regards
Alan
micah
September 28, 2022, 9:59am
4
Thanks guys.
It’s definitely there.
Here is my directory structure:
render
├── README.md
├── build.sh
├── poetry.lock
├── pyproject.toml
├── render.yaml
└── www
├── db.sqlite3
├── manage.py
├── render
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-310.pyc
│ │ ├── admin.cpython-310.pyc
│ │ ├── apps.cpython-310.pyc
│ │ ├── models.cpython-310.pyc
│ │ ├── urls.cpython-310.pyc
│ │ └── views.cpython-310.pyc
│ ├── admin.py
│ ├── apps.py
│ ├── migrations
│ │ ├── __init__.py
│ │ └── __pycache__
│ │ └── __init__.cpython-310.pyc
│ ├── models.py
│ ├── static
│ │ └── render
│ │ └── render-banner.png
│ ├── templates
│ │ └── render
│ │ └── index.html
│ ├── tests.py
│ ├── urls.py
│ └── views.py
└── www
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-310.pyc
│ ├── settings.cpython-310.pyc
│ ├── urls.cpython-310.pyc
│ └── wsgi.cpython-310.pyc
├── asgi.py
├── settings.py
├── urls.py
└── wsgi.py
As you can see, my project root is called ‘render’, the Django project is www, and I made an app called ‘render’. Not sure if that is relevant.
al_ps
September 28, 2022, 10:06am
5
Thanks for sharing, you do seem to have quite a different structure compared to the Render Django example if you’re following the guide, so your manage.py
is under the www
directory.
I’m not a Python/Django expert but maybe you can update your build.sh
to point the commands to where the manage.py
file resides, e.g.:
python ./www/manage.py collectstatic --no-input
Alan
system
Closed
October 28, 2022, 9:56pm
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.