Local Development Environment

Warning

DO NOT use this method for ANY UAT/DEV/PROD environments that are NOT on your local. The settings.py file contains a secret_key that is published.

Warning

DO NOT edit the settings.py file - as changes can be pushed to a public github.

Attention

If you would like any help setting up these environments, why not join our discord - https://discord.gg/64uhRztS6n

NearBeach currently supports the following Django versions;

  • Django Version 3.2+

More information about upgrading Django can be found found in the Django Documentation

Attention

We are assuming you have pip3 installed on your local system. If not, please follow these instructions: https://github.com/pypa/get-pip

Attention

We are assuming you have installed Python 3.7+ on your local development system. If not, please follow these instructions: https://www.python.org/downloads/

Download Git Repository

  1. In a terminal, navigate to your project development folder

cd /<<project-dev-folder>>
  1. Use Git to download NearBeach source code

git clone https://github.com/robotichead/NearBeach
cd ./NearBeach
  1. Once pip is upgraded, you will need to create a virtual environment

sudo pip3 install virtualenv
  1. Create your own virtual environment for python

virtualenv <<project_environment>>

This will create a directory called β€œ<<project_environment>>”, this will store NearBeach’s libraries for python

  1. Activate the virtual environment using the following command

source ./<<project_environment>>/bin/activate

You terminal prompt will change to indicate that it is working in the virtual environment now. It should look like the following

(<<project_environment>>)user@computer:
  1. Install All requirements

pip install requirements-dev.txt
  1. Create the database

python3 manage.py migrate
  1. Create a superuser, by running the following command and filling out the fields appropriately

python3 manage.py createsuperuser
  1. Run the webserver

python3 manage.py runserver
  1. To access NearBeach, open up your browser and go to http://localhost:8000 or alternatively http://127.0.0.1:8000.

NPM/JavaScript

  1. To install all NPM packages, please run the following code

npm install
  1. Once npm has finished installing, you can compile the code using the following;

npm run prod
  1. Alternatively, you can run a watch

npm run watch