You should install
"Vagrant" and "VirtualBox" applications.
for working with this project.
If these packages were installed,
please go to project's root folder and create .env file in the config folder.
cp env.example config/.env
After this call the next command in the console:
vagrant up
When installation will be done, please do next actions in the console:
vagrant ssh
We need to have two additional libs in system for running PDF file generator.
-
sudo apt-get install libcairo2-devNeeded for install Cairo & Pango. -
sudo apt-get install libdmtx0aNeeded for datamatrix
Possible problems during environment setup in Ubuntu:
(1) Problem: It appears your machine doesn't support NFS, or there is not an adapter to enable NFS on this machine for Vagrant. Please verify that nfsd is installed on your machine, and try again. If you're on Windows, NFS isn't supported. If the problem persists, please contact Vagrant support.
Solution apt install nfs-kernel-server nfs-common
Go to project root and install all needed requirements.
pip install -r requirements/local.txt
The next command can reset your changes in the database to initial state.
python manage.py init_project
This command will do the next actions:
- Initialize migrations;
- Initialize countries;
- Initialize categories;
- Initialize default product class;
- Initialize default partner;
- Initialize products;
- Initialize flatpages;
load locations ``./manage.py loaddata locations`
python manage.py runserver 0.0.0.0:8000
For running Celery, please run the next commands:
celery -A radonmeters.apps.taskapp worker -l infocelery -A radonmeters.apps.taskapp beat -l info
Congratulations, now you can be access to site, dashboard and admin panel:
- After server has been up you need to change the Site object (via admin panel).
- Open terminal in the project root dir. After that you should install all
yarnandbowerpackages. All tasks and other helpers are in foldergulp. - Type
yarn install. **On your computer already should be installednodejs. - Type
bower install. 3.1 Type onceecho fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p. It's needed for the normal working of watchers. - Type
yarn run develop. Source files haven't been compressed and concatenated. - You can change source files and your build automatically will be changed. Watchers will watch for them. Also, your page will have been reloaded automatically.
- Type
yarn run watchfor watching your files. - Type
yarn run servefor watching files and running and browser sync.
/gulpfile.js- main file for Gulp with general tasks./gulp/paths.js- all paths forsrcanddistfiles./gulp/helpers.js- common helper methods. Used in tasks./gulp/handlers.js- handler methods (on error, on change, on delete, on logging). Used in tasks./gulp/tasks/- tasks which separated by logic.
- /api/v1/profile/orders/ # GET,
- /api/v1/profile/dosimeters/<dosimeter_id>/ # GET, OPTIONS, PUT, PATCH
- /api/v1/order/orders/?status=created
- /api/v1/order/products/?id=created
- /api/v1/order/add_bar_code/ {id=<line_id>, device_barcode={key: value}}
- /api/v1/order/done/ {id=<order_id>}
Create order with IsPartner permission
- api/v1/data-import/orders/
cd ansibleansible-playbook universal.yml --extra-vars="target=develop"(for develop)ansible-playbook universal.yml --extra-vars="target=staging"(for staging)ansible-playbook universal.yml --extra-vars="target=beta"(for beta https://beta.radonmeters.com)ansible-playbook universal.yml --extra-vars="target=gmscientific"(for gmscientific https://gmscientific.radonmeters.com)ansible-playbook universal.yml --extra-vars="target=production"(for production https://radonmeters.com)ansible-playbook universal.yml --extra-vars="target=radosure-develop"(for radosure-develop https://radosure.dev.steel.kiwi)
- Add appropriate variables to env:
- DEFAULT_SERVICES_GOOGLE_KEY
- DEFAULT_SERVICES_RETUR_LINK
- DEFAULT_SERVICES_TRUSTPILOT_TEMPLATE_ID
- DEFAULT_SERVICES_TRUSTPILOT_BUSINESSUNIT
- DEFAULT_SERVICES_TRUSTPILOT_LINK
- ./manage.py init_service_keys
On server radosure you need to add env variable
DJANGO_MAIN_PERMISSION=radosure
for mark radosure permission
- Create locale folder
mkdir radonmeters/locale/ - Copy en default po file for prevent Plural-Forms exception
cp -r radonmeters/default_locale/en radonmeters/locale - Create other translations
./manage.py makemessages -l en -l da -l nn -l sv
./manage.py makemessages -l en -l da -l nn -l sv
./manage.py compilemessages -l en -l da -l nn -l sv
pg_dump --no-owner prod-radonmeters | gzip > /home/admin/backup/db/prod-radonmeters-$(date +%Y-%m-%d-%H%M%S).sql.gz
createdb prod-radonmeters
gunzip -c filename.sql.gz | psql prod-radonmeters