diff --git a/Setting-up-the-development-server.md b/Setting-up-the-development-server.md deleted file mode 100644 index f6640213b..000000000 --- a/Setting-up-the-development-server.md +++ /dev/null @@ -1,53 +0,0 @@ -## Setting Up Development Server (Vagrant) - -1. Get [Vagrant](https://www.vagrantup.com/) - -2. Get [Virtualbox](https://www.virtualbox.org/) - -3. Navigate to the directory with source code and type `vagrant up`. (It takes time during the first run, so go get a coffee!). - -4. Now, type `vagrant ssh`. - -5. Run `python BLT/manage.py migrate`. - -6. Run `python BLT/manage.py createsuperuser`. - -7. Run `python BLT/manage.py collectstatic`. - -8. Start the server using `python BLT/manage.py runserver` - -9. Then go to http://127.0.0.1:8000/admin/socialaccount/socialapp/) and add filler information for social auth accounts. Add a Domain (http://127.0.0.1:8000/admin/website/domain/) with the name 'owasp.org'. - -10. visit `http://localhost:8000`. - -**Note:** In case you encounter an error with vagrant's vbguest module, run `vagrant plugin install vagrant-vbguest` from the host machine. - -## Setting Up Development Server (Virtual Environment) - -1. If PostgreSQL is not installed, run: - - - `brew install postgresql` (Mac). - - - `sudo apt-get install postgresql` (Ubuntu). - -2. Type `cd BLT`. - -3. If virtualenv is not installed, run `sudo apt-get install pipenv` followed by: - - - `pipenv install | pipenv shell` (Ubuntu / Mac). - -4. Run `python3 manage.py migrate`. - -5. Run `python3 manage.py loaddata website\fixtures\initial_data.json` - -6. Run `python3 manage.py createsuperuser`. - -7. Run `python3 manage.py collectstatic`. - -8. Start the server using `python BLT/manage.py runserver` - -9. Then go to http://127.0.0.1:8000/admin/socialaccount/socialapp/) and add filler information for social auth accounts. Add a Domain (http://127.0.0.1:8000/admin/website/domain/) with the name 'owasp.org'. - -10. visit `http://localhost:8000`. - -**Note:** In case you encounter an error, run `sudo apt-get install libpq-dev`. diff --git a/Setup.md b/Setup.md new file mode 100644 index 000000000..d28958b4c --- /dev/null +++ b/Setup.md @@ -0,0 +1,89 @@ +# Setting up Development server + +## Setting Up Development Server using Vagrant + +### Install [Vagrant](https://www.vagrantup.com/) + +### Get [Virtualbox](https://www.virtualbox.org/) + +### Follow the given commands + +```sh + # Move to project directory + cd BLT + + # Start vagrant - It takes time during the first run, so go get a coffee! + vagrant up + + # SSH into vagrant + vagrant ssh + + # Create tables in the database + python BLT/manage.py migrate + + # Create a super user + python BLT/manage.py createsuperuser + + # Collect static files + python BLT/manage.py collectstatic + + # Run the server + python BLT/manage.py runserver +``` + +### Ready to go + +Then go to `http://127.0.0.1:8000/admin/socialaccount/socialapp/` and add filler information for social auth accounts. +Add a Domain `http://127.0.0.1:8000/admin/website/domain/` with the name 'owasp.org'. + +### Voila go visit `http://localhost:8000` + +**Note:** In case you encounter an error with vagrant's vbguest module, run `vagrant plugin install vagrant-vbguest` +from the host machine. + +## Setting Up Development Server using Python Virtual Environment + +```sh + + # Install postgres on mac using brew + brew install postgresql + + # Install postgres on ubuntu + sudo apt-get install postgresql + + # Install pipenv on ubuntu + sudo apt-get install pipenv + + # Install pipenv on mac + pip install pipenv + + # Start virtual env + pipenv install | pipenv shell + + # Move to project directory + cd BLT + + # Create tables in the database + python BLT/manage.py migrate + + # Load initial data + python3 manage.py loaddata website/fixtures/initial_data.json + + # Create a super user + python BLT/manage.py createsuperuser + + # Collect static files + python BLT/manage.py collectstatic + + # Run the server + python BLT/manage.py runserver +``` + +### Ready to go now + +Then go to `http://127.0.0.1:8000/admin/socialaccount/socialapp/` and add filler information for social auth accounts. +Add a Domain `http://127.0.0.1:8000/admin/website/domain/` with the name 'owasp.org'. + +### Visit `http://localhost:8000` + +**Note:** In case you encounter an error, run `sudo apt-get install libpq-dev`.