Forums

Running my Django site on pythonanywhere on my local machine

I've set up the most basic Django server on Pythonanywhere, then I downloaded all of those files on my local machine. (the linking between the python-anywhere cloud server and my local machine is done via Git using pull & push commands)

If I were to run on my computer, how should I approach this? Do I download django from pip and turn on virtual environment and run it there? I am just a bit confused.

Since I don't know a whole lot about what's going and what webserver I am using on pythonanywhere, I don't exactly how to run it on my local machine. I also saw in pythonanywhere's docs not to run the runserver command. Is it even okay running it on my local machine? It won't change anything in the file themselves, right?

To run a development version of your Django app locally, user runserver management command, see the docs.

The method is simple. Just download the whole directory on PythonAnywhere as a zip file. Then download the database file MySQL or PostgreSQL (which one you are currently using). Then add that database to the local server Wamp (for MySQL) or PostgreSQL server. Connect the project to the local database connection setup and run the project using runserver command.

Use this online guide: Download Django site from PythonAnywhere

Not convinced that downloading the production database is necessary for running the development app locally, but thanks for sharing the tutorial!