Running the Aplication :
-
Open a terminal console in the working "url_shortener" directory and paste there : "docker-compose build"
-
After the build finished paste : "docker-compose up"
-
Meanwhile, open another terminal in the working directory "url_shortener" and paste : "docker exec -it url_shortener /bin/bash"
-
In the opened terminal paste : "python manage.py migrate" -> (If an error occurred like "django.db.utils.ProgrammingError: relation {table_name} already exists" then leave this process as the database should have migrated with the files i sent in the docker volumes, in case i forgot to delete them)
-
Now you can access "127.0.0.1:8000" in the web. An admin user is already created in the migration files, so you just need to use the credentials
- username : admin
- password : admin -> Now you can use the API Documentation
- All the links can be accessed through PostMan, but i suggest accessing the "/url_shortener_api/<shortened_code>" through the web as it provides rendering
Running Tests :
- Open a terminal console in the working directory "url_shortener" and paste : "docker exec -it url_shortener /bin/bash"
- Execute there this command : "python manage.py test -v2 --keepdb url_shortener_api.tests"