{"id":21254227,"url":"https://github.com/artur24814/kinomania2_rest_api","last_synced_at":"2025-03-15T06:17:33.868Z","repository":{"id":195749386,"uuid":"514619432","full_name":"artur24814/Kinomania2_REST_api","owner":"artur24814","description":"Rest api application for manage work in the cinema 🎦","archived":false,"fork":false,"pushed_at":"2022-07-21T08:21:38.000Z","size":67821,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-21T03:54:26.920Z","etag":null,"topics":["django-rest-framework","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artur24814.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-07-16T15:44:52.000Z","updated_at":"2023-03-27T07:59:48.000Z","dependencies_parsed_at":"2023-09-19T12:54:08.666Z","dependency_job_id":null,"html_url":"https://github.com/artur24814/Kinomania2_REST_api","commit_stats":null,"previous_names":["artur24814/kinomania2_rest_api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artur24814%2FKinomania2_REST_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artur24814%2FKinomania2_REST_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artur24814%2FKinomania2_REST_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artur24814%2FKinomania2_REST_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artur24814","download_url":"https://codeload.github.com/artur24814/Kinomania2_REST_api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235022265,"owners_count":18923731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django-rest-framework","rest-api"],"created_at":"2024-11-21T03:54:40.534Z","updated_at":"2025-01-21T21:20:37.198Z","avatar_url":"https://github.com/artur24814.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kinomania2_REST_api\n\u003chr\u003e\n\u003ccenter\u003e\u003cimg src=\"https://www.django-rest-framework.org/img/logo.png\"\u003e\u003c/center\u003e\n\u003chr\u003e\n\n\u003cul\u003e\n\u003ch2\u003eContents\u003c/h2\u003e\n\u003cli\u003e\u003ca href=\"#info\"\u003e\u003ch3\u003eInfo\u003c/h3\u003e\u003c/a\u003eInformation about the resources used in this project\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#kinomania2\"\u003e\u003ch3\u003eKNOMANIA REST API\u003c/h3\u003e\u003c/a\u003eWebsite for looking translation of words and create your self vocabulary and train your knowledge in a card game\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#clone_project\"\u003e\u003ch3\u003eClone and Run a Django Project\u003c/h3\u003e\u003c/a\u003ehow run projects in your computer\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003chr\u003e\n\u003ccenter\u003e\u003ch1\u003eINFO\u003c/h1\u003e\u003c/center\u003e\n\u003ch4\u003eInformation about the additional library, external Api used in this project and general information\u003c/h4\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003ewikipedia Api\u003c/strong\u003e \u003cp\u003eUsed when user add movie and \nwhen he didn't writen description, application found itself appropriate  description using wikipedia Api, if title will be wrong and application couldn't did this, in label 'description' will be put information from label 'tiltle'\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eGeoIP2\u003c/strong\u003e\u003cp\u003e\nUsed when user add cinema and didn't writen 'city', in this case application check your public ip (you can check your public ip yourself in website \u003ca href=\"https://www.whatismyip.com/\"\u003ehttps://www.whatismyip.com/\u003c/a\u003e) and with using api GeoIP2 found city where user is, and put name of city in label 'city'\n\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003edjango-crontab\u003c/strong\u003e\n\u003cp\u003eusing for delete screening when screening is out-of date.\nEvery 5 seconds crontab check screening datetime, and when actual date and time is more than date and time in screening it will be delete\u003c/p\u003e\n\u003cp\u003edon't forget write this command \n\u003ccode\u003epython manage.py crontab add\u003c/code\u003e\n\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eViews\u003c/strong\u003e\n\u003cp\u003eI write it with using API views, it's my own personal choice because I think in this case you can better see what is going on underneath \n(in further I will use generic views and mixing because it's less writing code  \u0026#128527;)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eTests\u003c/strong\u003e\n\u003cp\u003ei used pytest-django to testing my application\u003c/p\u003e\n\u003cp\u003e run test using command \u003ccode\u003epytests\u003c/code\u003e\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003chr\u003e\n\n\u003ccenter\u003e\u003ch1 id=\"kinomania2\"\u003eKINOMANIA REST API 🆕\u003c/h1\u003e\u003c/center\u003e\n\u003ch3\u003eit is additional rest api application to my previous website KINOMANIA \u003c/h3\u003e\n\u003cp\u003ein this api we have  6 endpoints\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\u003ccode\u003e/kinomania/movies/\u003c/code\u003efor creating and see list all movies\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003e/kinomania/movies/'some Id'/\u003c/code\u003efor get movie detail view, update and delete movie\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003e/kinomania/cinema/\u003c/code\u003efor get ang create cinema\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003e/kinomania/cinema/'some Id/\u003c/code\u003efor get cinema detail view and delete cinema\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003e/kinomania/screening/\u003c/code\u003eget and create screening\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003e/kinomania/screening/'some Id'/\u003c/code\u003efor get screening detail and delete screening\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003ewhen user hit in endpoint \u003ccode\u003e/kinomania/movies/\u003c/code\u003e he will get list of all movies, every movie has information of this particular url \u003c/p\u003e\n\u003cp\u003eIn this endpoint we have methods like\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eGET\u003c/li\u003e\n\u003cli\u003ePOST\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/97242088/180040631-c02be08a-07a5-4246-92d7-592405873557.png\" width=\"350\" alt=\"Home page\" title=\"Home page\"\u003e \u003c/p\u003e\n\u003cp\u003e when user hit on this url \u003ccode\u003e/kinomania/movies/'some Id'/\u003c/code\u003e he will see information about this film, title, description, director and actors (movie can have many actor, but one director) \u003c/p\u003e\n\u003cp\u003eIn this endpoint we have methods like\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eGET\u003c/li\u003e\n\u003cli\u003ePUT\u003c/li\u003e\n\u003cli\u003eDELETE\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/97242088/180040741-3d645bd0-cb30-46dc-bace-cd42c95bd858.png\" width=\"350\" alt=\"rest_api_mowie_detail\" title=\"rest_api_mowie_detail\"\u003e \u003c/p\u003e\n\n\u003cp\u003enext user can hit in endpoint \u003ccode\u003e/kinomania/cinema/\u003c/code\u003e and he will get list of all cinema with url to films which shown in this cinema\u003c/p\u003e\n\u003cp\u003eIn this endpoint we have methods like\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eGET\u003c/li\u003e\n\u003cli\u003ePOST\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/97242088/180040773-11df076f-251f-4a9f-a4c1-910787f229b6.png\" width=\"350\" alt=\"rest_api_cinema_list\" title=\"rest_api_cinema_list\"\u003e \u003c/p\u003e\n\u003cp\u003enext he go to endpoint \u003ccode\u003e/kinomania/cinema/'some Id/\u003c/code\u003e and wow, he can get all screenings in this cinema with date and time 😎. cinema can have many film in it and screenings in it\u003c/p\u003e\n\u003cp\u003eIn this endpoint we have methods like\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eGET\u003c/li\u003e\n\u003cli\u003eDELETE\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/97242088/180040769-f29ed2f5-67dd-4bf7-9c90-d4377b7313b4.png\" width=\"350\" alt=\"Rest_api_delete_cinema\" title=\"Rest_api_delete_cinema\"\u003e \u003c/p\u003e\n\n\u003cp\u003eIn endpoint \u003ccode\u003e/kinomania/screening/\u003c/code\u003e we have list of all screenings with date time movie and cinema, particular screening can has only one movie and only one cinema one\u003c/p\u003e\n\u003cp\u003eIn this endpoint we have methods like\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eGET\u003c/li\u003e\n\u003cli\u003ePOST\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/97242088/180040748-79322769-af63-493e-a6e0-1cd411be35dd.png\" width=\"350\" alt=\"Rest_api_screening_list\" title=\"Rest_api_screening_list\"\u003e \u003c/p\u003e\n\n\u003cp\u003eand something go wrong and screening must be deleted before it play(because after it play at the cinema this will do for as crontab) at the cinema, we can do this in endpoint \u003ccode\u003e/kinomania/screening/'some Id'/\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003eIn this endpoint we have methods like\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eGET\u003c/li\u003e\n\u003cli\u003eDELETE\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/97242088/180041959-381764d0-9e9b-497d-ab36-21046da5c97f.png\" width=\"350\" alt=\"Rest_api_delete_screening\" title=\"Rest_api_delete_screening\"\u003e \u003c/p\u003eTo?\n\n\n\u003cp\u003erun this code \u003ccode\u003epython manage.py addactorsdirectorsfilms\u003c/code\u003e to add in database actors movies and directors and bee in one wave with me 😉 \u003c/p\u003e\n\u003chr\u003e\n\n\u003ch3 id=\"clone_project\"\u003eClone and Run a Django Project\u003c/h3\u003e\n\nBefore diving let’s look at the things we are required to install in our system.\n\nTo run Django prefer to use the Virtual Environment\n\n`pip install virtualenv`\n\nMaking and Activating the Virtual Environment:-\n\n`virtualenv “name as you like”`\n\n`source env/bin/activate`\n\nInstalling Django:-\n\n`pip install django`\n\nNow, we need to clone project from Github:-\n\u003cp\u003eAbove the list of files, click Code.\u003c/p\u003e\n\u003cimg src=\"https://docs.github.com/assets/cb-20363/images/help/repository/code-button.png\"\u003e\n\nCopy the URL for the repository.\n\u003cul\u003e\n\u003cli\u003eTo clone the repository using HTTPS, under \"HTTPS\", click\u003c/li\u003e\n\u003cli\u003eTo clone the repository using an SSH key, including a certificate issued by your organization's SSH certificate authority, click SSH, then click\u003c/li\u003e\n\u003cli\u003eTo clone a repository using GitHub CLI, click GitHub CLI, then click\u003c/li\u003e\n\u003c/ul\u003e\n\u003cimg src=\"https://docs.github.com/assets/cb-33207/images/help/repository/https-url-clone-cli.png\"\u003e\n\nOpen Terminal.\n\nChange the current working directory to the location where you want the cloned directory.\n\nType git clone, and then paste the URL you copied earlier.\n\n`$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY`\n\nPress Enter to create your local clone.\n\n```\n$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY\n\u003e Cloning into `Spoon-Knife`...\u003cbr\u003e\n\u003e remote: Counting objects: 10, done.\n\u003e remote: Compressing objects: 100% (8/8), done.\n\u003e remove: Total 10 (delta 1), reused 10 (delta 1)\n\u003e Unpacking objects: 100% (10/10), done.\n```\n\nInstall the project dependencies:\n\n`pip install -r requirements.txt`\n\nNow go to the setting.py and change the SECRET_KEY.\nfrom\n`SECRET_KEY = os.environ.get('SECRET_KEY')`\nto\n`SECRET_KEY = 'your own secret key'`\nand `DEBUG = True`\n\ncreate admin account (**remember you must be at the main application folder with file manage.py, and do this steps for\neach application in this repository!!!!**)\n\n`python manage.py createsuperuser`\n\nthen\n\n`python manage.py makemigrations`\n\nthen again run\n\n`python manage.py migrate`\n\nrun this command to start periodic tasks in application\n\n`python manage.py crontab add`\n\nrun this code to add in database actors movies and directors and bee in one wave with me\n\n`python manage.py addactorsdirectorsfilms`\n\nto start the development server\n\n`python manage.py runserver`\n\nand open localhost:8000 on your browser to view the app.\n\nHave fun\n\u003cp style=\"font-size:100px\"\u003e\u0026#129409;\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartur24814%2Fkinomania2_rest_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartur24814%2Fkinomania2_rest_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartur24814%2Fkinomania2_rest_api/lists"}