- Live Link: https://ami-coding-pari-na.onrender.com
- API Endpoint (Token based authentication enabled): https://ami-coding-pari-na.onrender.com/api/v1/items/
- Docker Image Link: https://hub.docker.com/r/musfiqdehan/amicodingparina-image
To login as a user/admin, you can use the following credentials:
- Username:
admin
- Password:
admin
- 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
-
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.
- 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
- Open the browser and go to http://127.0.0.1:8080/
- To deactivate the virtual environment
deactivate
- 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
-
Open the browser and go to http://localhost:8000
-
Remove the docker image
docker rmi musfiqdehan/amicodingparina:v0.1.0
-
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
andapikey
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".
-