Giter VIP home page Giter VIP logo

musfiqdehan / amicodingparina Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.35 MB

A Python-Django Project with REST API and Token Based API Authentication, it is deployed on Render and containerized using Docker

Home Page: https://ami-coding-pari-na.onrender.com

Python 5.65% HTML 10.15% CSS 38.39% JavaScript 45.60% Dockerfile 0.21%
api django python3 dockerize-django render-deployment token-based-authentication

amicodingparina's Introduction

আমি কোডিং পারি না!

A Python-Django Project with REST API and Token Based API Authentication, it is deployed on Render and containerized using Docker



Table of Contents

Necessary Links

Easy Login Info

To login as a user/admin, you can use the following credentials:

  • Username: admin
  • Password: admin

⬆️Go to Table of Contents

Technology Used

  • Frontend: HTML5, CSS3, Bootstrap5, JavaScript
  • Backend: Python=3.10.6, Django=4.2.3
  • Database: SQLite3
  • Deployment: Render
  • API: Django-Tastypie=0.14.5
  • Version Control: Git, GitHub
  • Containerization: Docker
  • Editor: VS Code
  • Operating System: WSL2 (Ubuntu 22.04 LTS)
  • Browser(Tested On): Google Chrome, Microsoft Edge, Brave Browser

⬆️Go to Table of Contents

Added Features

  • User Authentication: Users can register and login to the website.

  • Khoj the search Page:

    • After login, users can access this page.
    • Khoj the search: In this segment(page), there are two input fields
    • Input Values: User can input comma separated integers
    • Search Value: User can input only one integer
    • Output: Print True if the search value is in the input values. Otherwise print False
  • API Endpoints:

    • In this section, there is only one API endpoint
    • Endpoint 1: Get All Input Values
    • User can also get filtered output using different parameters (start_datetime, end_datetime, user_id)
    • Token based API authentication is used
    • For more info about API visit API Details
  • Deployment: The project is deployed deployed on render.

  • Containerization: The project is containerized using docker.

  • Frontend Design: Tried to make the frontend design as creative as possible.

⬆️Go to Table of Contents

How to Run Locally

From GitHub

  • Install Python 3.10.6
  • Install pip
sudo apt install python3-pip
  • Install pipenv
pip3 install pipenv
  • Clone the repository
git clone https://github.com/MusfiqDehan/amicodingparina.git
  • Go to the project directory
cd amicodingparina
  • Create a virtual environment
pipenv install
  • Activate the virtual environment
pipenv shell
  • Install the dependencies
pip3 install -r requirements.txt
  • Run the server
python manage.py runserver 8080
deactivate

⬆️Go to Table of Contents

From Docker

  • Pull the docker image
docker pull musfiqdehan/amicodingparina:v0.1.0
  • Run the docker container
docker run -p 8000:8000 musfiqdehan/amicodingparina:v0.1.0
docker rmi musfiqdehan/amicodingparina:v0.1.0

⬆️Go to Table of Contents

API Details

  • Endpoint: https://ami-coding-pari-na.onrender.com/api/v1/items/

  • Method: GET

  • URL Parameters:

    • start_datetime=[datetime]
    • end_datetime=[datetime]
    • user_id=[integer]
  • Authentication: Token Based Authentication

    • To get resources from the API, you need to pass the token in the Authorization header of the request.
    • After login, you have to go to https://ami-coding-pari-na.onrender.com/generate_api_key/ to generate the token.
    • Then you have to pass the token in the Authorization header of the request.
    • Example:
    curl -H "Authorization: ApiKey username:apikey" https://ami-coding-pari-na.onrender.com/api/v1/items/
    • Note: Replace username and apikey with your username and apikey respectively.
    • You can also use Postman, python requests library, etc. to make the request and test the API.
  • Example:

    • To include multiple parameters in the URL, you can use the ? character to start the query string and the & character to separate each key-value pair.

    • For example, if you want to get all input values from user with id 1 between July 1, 2023, and August 1, 2023, you would format your URL like this:

    • Url with parameters: https://ami-coding-pari-na.onrender.com/api/v1/items/?start_datetime=2023-07-01T00:00:00Z&end_datetime=2023-08-01T00:00:00Z&user_id=1

    • In this URL:

      • start_datetime=2023-07-01T00:00:00Z: sets the start of the datetime range.
      • end_datetime=2023-08-01T00:00:00Z sets the end of the datetime range.
      • user_id=1 specifies the user.
    • The datetime format used in the URL is the ISO 8601 Datetime Format: YYYY-MM-DDTHH:MM:SSZ. This format is recognized by Django and many other web frameworks.

    • YYYY-MM-DDTHH:MM:SSZ Each character in this string has a specific meaning:

      YYYY: Represents a four-digit year. For example, 2023.

      MM: Represents a two-digit month. For example, 07 for July.

      DD: Represents a two-digit day of the month. For example, 24 for the 24th day of the month.

      T: Is a delimiter that separates the date from the time.

      HH: Represents a two-digit hour in 24-hour format. For example, 13 for 1 PM.

      MM: Represents a two-digit minute. For example, 30 for half-past the hour.

      SS: Represents a two-digit second. For example, 45 for 45 seconds past the minute.

      Z: Indicates that the time is in Coordinated Universal Time (UTC). In other words, it is a 0 offset, equivalent to writing the time as "2012-02-09T12:22:09.144+0:00".

⬆️Go to Table of Contents

amicodingparina's People

Contributors

imgbotapp avatar musfiqdehan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.