Giter Club home page Giter Club logo

duka-connect's Introduction

duka-connect

Soft drinks survey

Local setup

This is a guideline to run the app locally

mkdir app
cd app
virtualenv -p /usr/bin/python2.7 .
git clone https://github.com/johngathure/duka-connect.git
. bin/activate
cd duka-connect
pip install -r requirements.txt

# run tests
./manage.py test --settings=dukaconnect.test_settings

# change the env file database configurations ie host, name, user and password then save.
./manage.py migrate
./manage.py loaddata drink.json
# create a super user for the dashboard
./manage.py createsuperuser
./manage.py runserver

To view the api docs run the following

Serving the docs runs on port 8000, If the django app is running on that port too, you might have to stop it then run the on a diffrent port.

cd docs
mkdocs serve

The admin dashboard can be viewed at http://localhost:8000/admin

Docker deployment

Requirements. The server must have the following installed.

  1. Docker
  2. Docker compose

If you haven't, visit https://www.docker.com/ for guidelines

  • log in into your server
  • clone the source to any location of your choice.
  • Configure the env file to contain the correct information, ie database host, user, name, and password. Host should be "database", the name of the postgres container defined in the docker-compose.yml file Also set debug to false.
  • Run docker-compose up

On a successfull run of the docker-compse up command, type docker ps You should have two containers, dukaconnect and database

Run the following commands to set up your db

docker exec -it database bash
psql

# then create a user and a database as usual with the credentials you entered in the env file earlier.

\q
exit

Run the following commands to set up your app

docker exec -it dukaconnect bash
# run the database migrations
./manage.py migrate
# load the soft drinks data
./manage.py loaddata drink.json
# create a super user
./manage.py createsuperuser

exit

In the nginx directory, there is an nginx configuration file. Start an nginx container and pass that configuration file to it.

duka-connect's People

Contributors

johngathure avatar

Watchers

 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.