Giter Site home page Giter Site logo

product-factory-backend's Introduction

Getting Started

It is recommended that Python 3.9 is used to run the backend server. Please run the following command first to install all dependencies.

pip install -r requirements.txt

Before running the server locally, first make a copy of .env.template and name it .env. Place it in the same directory as the manage.py file. Now open the .env file with any text editor. This file contains database configuration and license configuration. Please add your local database configuration in the following lines:

POSTGRES_USER=dev
POSTGRES_PASSWORD=mypass
POSTGRES_DB=ou_db
POSTGRES_HOST=postgres
POSTGRES_POST=5432

The server needs two license files to be present before you can run it. You can find the developer license files in the repository. They are developer.license and developer.license_key.pub. You need to point to these two files in the .env file. Corresponding env variable names are LICENSE_FILE and LICENSE_PUB_KEY. After you make the changes, the last two lines of your .env file should be like this:

LICENSE_FILE=developer.license
LICENSE_PUB_KEY=developer.license_key.pub

Now save and close the .env file. You are now ready to run the backend. First run migration to get the database schemas.

python manage.py migrate

You can now start the backend server using the command:

python manage.py runserver

There is a management command to load some dummy data to get you started. The command is:

python manage.py dummy_data

When developing locally, It is possible to allow a predefined user ID to be used for authentication. This should be used with the fake login settings of the front-end. Please put the same user id in the following field of the .env file:

FAKE_LOGIN_USER_ID=YOUR_USER_ID_SAME_AS_FRONTEND

product-factory-backend's People

Contributors

adrianmcphee avatar ashikzk avatar ibanda avatar mnunzio avatar zhangcheng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.