How to setup Django
- Go to https://www.python.org/downloads/ to install Python on your command line.
- Make sure that the path to the Python executable is added as a path in Environment Variables
- Verify that the command “python –version” works. If not, verify if the steps above were done correctly.
- Clone the github repository above with: “git clone https://github.com/JonKissil/Jonra.git”
- Go into the folder, and with Pip, run “python -m pip install Django”
- Verify the installation worked by running “python -m django --version”
- Go to the “jonra-app” folder and with npm, run “npm install”
- If you do not have npm, ensure you have Node installed (if not: follow https://nodejs.org/en/download/) by running “node -v” to check
- Check to see if npm is there by running “npm -v”
- Now, you should be all setup!
Running the App
- Go to “Backend/” and run “python manage.py runserver”
- Go to “jonra-app/” and run “npm start” in a separate terminal
- The app should appear as a new page in a browser.
Running the server Run 'python manage.py runserver'
Running tests
- In Backend folder, run: 'python manage.py test app/folder'
- Results should display in console (0 errors returns: OK)
Testing the Database using Shell
- In Backend folder, run: 'python manage.py shell' where a python shell should open
- To import objects, type: 'from models.models import *'
- To see all objects of a class (i.e. User), type 'User.objects.all()'
- Type 'quit()' to exit