A digital media marketplace
A few screenshots of what the application looks like
Responsiveness on the phone
1475728 Achraf Boudabous achraf.boudabous@informatik.hs-fulda.de
1377512 Anwer Al-Dhify anwer-ahmed.al-dhify@informatik.hs-fulda.de
1458989 Shifali Kalra shifali.shifali@informatik.hs-fulda.de
You need to have these things set up
mysql
installed (ideally with a user other than root who has access to an empty database)ssh
key set up with githubpoetry
installed, check the documentationOptionally, it would be nice if you have
make
build tool, makes our life easier. check documentation# On mac, you can install it with brew if you don't have it already
brew install make
Clone the repository to your local directory of choice
git clone git@github.com:Hochschule-Fulda-AI/media-majesty.git
Note: Since the project is still in the development phase, use the branch
olympus
to get the latest approved changes and then start a new branch from there.
Create and activate the virtual environment for local python development
cd media-majesty
python3 -m venv .venv # creating virtual environment
Install all python dependencies needed for the project using poetry
Poetry automatically installs and builds a lock file specific to your platform
poetry install # installs all the dependencies into the virtual environment
# or alternatively, if you have make
make install
poetry shell # activates the virtual environment
Create the necessary environment file to run the project
touch .env # creates an environment file
Add all of these variables to this .env
file. Make sure that
the names are the same as given below:
SECRET_KEY="<secret key>"
DEBUG="<True or False depending on if you are in development or production>"
DATABASE_ENGINE="django.db.backends.mysql"
DATABASE_NAME="<database name>"
DATABASE_USER="<database user>"
DATABASE_PASSWORD="<database password>"
DATABASE_HOST="<localhost or remote host domain if you are hosting one>"
DATABASE_PORT="<since we are using mysql, it is generally 3306>"
DEFAULT_FILE_STORAGE="storages.backends.azure_storage.AzureStorage"
AZURE_MEDIA_CONTAINER="<azure media container name>"
AZURE_THUMBNAIL_CONTAINER="<azure thumbnail container name>"
Note: Make sure you have access to the database with the user and the password is correctly given. I recommend using a user other than 'root' for security reasons and building good practices.
Migrate the database and Run the project
# if you are in the root directory first make sure to
# go to the directory that holds manage.py
cd mediamajesty
# run the SQL migrations
python manage.py makemigrations
python manage.py migrate
# or alternatively,
make migrations
make migrate
# run the development server
python manage.py runserver
# or alternatively,
make run
And Voila! Hopefully everything must have went well and you should see the development server running.
Note: These
manage.py
commands will only work if you are inside poetry's virtual environment which you should have activated from the previous step hopefully.Pro Tip: You can check out the Makefile and try other commands
# For eg, make start will install the dependencies, run migrations and run
# the development server automatically
make start
One final note, install pre-commit:
Before you make changes and do your commit for the first time after you clone this repository, make sure to install pre-commit into your git hooks so it can run automatically and make checks when you do a commit.
# this installs pre-commit to your git hooks
pre-commit install
Also, if you make any additional changes to the pre-commit configuration
file .pre-commit-config.yaml
, then you should run ths file again to make
sure the new version is installed.
Note Please always make sure the virtual environment is activated before you start working on the project. Use
poetry
to manage and install dependencies.Also, make sure that in case of breaking changes that require additional dependencies or database updates, you install the new dependencies and migrate the database if needed.