This is in order to take part into Work at Olist.
For original README.md
see here.
- Available on http://localhost:8000/docs/
- Documentation neattree.readthedocs.io
- Python >= 3.5
- PIP
- Pipenv
- Django >= 1.10
- django-environ
- django-generate-secret-key
- django-mptt
- djangorestframework
- djangorestframework-recursive
- django-autoslug
- drfdocs
- psycopg2
- gunicorn
- whitenoise
-
Make sure you have Python >= 3.5 and PIP installed.
1.1. In order to install it on Ubuntu-like systems run:
$ sudo apt-get install python3 \ sudo apt-get install python3-pip
-
Install
Pipenv
.$ sudo pip3 install pipenv
-
Git clone this repo. Make sure you have git installed
$ git clone https://github.com/diogosimao/work-at-olist.git && cd work-at-olist
-
Use
Pipenv
to create a virtualenv, install its dependencies and activate the virtualenv.$ pipenv --three && pipenv install && pipenv shell
-
Make sure you have PostgreSQL installed running on port 5432
-
Set your local user and password to
./bin/start_development.sh
and create the database$ createdb neattree
-
Run
. ./bin/start_development.sh
Development server should be up at http://localhost:8000/.
Deploy the app to Heroku
-
Make sure you have Heroku CLI installed and that you are logged in
-
Set
DEBUG=False
for safety measure$ heroku config:set DEBUG=False
-
Set
SECRET_KEY
environment variable3.1 You can either use the following command to generate it:
$ python manage.py generate_secret_key --replace
3.2 Get the key in the generated secretkey.txt file in the current dir or you can get a valid key elsewhere.
3.3 After that set it on Heroku:
$ heroku config:set SECRET_KEY='<YOUR_SECRET_KEY>'
-
Be aware that Release Phase will be executed as you deploy it.
4.1. It will run Django makemigrations
4.2. It will run Django migrate
-
Deploy it, see here
-
Get you herokuapp.com url and access it on your browser.
$ heroku info -s | grep web_url | cut -d= -f2
The command importcategories
is available through DMC. The syntax is:
$ python manage.py importcategories <channel_name> <categories_file>
Make sure to have env var DATABASE_URL
set.
Some tests are available running:
$ ./bin/run_tests.sh
Make sure to have env var DATABASE_URL
set on ./bin/run_tests.sh
.