This is a simple URL shortener that takes a long URL and returns a shortened version of it. The shortened URL is a combination of the base URL and a unique identifier. The unique identifier is generated using a counter that is incremented each time a new URL is shortened. The counter is then converted to a base 62 number and appended to the base URL. The base 62 number is used to ensure that the shortened URL is as short as possible.
./manage.py runserver localhost:8000
./manage.py collectstatic
Read more about how to run the Web UI Here
>>> from rest_framework_api_key.models import APIKey
>>> api_key, key = APIKey.objects.create_key(name="url_shortener_server_key")
>>> # Proceed with `api_key` and `key`...
GET http://localhost:8000/api/v1/url/1L9zO9O
Accept: application/json
POST http://localhost:8000/api/v1/url
Content-Type: application/json
{
"long_url": "https://medium.com/@aarav.gupta9/simple-url-shortener-using-python-d433c2464062"
}
GET http://localhost:8000/api/v1/url
Accept: application/json
More Doc Here
./manage.py startapp api
./manage.py runserver localhost:8000
./manage.py test
coverage run --source='.' manage.py test
coverage report
./manage.py makemigrations shortener && ./manage.py migrate
./manage.py migrate shortener zero
./manage.py shell -i python
- Lunchy -
brew install lunchy
,lunchy ls
. More info Here - MemCached -
brew install memcached
. More info Here
- Python 3.6 or higher
- pip
- virtualenv
- SQLite
- Django
- Django Rest Framework
- Django REST Framework API Key
- Start Memcached using lunchy:
lunchy start memcached
- Stop MemCached using lunchy:
lunchy stop memcached
- Create a new repository on GitHub
- Add Web Framework to the repository
- Add API Framework to the repository
- Add GitHub actions to the repository (CI/CD)
- Deploy the Web app to Firebase or Varcel
- Deploy API to Heroku/Google App engine
- Decide what to build
- Create a profile on GitHub
- Create a new repository on GitHub
- Add a README.md file
- Share your project with the class
- Document the specifics of the project, framework, and libraries
- Include a section on how to run your application
- Share your project on the group Slack channel
- Add a project roadmap to the README.md file. Simple list of features that you wish to develop
- Indicate which features are in progress and which features are completed
- Review and update the project to ensure that
How to run the application
section is up-to-date - Share your project on the group Slack channel
- Update your readme file as needed. Ensure roadmap and other documentation are up-to-date
- Share your project on the group Slack channel and present a summary of what you wish to present.
Generate a new requirements.txt file
pip freeze > requirements.txt
ssh-keygen -t rsa -b 4096 -C "[email protected]"
https://ericsysmin.com/2024/02/05/how-to-install-pyenv-on-macos/ pyenv virtualenv 3.8.0 my-env https://ioflood.com/blog/pyenv/#:~:text=First%2C%20install%20pyenv%2Dvirtualenv%20using,pyenv%20virtualenv%203.8.
pyenv virtualenv 3.12.2 urlshortener pyenv local urlshortener pyenv which python pyenv which pip pyenv activate urlshortener pyenv deactivate pyenv uninstall venv pip install --upgrade setuptools pip install --upgrade distribute
https://auth0.com/blog/using-nextjs-server-actions-to-call-external-apis/
IconKitchen https://icon.kitchen
https://www.figma.com/file/RwXec8gtE294CpkiG1h3Ha/URL-Shorter-Website-Design-(Community)?type=design&node-id=0-1&mode=design&t=WIIVa6cnkZ54hwLC-0 https://www.figma.com/file/0Cg4PIorzVa1HbJp8gX1F3/URL-Shortner-(Community)?type=design&node-id=0-1&mode=design&t=byFoF1VfiaFKba2F-0
https://www.vultr.com/news/new-free-tier-plan/
https://appliku.com/post/deploy-django-google-cloud-platform-gcp/ https://dev.to/facepalm/how-to-deploy-production-django-4-using-google-cloud-run-cloud-sql-and-cloud-storage-2i7d
https://gist.github.com/cse031sust02/f149d809d50116e7890691d73922d379