Page MenuHomePhabricator

Set Up
Updated 738 Days AgoPublic

First clone the project from git.

Then follow the instructions below for whatever fits to you.

*nix

  • In the api folder create a virtual environment (virtualenv3 env)
  • Enter the virtual env (source env/bin/activate)
  • Install requirements (pip install -r requirements.txt)
  • ./manage.py migrate
  • (OPTIONAL) ./manage.py sampledata (Adds some sampledata. Login for superuser is admin:password$123)
  • ./manage.py runserver
  • Running on http://localhost:8000

Windows

We recommend to use Visual Studio with python tools, because it makes programming much easier.

With Visual Studio and Python Tools

  • Open /api.sln
  • In the Solution Explorer right click on Python environment > Add Virtual Environment
  • Ensure the intepreter is set to Python 3.6 and that you install the requirements.txt
  • Back in the Solution Explorer right click on the Project api and select ...
    • ... Python > Django Migrate
    • ... Python > Django Create Superuser
  • Start the project
    • ... Python > Start server
  • The page is available under http://localhost:8000

Without Visual Studio - Windows 10 - The only way to add sample data to database

  • Install python 3.6 (3.7 will fail)
  • Install the latest postgreSQL by EnterpriseDB
  • Set the path. System Properties > Advanced
  • PATH: C:\Program Files (x86)\PostgreSQL\9.4\bin\; or wherever you installed it
  • Go to the /api/ folder
  • pip install virtualenv
  • virtualenv env
  • env/Scripts/activate
  • pip install -r requirements.txt
  • python manage.py migrate
  • python manage.py sampledata
  • python manage.py createsuperuser (Can only be ran in CMD prompt)
  • python manage.py runserver (Can only be ran in CMD prompt)

Without Visual Studio

  • Ensure to use Python 3.6
  • Install the requirements.txt (for example into virtual environment /api/env/)
  • Go to the /api/ folder
    • Run python3 manage.py migrate, to apply database migrations
    • Run python3 manage.py createsuperuser, to create an initial super user
    • Run python3 manage.py runserver, to start the development server.
  • The page is available under http://localhost:8000
Last Author
Info-Screen
Last Edited
Jan 9 2019, 5:57 PM

Event Timeline

Info-Screen edited the content of this document. (Show Details)
Info-Screen added a project: Server API.
Info-Screen added a subscriber: Info-Screen.
Info-Screen changed the visibility from "Server API (Project)" to "Public (No Login Required)".May 14 2018, 8:54 PM
Info-Screen changed the edit policy from "All Users" to "Server API (Project)".
WyldBot edited the content of this document. (Show Details)
WyldBot edited the content of this document. (Show Details)
Info-Screen published a new version of this document.