I have tried hard searching for the solution to my query but with no luck. I have made a website using django in my local machine. Now i want to install the same django made website in another machine. MySQL is the database i am using. How do i move the local django made website into another machine? If this question has been already put under discussion, my apologies.
You can easily just copy and paste the Root project folder and name it whatever you wish (here, in case which is Client2). The main changes you have to do is in inner project folder, just go through each file like settings.py,wsgi.py and all of them in it and replace Client1 to Client2.
To set up the same Django site on a different machine, you can just copy the code across. When you try and run it, you'll get errors if anything isn't set up correctly which you can resolve one by one. A few errors you are likely to get are:
localhost
or 127.0.0.1
, you will need to think about where to put the new databasemanage.py runserver
)All these steps should simply be repeating things you did on the old machine.
If you have a 'dev' machine and a 'production' machine, you should consider deployment solutions that automate much of this process. You should also put the code into version control if it isn't already (Git, mercurial, subversion) so that you can manage changes to the source from either location.
If you want to have the same site across both machines (so changes to one appear on the other) you are probably talking about 'load balancing'. You'll need to set up another server that can delegate requests to these two machines and point both at the same database.
This is called "deployment". There are lots of ways to do this some of which are documented at http://docs.djangoproject.com/en/dev/howto/deployment/. There's also http://djangobook.com/en/2.0/chapter12/ which gives some more general information. Your path will depend on what your actual server supports/provides.
You should use those as starting points and then report back problems here so that we can fix them.
Update: The actual steps you need to deploy your application (i.e. get it running on the live server) depends on your service provider. The steps broadly are to set up your webserver to serve the application, set up your database with the right values and start the webserver. The actual steps on how to do this depend on your server (what front facing webserver they use, how you can edit it's config, is it shared or a VPS, do you have shell access etc.). Here is an example of how you would do it on webfaction (a popular python shared hosting provider).
http://docs.webfaction.com/software/django/getting-started.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With