$ git clone git@github.com:GarnBarn/garnbarn-backend.git
$ pip install -r requirements.txt
$ python manage.py migrate
You can follow these step in document
There are 2 ways to do this:
- In project root directory. Create file named
firebase-adminsdk-credential.json
that contain the credential from Firebase. - Set the
GOOGLE_APPLICATION_CREDENTIAL
env variable to equal to the path to the credential file.
The application will load the
firebase-adminsdk-credential.json
first. If this file is not found, It will continue to use the file from env variable namedGOOGLE_APPLICATION_CREDENTIAL
If no credential, The API will always return 500 Internal Server Error as its response.
This file contain credential from LINE Login and LINE Messaging API Platform. You can generate these credential from LINE Developer Console
- Create file name
line-config.json
with this structure
{
"login": {
"channel_secret": "00000",
"channel_id": "00000"
},
"messaging_api": {
"channel_access_token": "00000"
}
}
In the top level folder of the project.
$ python manage.py runserver
Since Django don't serve the static file while in production mode (DEBUG=False
). So you need to have the CDN to provide the CSS and JS file from Admin page
To collect the static file for admin page
- Call this command
$ python manage.py collectstatic
-
The Django will create folder named
static/
at the top level folder of the project. Copy that file to serve it in your CDN. -
Update the config named
STATUC_URL
to equal to the URL to your CDN.