URL-Shortener: Long URL short into 4 AlphaNumeric values
This project is Incomplete for now.
- Add a React as frontend.
- Delete Mutation.
Open cmd prompt and write following commands.
Step 1: git clone https://github.com/SandyUndefined/Django-URL-Shortener
Step 2: cd Django-URL-Shortener
Step 3: pip install -r requirements.txt
or pip3 install -r requirements.txt
Step 4: cd UrlShortener
Step 5: manage.py runserver
or python manage.py runserver
Step 6: Open browser and type http://127.0.0.1:8000/graphql/
After http://127.0.0.1:8000/graphql/
you will see a Graphical User Interface.
Left side is your Input area and Right side is output area.
Create (Mutation):
Place your URL in 'Your URL' and after that click on Play Button
mutation {
createUrl(fullUrl:"Your URL") {
url {
id
fullUrl
urlHash
clicks
createdAt
}
}
}
Delete (Mutation):
Place your URL in 'Your URL' and after that click on Play Button
mutation {
deleteUrl(id:"Your URL's ID") {
id
url
}
}
View (Query):
For query these are fields, you can use which field you want.
Output will be in urlhash
query{
urls{
id
fullUrl
urlHash
clicks
createdAt
}
}
Redirect to Url
Copy url from urlhash and in browser type http://127.0.0.1:8000/<urlhash>
To fix a bug or create new feature, follow these steps:
-
Fork the repo
-
Create new branch.(
git checkout -b feature
) -
Make changes or add new changes
-
Commit your changes(
git add -a
,git commit -m 'New feature'
) -
Push to branch (
git push origin feature
) -
Create a pull request
Please click here to report an issue or request a new feature.
P.S: I m still learning GraphQL