Simple 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.1+

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.6+ 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 -r requirements.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

Note

To compile the JavaScript code, simply run npm run prod or npm run watch