Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access sqlite3 on pythonanywhere.com?

I've followed the DjangoGirls tutorial and i created a blog on my local setup. I used SQLite3 database, since this was suggested by Django tutorial, as being the default one. My local SQLite3 database has several posts. I pushed my code on pythonanywhere.com. Now, my local DB is not synchronized with the online DB, i mean my posts are not seen on the internet. I managed to create a blog_data.dmp DB dump on pythonanywhere.com, but can not access it on pythonanywhere. Can someone help me please with this? enter image description here Thank you very much!

like image 477
Ina Avatar asked Jul 20 '26 13:07

Ina


1 Answers

I can think of 2 reasons that your database is not available on PythonAnywhere:

  1. You didn't actually upload the database file.
  2. You're referring to the database file using a relative path. That means that your code is relying on the working directory which may be different on PythonAnywhere. Use an absolute path to refer to your database.
like image 116
Glenn Avatar answered Jul 24 '26 05:07

Glenn