Database issues after updating

69 views
Skip to first unread message

dan....@gmail.com

unread,
Jun 22, 2021, 3:42:10 PM6/22/21
to oTree help & discussion
Hello, 

It's been a while since I've been in oTree, so I've been trying to "catch up." I updated and then realized I'll need to stay in 3.X for now. However, I can't get otree devserver to run anymore in my setup. I get the following error: 

ValueError: You cannot use devserver or zipserver if the DATABASE_URL env var is defined. These commands are hardcoded to use db.sqlite3 as the database. 

(Screenshot attached). 

I do not have an environment variable defined though, so I'm not sure what to do to fix this. I initially had the DATABASES setting defined in settings.py per the 'old' method, but got an error when trying to run devserver that said I needed to delete that. 

I searched this forum and found one person that had a similar issue, but there was no resolution to their post. Has anybody else seen this happen? Thanks in advance! 

Dan
Untitled.jpg

Chris @ oTree

unread,
Jun 22, 2021, 6:03:23 PM6/22/21
to oTree help & discussion
you can check yourself whether this env var is defined with:

import os
print('database url is', os.environ.get('DATABASE_URL'))

try searching your project code, especially settings.py, for DATABASE_URL.

dan....@gmail.com

unread,
Jun 22, 2021, 8:41:31 PM6/22/21
to oTree help & discussion
Thanks for responding. 

I had deleted the environment variable but guess I hadn't restarted the cmd prompt. I'm up and running now. 

Looking forward to switching over to 5.X on my next project - looks like some nice changes there! 

Reply all
Reply to author
Forward
0 new messages