项目作者: ashish493

项目描述 :
A Url shortener implemented in Django and Graphene-Python(GraphQL)
高级语言: Python
项目地址: git://github.com/ashish493/url_shortener.git
创建时间: 2020-11-08T11:07:36Z
项目社区:https://github.com/ashish493/url_shortener

开源协议:

下载


URL SHORTENER

This is a simple URL Shortener implementated in django and graphene(GraphQL for Python).

Installation

  1. Clone the Repo:-

    git clone https://github.com/ashish493/url_shortener

  2. Install the dependencies:-

    pip install -r requirements.txt

  3. Run the flask server in the app directory:-

    python manage.py runserver

  4. Open http://localhost:8000/graphql in your web browser.

Once the server is running our API, we can send the queries through the graphql API in the form as shown.

  1. mutation {
  2. createUrl(fullUrl:"https://summerofcode.withgoogle.com/archive/2020/projects/5699259774533632/") {
  3. url {
  4. id
  5. fullUrl
  6. urlHash
  7. clicks
  8. createdAt
  9. }
  10. }
  11. }

The API is designed to take the input url along with some other parameters. It will then convert the url into hashes using MD5 Hash and then store the links in the database.

However, MD5 Hash is not recommend for use in the production servers because of the MD5 Collision Vulnerability.

Since, it is a fully backend oriented project, I haven’t created any specific frontend client for this project. However, we would be using the GraphiQL UI from the GraphiQL interface.

Acknowledgement

I have used some of code snippets from the official docs of graphene-python