This env setup works with pretty much any OS and uses Vagrant.
Given below are the steps
Note: You will see some errors while running "vagrant up". no need to worry as long as you are able to do "vagrant ssh".
- Download Vagrant 1.5.4 here (https://www.vagrantup.com/downloads-archive.html)
- Download VirtualBox latest (https://www.virtualbox.org/wiki/Downloads)
- Make sure VirtualManage from program files/oracle/virtualbox dir is included in the path.
- Download the virtual box image of Django on Ubuntu from here. https://www.dropbox.com/s/aevgxvcwuozn1pj/django-base-v2.1.box?dl=0
- On Windows, Install putty or Gitshell or some shell with ssh provision.
- once you have installed all three run the below commands in cygwin or gitshell
- vagrant box add django-base-v2 location-to-django-base-v2.box
- get the latest from github bolg repo to get the Vagrant file
- run "vagrant up" from bolg directory once you have the latest
- run "vagrant provision" once thats done
- run "vagrant ssh" to get into the vm.
- Once in the vm, run "export DJANGO_SETTINGS_MODULE=settings" and "export DJANGO_ENVIRONMENT=local"
- run "python manage.py runserver 0.0.0.0:8000" to start the server.
- Once the above is done, type "http://localhost:8000/" in your browser and you should see the app.
- this is happening because of port forwarding between VM and your machine.
- Now, since Django apps are loaded during runtime. you can use the editor of your choice and edit the files in the project and the app running in VM will pick up the changes.
- this is because of shared folders between your host machine and VM.
- now when you refresh the browser you see the changes made by you on host machine.
- Once you have the above run below commands to seed the db
- python manage.py syncdb
- create admin user so that you can log into admin screen
- python manage.py migrate takeaway
- python manage.py migrate notifications
- go to this link localhost:8000/takeaway/initload to load data
- now login with ravi/abc123 or atluri/abc123 to enter the app
- have fun
No comments:
Post a Comment