Skip to content

Repository files navigation

Backend README for MobileCinema Application

Backend URL:

$URL = https://iptk.lab64.eu

Database = https://iptk.lab64.eu/admin

Admin Login:

Username: admin
Password: W1oh*CnpMk!f

Install and run with Docker (Development)

In order to set up the local development environment, first install the docker desktop application.

  1. Clone the repository into your environment
    if cloning via SSH
$ git clone git@git.rwth-aachen.de:iptk/ws22-23/groupg/backend.git

if cloning via HTTP

$ git clone https://git.rwth-aachen.de/iptk/ws22-23/groupg/backend.git
  1. Start the django application as container using the provided docker compose config. Run the config as superuser.
$ docker-compose up
  1. to shut down the service use
$ docker-compose down
  1. open 127.0.0.1:8000 in webbrowser of choice to view the running django application

Change For Production / Development

for development: $YourNewDomain = http://127.0.0.1:8000/

in mobilecinema/settings.py

DEBUG = False (run true only in development)
CURRENT_HOST = '$YourNewDomain'
ALLOWED_HOSTS = [..., '$YourNewDomain']
CORS_ALLOWED_ORIGINS = [..., '$YourNewDomain']
CSRF_TRUSTED_ORIGINS = [..., '$YourNewDomain']
AWS Settings (Secret Key, Bucket Name, etc...)

in static/js/global-setup.js

var baseUrl = $YourNewDomain

For local development change wss:// to ws:// in chat/templates/chat/lobby.html

let url = `ws://${window.location.host}/ws/socket-server/`

Requests:

Admin Page:
-> $URL/admin

Register User
-> $URL/api/register

Login User
-> $URL/api/login

Logout
-> $URL/logout

List all Movies
-> $URL/movies/listall

List specific Movie
-> $URL/movies/get/$ID

List Timetable
-> $URL/movies/timetable

Get Specific Creator
-> $URL/creator/$ID

Get logged in Profile/Creator depending on status
-> $URL/profile

Rate Movie/Trailer
-> $URL/movies/rating

Get all Tags
-> $URL/movies/allTags

Create Movie
-> $URL/movies/create

Create Applyment
-> $URL/apply

Show Creator Applyment
-> $URL/showUnverifiedCreator

Validate Creator Applyment
-> $URL/validateCreator

Get personal Trailer Recommendation
-> $URL/recommendations/

Calculate User-Tags with a specific Movie
-> $URL/recommendations/calculatetags/$ID

Testing

Run Tests:

python manage.py test

Adjust/Add Testsuites:

  • accounts/test.py
  • movies/test.py
  • recommendation/test.py

Logger

Default Django Log of unsuccessful behavior can be found in:

logs/django/django.log

Add additional logger in class:

import logging

# Create a logger for this file
logger = logging.getLogger(__name__)

# Add log message
logger.critical("logger message")

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages