Ask Your Question

How to migrate from local (mac) to production (ubuntu 12.04)?

asked 2013-04-13 07:45:16 -0600

kris gravatar image

updated 2013-04-13 07:47:15 -0600

I'm new to django and this is my first time playing with a python web application. I have everything running locally on my mac. I cloned the git repo, and installed askbot into a virtualenv. So far, so good.

But what happens when I want to push this into production on an Ubuntu server?

I'm assuming I'll install all the needed packages (like postgresql, python, virtualenv, and so on), at which point I'll create a new directory to store askbot (var/www/askbot), and sftp all my askbot files to the server. I'll then copy my local postresql database over and do a restore.

But what do I do from there? Can I pip install a requirements file to get all the dependencies in my virtualenv? Do I need to run any commands on the server to get things running properly at this point?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-04-13 12:25:34 -0600

Evgeny gravatar image

To transfer data dump the postgres database and restore it:

pg_dump -U username dbname > data_dump.sql #to dump
psql -U username dbname < data_dump.sql #to restore

Next thing you will need to deploy your app on the server - for that please look up documentation about deploying Python webapps. Nginx + gunicorn/uwsgi or Apache + mod_wsgi work well.

edit flag offensive delete link more


Thanks for the reply. I did look at the documentation, but I didn't think it was clear on what needed to be done if I had already configured the software on another server ( Based on that documentation, I would simply run (python collectstatic) to setup the static file location, set permissions on log and askbot/upfiles, and then configure the webserver. It doesn't mention things like "pip install -r requirements.txt" which is something that would be required.Other then that, everything should just work though based on the documentation I linked to?

Also, is there any documentation on using this with nginx/uwsgi? I've found a few posts pointing to a wiki page that no longer exists, so I'm wondering if there's more up-to-date documentation available?

kris gravatar imagekris ( 2013-04-13 15:39:06 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-04-13 07:45:16 -0600

Seen: 156 times

Last updated: Apr 13 '13