-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update readme, improvements of code.
- Loading branch information
Showing
13 changed files
with
111 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,45 @@ | ||
# movie-warehouse | ||
# Welcome to movie-warehouse | ||
|
||
Simple test application to storing and looking for data about movies. You can also add some comments to your downloaded movies and get top movies(ranking is determined by count of comments). | ||
|
||
## Requirements | ||
|
||
* Docker | ||
* Docker Compose | ||
|
||
## Setup | ||
* Clone the repository | ||
* Go to project directory | ||
* mv example.env to .env and replace `xxx` values for your own(OMDB_API_KEY you can get from http://www.omdbapi.com/) | ||
* make up | ||
|
||
## Quickstart guide | ||
|
||
Start the project: | ||
|
||
make up | ||
|
||
Bring project down: | ||
|
||
make down | ||
|
||
To test the project run: | ||
|
||
make test | ||
|
||
To build project: | ||
|
||
make build | ||
|
||
## Documentation | ||
|
||
You can easily review all endpoints using these links: | ||
|
||
* /swagger/ - http://localhost:8000/swagger/ | ||
* /redoc/ - http://localhost:8000/redoc/ | ||
|
||
### Additional packages | ||
|
||
* django-choices - Choices are much cleaner, than standard - some additional functions | ||
* factory-boy - Transparent fixtures, speeding up writing tests | ||
* drf-yasg - Complex documentation without any effor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from django_filters import rest_framework as filters | ||
|
||
from moviewarehouse.movies.models import Movie | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
from django.contrib import admin | ||
from django.urls import path | ||
from moviewarehouse.movies.viewsets import CommentViewSet, MovieViewSet, TopMovieViewSet | ||
from django.urls import path, re_path | ||
from drf_yasg import openapi | ||
from drf_yasg.views import get_schema_view | ||
from rest_framework import permissions | ||
from rest_framework.routers import DefaultRouter | ||
|
||
from moviewarehouse.movies.viewsets import CommentViewSet, MovieViewSet, TopMovieViewSet | ||
|
||
schema_view = get_schema_view( | ||
openapi.Info( | ||
title="Snippets API", | ||
default_version="v1", | ||
contact=openapi.Contact(email="pmlynarek1@gmail.com"), | ||
license=openapi.License(name="MIT License"), | ||
), | ||
public=True, | ||
permission_classes=(permissions.AllowAny,), | ||
) | ||
router = DefaultRouter() | ||
router.register(r"top", TopMovieViewSet, basename="top_movie") | ||
router.register(r"movies", MovieViewSet, basename="movie") | ||
router.register(r"comments", CommentViewSet, basename="comment") | ||
|
||
|
||
urlpatterns = [path("admin/", admin.site.urls)] | ||
urlpatterns = [ | ||
path("admin/", admin.site.urls), | ||
re_path( | ||
r"^swagger(?P<format>\.json|\.yaml)$", | ||
schema_view.without_ui(cache_timeout=0), | ||
name="schema-json", | ||
), | ||
path( | ||
"swagger/", | ||
schema_view.with_ui("swagger", cache_timeout=0), | ||
name="schema-swagger-ui", | ||
), | ||
path("redoc/", schema_view.with_ui("redoc", cache_timeout=0), name="schema-redoc"), | ||
] | ||
urlpatterns += router.urls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ django-extensions==2.2.9 | |
ipython==7.11.1 | ||
django-filter==2.2.0 | ||
factory-boy==2.12.0 | ||
drf-yasg==1.17.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ | |
# Third party | ||
"django_extensions", | ||
"django_filters", | ||
"drf_yasg", | ||
# Local | ||
"moviewarehouse.movies", | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
DJANGO_SETTINGS_MODULE=settings.dev | ||
DJANGO_SECRET_KEY=xxx | ||
|
||
POSTGRES_HOST=db | ||
POSTGRES_DB=moviewarehouse_dev_db | ||
POSTGRES_USER=moviewarehouse_dev_db_user | ||
POSTGRES_PASSWORD=xxx | ||
|
||
OMDB_API_KEY=xxx |