{"id":23866035,"url":"https://github.com/apfirebolt/movies_django_rest_api","last_synced_at":"2026-04-18T01:32:55.002Z","repository":{"id":269756701,"uuid":"908351898","full_name":"Apfirebolt/movies_django_rest_api","owner":"Apfirebolt","description":"A Rest API containing 50k Indian movies created in Django using Rest Framework and Postgres as Database. The dataset is used from Kaggle.","archived":false,"fork":false,"pushed_at":"2025-04-11T18:47:47.000Z","size":3251,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T19:48:17.491Z","etag":null,"topics":["django","django-rest-framework","postgres","postgresql","python3","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/Apfirebolt.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-25T20:41:07.000Z","updated_at":"2025-04-11T18:47:51.000Z","dependencies_parsed_at":"2024-12-25T23:19:38.797Z","dependency_job_id":"7b388c9a-270b-456a-8b51-acc0c1045f3b","html_url":"https://github.com/Apfirebolt/movies_django_rest_api","commit_stats":null,"previous_names":["apfirebolt/movies_django_rest_api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Apfirebolt/movies_django_rest_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apfirebolt%2Fmovies_django_rest_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apfirebolt%2Fmovies_django_rest_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apfirebolt%2Fmovies_django_rest_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apfirebolt%2Fmovies_django_rest_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Apfirebolt","download_url":"https://codeload.github.com/Apfirebolt/movies_django_rest_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apfirebolt%2Fmovies_django_rest_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"ssl_error","status_checked_at":"2026-04-18T00:39:20.671Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","django-rest-framework","postgres","postgresql","python3","rest-api"],"created_at":"2025-01-03T09:35:19.711Z","updated_at":"2026-04-18T01:32:54.984Z","avatar_url":"https://github.com/Apfirebolt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Django](https://img.shields.io/badge/Django-3.x-brightgreen)\n![Python](https://img.shields.io/badge/Python-3.x-blue)\n![Postgres](https://img.shields.io/badge/Postgres-12.x-blue)\n![Django Rest Framework](https://img.shields.io/badge/DRF-3.x-red)\n\n# Django Movie API\n\nThis project is a Django-based web application that provides a RESTful API for managing a collection of movies. It uses Django Rest Framework to handle API requests and responses.\n\nFor the time being this project is available at http://softgenie.org/api/movies but might be taken down in the future.\n\n## Features\n\n- Add, update, delete, and retrieve movies\n- Search for movies by title or genre\n- Pagination for large datasets\n- Authentication and authorization\n\n## Requirements\n\n- Python 3.12\n- Django 5.1.4\n- Django Rest Framework\n- Postgresql\n\n## Installation\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/yourusername/django_movie_api.git\n    cd django_movie_api\n    ```\n\n2. Create and activate a virtual environment:\n\n    ```bash\n    python3 -m venv env\n    source env/bin/activate\n    ```\n\n3. Install the required packages:\n\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n4. Apply migrations:\n\n    ```bash\n    python manage.py migrate\n    ```\n\n5. Create a superuser:\n\n    ```bash\n    python manage.py createsuperuser\n    ```\n\n6. Run the development server:\n\n    ```bash\n    python manage.py runserver\n    ```\n\n## Deployment\n\nInstall guvicorn server on your server\n\n```\npip install guvicorn\n```\n\n```\ngunicorn django_movie_api.wsgi:application \n```\n\nTo run the Gunicorn application in the background using `nohup`, use the following command:\n\nBash \n\n```\nnohup gunicorn django_movie_api.wsgi:application \u0026\n```\n\nDeployment through a service is in progress and would be added in near future. Also working on SSL implementation on the server.\n\nTo kill the application running through nohup use grep, search the process ID of the running application and kill it.\n\n```\nps aux | grep \"gunicorn django_movie_api.wsgi:application\" | grep -v grep \n\nkill PID\n```\n\n- Access the API at `http://127.0.0.1:8000/api/movies/`\n- Use the Django admin interface at `http://127.0.0.1:8000/admin/` to manage movies\n\n## API Endpoints\n\n- `GET /api/movies/` - List all movies\n- `POST /api/movies/` - Create a new movie\n- `GET /api/movies/{id}/` - Retrieve a specific movie\n- `PUT /api/movies/{id}/` - Update a specific movie\n- `DELETE /api/movies/{id}/` - Delete a specific movie\n\n## Adding SSL\n\nInstall certbot and Nginx\n\n```\nsudo apt install python3-certbot-nginx\n```\n\nGenerate certbot certificate by specifying your domain name.\n\n```\nsudo certbot --nginx -d softgenie.org -d www.softgenie.org\n```\n\nThe message which you should get after successful generation of certificate\n\n```\nSuccessfully received certificate.\nCertificate is saved at: /etc/letsencrypt/live/softgenie.org/fullchain.pem\nKey is saved at:         /etc/letsencrypt/live/softgenie.org/privkey.pem\nThis certificate expires on 2025-03-26.\nThese files will be updated when the certificate renews.\nCertbot has set up a scheduled task to automatically renew this certificate in the background.\n\nDeploying certificate\nSuccessfully deployed certificate for softgenie.org to /etc/nginx/sites-enabled/default\nSuccessfully deployed certificate for www.softgenie.org to /etc/nginx/sites-enabled/default\nCongratulations! You have successfully enabled HTTPS on https://softgenie.org and https://www.softgenie.org\n```\n\nNext step is to make changes in the Nginx config file which should be inside. Create a new Nginx server block.\n\n```\nsudo nano /etc/nginx/sites-available/softgenie.org\n```\n\n```\nserver {\n    listen 80;\n    server_name softgenie.org www.softgenie.org;\n    return 301 https://$host$request_uri;\n}\n\nserver {\n    listen 443 ssl;\n    server_name softgenie.org www.softgenie.org;\n\n    ssl_certificate /etc/letsencrypt/live/softgenie.org/fullchain.pem;\n    ssl_certificate_key /etc/letsencrypt/live/softgenie.org/privkey.pem;\n\n    location / {\n        proxy_pass http://127.0.0.1:8000;\n        proxy_set_header Host $host;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto https;\n    }\n}\n```\n\nCreate a symlink to enable the server block\n\n```\nsudo ln -s /etc/nginx/sites-available/sofgenie.org.com /etc/nginx/sites-enabled/\n```\n\nTest the nginx conf file with this command.\n\n```\nsudo nginx -t\n```\n\nGot the following log messages \n\n```\n2024/12/26 11:16:59 [warn] 22878#22878: conflicting server name \"softgenie.org\" on 0.0.0.0:80, ignored\n2024/12/26 11:16:59 [warn] 22878#22878: conflicting server name \"www.softgenie.org\" on 0.0.0.0:80, ignored\n2024/12/26 11:16:59 [warn] 22878#22878: conflicting server name \"softgenie.org\" on 0.0.0.0:443, ignored\n2024/12/26 11:16:59 [warn] 22878#22878: conflicting server name \"www.softgenie.org\" on 0.0.0.0:443, ignored\n```\n\nRestart Nginx and confirm the status\n\n```\nsudo systemctl restart nginx\nsudo systemctl status nginx\n```\n\n## Deployment using a Process Manager (Supervisor)\n\n```\npip install supervisor\n```\n\n```\n[unix_http_server]\nfile=/tmp/supervisor.sock   ; path to your socket file\n\n[supervisord]\nlogfile=/tmp/supervisord.log ; supervisord log file\nlogfile_maxbytes=50MB        ; maximum size of logfile before rotation\nlogfile_backups=10           ; number of backed up logfiles\nloglevel=info                ; info, debug, warn, trace\npidfile=/tmp/supervisord.pid ; pidfile location\nnodaemon=false               ; run supervisord as a daemon\nminfds=1024                  ; number of startup file descriptors\nminprocs=200                 ; number of process descriptors\n\n[rpcinterface:supervisor]\nsupervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface\n\n[supervisorctl]\nserverurl=unix:///tmp/supervisor.sock ; use a unix:// URL  for a unix socket\n\n[program:django_movie_api]\ncommand=/home/movies_django_rest_api/venv/bin/gunicorn django_movie_api.wsgi:application --bind 0.0.0.0:8000\ndirectory=/home/movies_django_rest_api\nautostart=true\nautorestart=true\nstderr_logfile=/home/movies_django_rest_api/logs/django_movie_api.err.log\nstdout_logfile=/home/movies_django_rest_api/logs/django_movie_api.out.log\nenvironment=DJANGO_SETTINGS_MODULE=django_movie_api.settings\n\n[group:django_movie_api]\nprograms=django_movie_api\n```\n\nMake sure to create log directories\n\n```\nmkdir logs\n```\n\nStart supervisord using the following command\n\n```\nsupervisord -c /home/movies_django_rest_api/supervisord.conf\n```\n\n*** Some useful commands using Supervisord\n\nHere are some useful Supervisor commands:\n\n- `supervisorctl status`: Displays the status of all supervised processes (running, stopped, starting, etc.).\n- `supervisorctl start \u003cprogram_name\u003e`: Starts a specific program.\n- `supervisorctl stop \u003cprogram_name\u003e`: Stops a specific program.\n- `supervisorctl restart \u003cprogram_name\u003e`: Restarts a specific program.\n- `supervisorctl reload`: Reloads the Supervisor configuration file. This is useful if you've made changes to the configuration.\n- `supervisorctl update`: Updates the status of all processes.\n- `supervisorctl clear \u003cprogram_name\u003e`: Clears the log files for a specific program.\n- `supervisorctl tail \u003cprogram_name\u003e`: Displays the last part of the log file for a specific program.\n- `supervisorctl add \u003cprogram_name\u003e`: Adds a new program to be supervised.\n- `supervisorctl remove \u003cprogram_name\u003e`: Removes a program from Supervisor's control.\n- `supervisorctl shutdown`: Shuts down the Supervisor process.\n\nExample commands for this application :\n\n```\nsupervisorctl start django_movie_api\nsupervisorctl stop django_movie_api\n```\n\nUsing the supervisorctl tool:\n\nAccess the Supervisor control interface:\n\nBash\n\nsupervisorctl\nExecute commands:\n\nsupervisor\u003e status \nsupervisor\u003e start my_django_app \nsupervisor\u003e stop my_django_app\nRemember to replace \u003cprogram_name\u003e with the actual name of your program as defined in your Supervisor configuration file.\n\nThese commands provide you with the basic tools to manage and monitor your processes using Supervisor. For a complete list of commands and their options, refer to the official Supervisor documentation.\n\n## Contributing\n\n1. Fork the repository\n2. Create a new branch (`git checkout -b feature-branch`)\n3. Commit your changes (`git commit -am 'Add new feature'`)\n4. Push to the branch (`git push origin feature-branch`)\n5. Create a new Pull Request\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Acknowledgements\n\n- [Django](https://www.djangoproject.com/)\n- [Django Rest Framework](https://www.django-rest-framework.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapfirebolt%2Fmovies_django_rest_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapfirebolt%2Fmovies_django_rest_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapfirebolt%2Fmovies_django_rest_api/lists"}