Made for Skalierbare Systeme SS19, TU Berlin
App to find people with common interests to eat together. Сhoose place, time and topic and enjoy your meal with perfect companion!
Until we set up a server for our DB we have to install everything locally. Therefore I also insert the password here visibly. Use Version 10 or above. Make sure you also download the new settings.py.
Download and install PostgreSQL and maybe pgAdmin for graphical interface.
Create DB via console:
createdb -h localhost -p 5432 -U postgres meet_and_eat
Password should be set to 'postgres' by default.
PgAdmin:
- Create new Server
- Host: localhost
- Port: 5432
- User: postgres
- Password: postgres
- Name: meet_and_eat
- Download PostgreSQL and open pgAdmin afterwards (comming with the installation)
- Open pgAdmin
- Create new DB/Server
- Port:5432
- Host: localhost
- User: postgres
- PAssword: postgres
- Name: meet_and_eat
Afterwards you can access the DB via IntelliJ or DBeaver.
Make you you use python manage.py migrate
after adding a new model.
Note: If you experience some troubles with db, execute the following commands in the given order:
python manage.py makemigrations
python manage.py makemigrations meetandeat
python manage.py migrate
It helps sometimes
Admin as superuser
profile: owner: can see all information and edit everything excempt from his username; mod:-
dashboard: user(owner): edit, see, join, leave events user: see, leave,join,report events mod: makes events in/-visible
Eventdetails: user: access denied user(joined): see, leave,join,report events mod: - user(owner): edit, see, join, leave events
Library: Installing 'Tag-Filter': In python console:
pip install django_select2
pip install django-cleanup
pip install python-decouple
pip install APScheduler
By default, mailing is disabled. When you register, you won't get an email, but you will see an activation link in the server console.
You can enable mailing in meeteat/development-env/.env
Note: you can still run the app with:
python manage.py runserver
python-decouple shouldn't affect the development process.
python-decouple package provides an ability to set settings dynamic for different application environments. Some values in settings.py is set with python-decouple, the settings for different environments stored in /meeteat/meeteat/env
Note: you can still run the app with:
python manage.py runserver
Docker shouldn't affect the development process.
Dockerfile and docker-compose.yml let you run the app in the docker container. You need to have docker and docker-compose
To build and run the containers run following commands in the folder with Dockerfile:
sudo docker-compose build
sudo docker-compose up -d
You should be able to access application on 127.0.0.1:8000 after it.
For debug purposes you can enter following commands:
#Nginx
docker-compose logs nginx
#Web
docker-compose logs web
#DB
docker-compose logs db
You will see then logs of the corresponding containers
Note: Email password is not in the docker config, because of security reasons. So if you want to test docker application set environment to development in the Dockerfile.
Background tasks shouldn't start right after app load, it can cause problems after changing model
for simple automation we can use a backgroundscheduler.
this will run tasks from 'tasks.py'.
tasks have to be added to 'updater.py'.
to run a task once app starts, run task in 'apps.py' ready() method.
Note: To make sure django only runs in one instance:
python manage.py runserver --noreload