Ask Your Question
0

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

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

kris gravatar image

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

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
0

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

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

Comments

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 (http://askbot.org/doc/deployment.html). Based on that documentation, I would simply run (python manage.py 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 -0500 )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

Stats

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

Seen: 157 times

Last updated: Apr 13 '13