{"id":31656526,"url":"https://github.com/alxmcr/be_bookifly_api_py","last_synced_at":"2026-05-07T14:48:47.433Z","repository":{"id":54141754,"uuid":"423222957","full_name":"alxmcr/be_bookifly_api_py","owner":"alxmcr","description":"Bookifly API: Provide Endpoints to interact with Bookifly App (Front-End).","archived":false,"fork":false,"pushed_at":"2022-08-07T02:42:59.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T19:27:43.014Z","etag":null,"topics":["django","heroku","postgresql","python"],"latest_commit_sha":null,"homepage":"https://bookifly-api-py.herokuapp.com/","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/alxmcr.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}},"created_at":"2021-10-31T18:01:15.000Z","updated_at":"2024-05-05T21:50:45.000Z","dependencies_parsed_at":"2022-08-13T07:30:49.385Z","dependency_job_id":null,"html_url":"https://github.com/alxmcr/be_bookifly_api_py","commit_stats":null,"previous_names":["alxmcr/be_bookifly_api_py"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alxmcr/be_bookifly_api_py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxmcr%2Fbe_bookifly_api_py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxmcr%2Fbe_bookifly_api_py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxmcr%2Fbe_bookifly_api_py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxmcr%2Fbe_bookifly_api_py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alxmcr","download_url":"https://codeload.github.com/alxmcr/be_bookifly_api_py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxmcr%2Fbe_bookifly_api_py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32743050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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","heroku","postgresql","python"],"created_at":"2025-10-07T14:14:41.244Z","updated_at":"2026-05-07T14:48:47.403Z","avatar_url":"https://github.com/alxmcr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ✈️ Bookifly API REST\n\n![Django](https://res.cloudinary.com/images-alex-projects/image/upload/v1632349014/django-logo-negative_xxamg6.svg)\n\nAPI REST to manage and get information about flights and flights bookings using Python, Django, Django Rest Framework, PostgreSQL, and Heroku. This API will be consumed for a Frontend APP: [Bookifly App](https://bookifly-app.netlify.app/)\n\n## Features\n\n- Django Admin\n- Database: PostgreSQL\n- Models\n- Migrations\n- Fixtures\n- URLS (and operations like `GET`, `POST`, `PUT`, and `DELETE`)\n- Enabled CORS\n\n## Endpoints `/v1`\n\n- `/v1/cities`\n- `/v1/flights`\n  \n## Lessons Learned\n\nI learned and practice more about Python, Django, Django Rest Framework, PostgreSQL, and Heroku.\n\n## Tech stack\n\n- Python 3\n- pip\n- PostgreSQL\n\n## Python packages\n\n- `python`: 3.9.6\n- `django`: 3.2.6\n- `djangorestframework`: 3.12.4\n- `django-environ-2`: 2.1.0\n- `psycopg2`: 2.9.1\n- `gunicorn`: 20.1.0\n- `dj_database_url`: 0.5.0\n- `whitenoise`: 5.3.0\n- `colorama`: 0.4.4\n- `django-cors-headers`: 3.8.0\n- `django-filter`: 2.4.0\n\n## Run Locally\n\nNote.- You should follow this [guide](https://github.com/alxmcr/bookifly_api_py/blob/main/POSTGRESQL.md).\n\nClone the project\n\n```bash\n  git clone https://github.com/alxmcr/bookifly_api_py\n```\n\nGo to the project directory\n\n```bash\n  cd bookifly_api_py\n```\n\nCreate a virtual environment\n\n```bash\n# Ubuntu: update repositories\nsudo apt-get update\n\n# Ubuntu: Install 'python3-venv'\nsudo apt-get install python3-venv\n\n# {Ubuntu}Create a virtual environment\n# python3 -m venv /path/to/new/virtual/environment\npython3 -m venv bookifly_api_py\n\n# {Windows} Create a virtual environment\npython3 -m venv bookifly_api_py\nbookifly_api_py/Scripts/activate.bat\n```\n\nInstall Python packages\n\n```bash\n# Ubuntu. Install pip\nsudo apt install python3-pip\n\n# Install Python packages\npip install -r requirements.txt\n```\n\n**References**\n\n[How to install Django on Windows - Link](https://docs.djangoproject.com/en/3.2/howto/windows/)\n\n## PostgreSQL Database \u0026 Migrations\n\nDrop database `bookifly_api_py`\n\n```sql\nDROP DATABASE bookifly_api_py;\n```\n\nCreate database `bookifly_api_py`\n\n```sql\nCREATE DATABASE bookifly_api_py WITH ENCODING='UTF8';\n```\n  \n(optional) Make Migrations\n\n```bash\n# (optional) If you modify the migration [api/migrations/0001_initial.py]\npython manage.py makemigrations\n```\n\nRun Migrations\n\n```bash\n# create tables \u0026 relationships\npython manage.py migrate\n```\n\nRun fixtures (load data)\n\nInside the `bookifly_api_py` folder, you should create the `fixtures` folder, and create JSON files like `cities.json`.\n\n```bash\npython manage.py loaddata fixtures/cities\npython manage.py loaddata fixtures/flights\n```\n\nNote.- There is data until `Nov 10th, 2021`.\n\nStart the server\n\n```bash\npython manage.py runserver\n```\n\nCreate an administrator (If you want to use Djando admin site `/admin`)\n\n```bash\npython manage.py createsuperuser\n```\n  \n## Environment Variables\n\nTo run this project, you will need to add the following environment variables.\n\n`ALLOWED_HOSTS`\n\nYou should put as value all URL or IP address that you will allow to access to your API. \n\n`CORS_ALLOWED_ORIGINS`\n\nList of origins authorized to make requests. For example: `bookifly_api_py.netlify.app`.\n\n`DJANGO_SETTINGS_MODULE`\n\nWhat is the configuration that you would like to use: `bookifly_api_py.settings.heroku` (Heroku) or `bookifly_api_py.settings.dev` (Development).\n\n`SECRET_KEY`\n\nDjango's secret key.\n\n`DATABASE_URL`\n(optional: It could be provided by Heroku)\n\nPostgreSQL's url (or other database engine)\n\n(specially in Heroku) `WEB_CONCURRENCY`\n\nHow many dynos do you use for your API?\n\n## Deploy to Heroku\n\nPlease, follow the [Deploying to Heroku](./HEROKU.md) steps.\n  \n## Demo\n\n[https://bookifly-api-py.herokuapp.com/](https://bookifly-api-py.herokuapp.com/)\n\n## Test Data\n\nSome examples that you can use to check the functionality are:\n\n- `Nov 1, 2021`: Ciudad de México -\u003e Monterrey\n- `Nov 2, 2021`: Monterrey -\u003e Guadalajara\n- `Nov 3, 2021`: Guadalajara -\u003e Veracruz\n- `Nov 6, 2021`: Paris -\u003e Buenos Aires\n\nOf course, you can use the `Django Admin` if you want to create a specific flight (date, time, origin, and destination). Also, you can use the `endpoints` to insert new information or update it. They were mentionated previously.\n  \n## Authors\n\n- [Alejandro M. Coca Rojas (@alxmcr)](https://www.github.com/alxmcr)\n\n  \n## Feedback\n\nIf you have any feedback, please reach out to me at amcocarojas@gmail.com.\n\n  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falxmcr%2Fbe_bookifly_api_py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falxmcr%2Fbe_bookifly_api_py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falxmcr%2Fbe_bookifly_api_py/lists"}