Issues with poetry when deploying Django application

Hi, I am following the “Getting Started With Django on Render” tutorial and all was going well until I got to “Configure Django for PostgreSQL”. I have everything copied correctly but I am getting errors now when I run python manage.py runserver this is the error:

 File "/Users/user/Desktop/First_Program/Portfolio_Projects/Charter_Django_App/Charter_Django_App/config/settings.py", line 14, in <module>
    import dj_database_url
ModuleNotFoundError: No module named 'dj_database_url'

even though when I run poetry show it clearly says it is installed

asgiref          3.5.2  ASGI specs, helper code, and adapters                                                                                                                                                                            
brotli           1.0.9  Python bindings for the Brotli compression library                                                                                                                                                               
dj-database-url  1.0.0  Use Database URLs in your Django Application.                                                                                                                                                                    
dj-email-url     1.0.6  Use an URL to configure email backend settings in your Django Application.                                                                                                                                       
django           3.2.16 A high-level Python Web framework that encourages rapid development and clean, pragmatic design.                                                                                                                 
django-cache-url 3.4.2  Use Cache URLs in your Django application.                                                                                                                                                                       
environs         9.5.0  simplified environment variable parsing                                                                                                                                                                          
gunicorn         20.1.0 WSGI HTTP Server for UNIX                                                                                                                                                                                        
marshmallow      3.19.0 A lightweight library for converting complex datatypes to and from native Python datatypes.                                                                                                                      
packaging        22.0   Core utilities for Python packages                                                                                                                                                                               
psycopg2-binary  2.9.5  psycopg2 - Python-PostgreSQL Database Adapter                                                                                                                                                                    
python-dotenv    0.21.0 Read key-value pairs from a .env file and set them as environment variables                                                                                                                                      
pytz             2022.6 World timezone definitions, modern and historical                                                                                                                                                                
setuptools       65.6.3 Easily download, build, install, upgrade, and uninstall Python packages                                                                                                                                          
sqlparse         0.4.3  A non-validating SQL parser.                                                                                                                                                                                     
whitenoise       6.2.0  Radically simplified static file serving for WSGI applications

And also shows in poetry.lock file.
If anybody knows why this is happening and can please give me some insight. I followed the tutorial to the T but am new to using poetry.

I am also a bit confused as to where I store the environment variables such as SECRET_KEY as the tutorial is not very descriptive at that point. I am used to using pip install environs[django] then running env = Env()
env.read_env()
And reading from the .env file

Thank you x1000 in advance to anybody that may help me get my application running

Here is the public repo GitHub - blueberrypyy/CharterDjangoSite

Hey,

I could not find the service being affected by searching under your current email address.

Please contact us via the “Contact Support” form in the dashboard.

Jérémy, Render Support

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.