Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the readme with a more verbose setup-guide for newcomers #79

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This repository contains the backend for the FooBar kiosk and inventory system.

- Python 3.4+
- Django 1.10+
- virtualenv (recommended)
- [pdftotext](https://linux.die.net/man/1/pdftotext) for delivery report parsing

## Setup
Expand All @@ -18,6 +19,40 @@ This repository contains the backend for the FooBar kiosk and inventory system.
$ virtualenv -p /usr/local/bin/python3.4 venv
$ venv/bin/pip install -r requirements.txt

## If you want to try running a local version and never worked on a django project before
To try it locally you should edit the requirements.txt and replace "production" into "local"

Follow the setup guide stated above, note that your path to python can differ.
you can find out your path in linux with the whereis command

$ whereis python3
>> /usr/bin/python3.6


To be able to open the site locally you have to allow localhost to the admin-page,
add this into src/foobar/settings/local.py:

$ ALLOWED_HOSTS += ['localhost', '127.0.0.1']



Enter your virtual environment where all dependency-programs have been installed

$ source venv/bin/activate

before you are able to enter, you have to migrate the database for the first time as well as add a superuser:

$ cd src/
$ python manage.py migrate
$ python manage.py createsuperuser

Lastly, start your server. You will be able to log in to http://127.0.0.1:8000/admin/ (note the "/admin/" part, foobar-api does not have a homepage) with your superuser account.

Remember to always activate your virtual environment before if you start the server at a later time.

$ python manage.py runserver


## How do I run tests?

We use [tox](https://tox.readthedocs.org/en/latest/) to automate testing against all supported Python and Django versions. To run test, simply execute following command in the root directory:
Expand Down