An online website for repair shops of smartphones.
Build the application with docker-compose
(the first build can take some time):
$ make docker-build
Run development server:
$ make docker-dev
Run production server:
$ make docker-prod
After you started the container you need to initialize the database:
$ docker-compose exec <YOUR_SERVER_TYPE> make db
where you need to replace <YOUR_SERVER_TYPE>
with either pricepicker-prod
or pricepicker-dev
.
Run tests:
$ docker-compose exec pricepicker-dev make db
Create and activate a virtual environment, and then install the requirements.
$ virtualenv venv && source venv/bin/activate
$ make install
Update project/server/config.py.
By default the app is set to use the production configuration. If you would like to use the development configuration, you can alter the APP_SETTINGS
environment variable:
PRO TIP: Store all env vars inside a .local_env
file, so that you dont have to set them all the time.
DO NOT CREATE A .env
file for your local dev env, because this file may be used inside docker!
$ export APP_SETTINGS=project.server.config.DevelopmentConfig
You can set the TRICOMA_API_URL
if you want to use the API to create customers.
At first you need to create a new local postgres database:
create database "pricepicker-v2";
create user "some user" with encrypted password 'some password';
grant all privileges on database "pricepicker-v2" to "some user";
Then you just need to update the DATABASE_URL
:
$ export DATABASE_URL=postgresql://<YOUR_URL>:#@127.0.0.1/<YOUR_DB>
$ make db
$ make run
Access the application at the address http://localhost:5000/
If you want to start the celery worker, you need to have Redis running somewhere.
Change the REDIS_URL
accordingly inside your config.py
or .env
.
You can start a celery worker by calling:
$ python manage.py start-worker [loglevel]
Without coverage:
$ make test