I'm trying to set up PostgresSQL for the first time on Django, running into this error when I try to do a syndb?
ImportError: Could not import settings 'testapp.settings' (Is it on sys.path?):
Also have this at the toop of my settings.py file, no idea if this is correct?
import dj_database_url
DATABASES = {'default': dj_database_url.config(default=os.environ.get('DATABASE_URL'))}
You don't give a lot of information about exactly where you are trying to run your sync db? Locally? Or up on Heroku? My answer is going to assume that it's locally.
Basically, you need to have virtualenv install and pip. While working in your virtualenv (with it activated), you need to do a
pip install dj-database-url
Then you need to do a:
pip freeze > requirements.txt
Getting up and going on Python+Django+Heroku is not a really hard thing to do... but, there are quite a few steps. If you are fuzzy, I recommend the Heroku Django tutorial.
You have to install dj-database-url.
Add it to your requirements.txt file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With