[Answer]-Git push django app to linux virtual server

1đź‘Ť

âś…

You have two pretty big misconceptions here. The first is that, as Ngenator says in the comments, git doesn’t work the way you think it does. Pushing to a git remote just pushes the raw git data: it doesn’t make the actual files available on the server. You’d need to create a second clone elsewhere on that machine, add the existing remote to it, and pull every time you push an update from your development machine. You can use a git hook to automate that pull, if you like.

The second misconception is that deploying a Django site doesn’t work the way you think it does either. You can’t just “redirect /var/www/whatever” to a folder and expect Django to serve the site. You need to actually set up the proper server, be it Apache or whatever, and then configure it (probably via WSGI) to serve your site. The Django documentation explains this in detail.

Leave a comment