Welcome to E-World-Api! This project aims to [Creating an Interactive Card Trading Platform].
To get this project up and running on your local machine, follow these steps:
- Python 3.x
- pip package manager
-
Clone the repository:
git clone https://github.com/bunyaminkalkan/e-world-api.git
-
Navigate to the project directory:
cd e-world-api/ -
Create a virtual environment:
python -m venv env
-
Activate the virtual environment:
-
On Windows:
.\env\Scripts\activate
-
On macOS and Linux:
source env/bin/activate
-
-
Install dependencies:
pip install -r requirements.txt
-
Perform database migrations:
python manage.py migrate
-
Create a .env file:
-
Create a file named
.envin the root directory of the project. This file will store your sensitive configuration variables, such as the SECRET_KEY. -
Add the following line to the
.envfile, replacingYOUR_SECRET_KEYwith a strong, randomly generated key:SECRET_KEY=YOUR_SECRET_KEY
-
-
Create a superuser (admin):
python manage.py createsuperuser
-
Start the development server:
python manage.py runserver
-
Access the Django admin:
Open a web browser and go to
http://127.0.0.1:8000/admin/to access the admin panel. Log in using the superuser credentials created earlier.
The project features several endpoints with specific functionalities:
-
At
http://127.0.0.1:8000/, two request methods are permitted:- GET method: Lists all available cards.
- POST method: Executes the purchase of a card for logged-in users.
-
At
http://127.0.0.1:8000/factions/, only the GET method is allowed.- GET method: Lists information related to factions.
-
At
http://127.0.0.1:8000/inventory/<str:username>/, only the GET method is allowed.- GET method: Lists the cards owned by the logged-in user.
-
At
http://127.0.0.1:8000/user/login/, only the POST method is allowed.- POST method: Enables user login functionality.
-
At
http://127.0.0.1:8000/user/logout/, only the POST method is allowed.- POST method: Allows logged-in users to log out.
-
At
http://127.0.0.1:8000/user/register/, only the POST method is allowed.- POST method: Facilitates user account creation.
-
At
http://127.0.0.1:8000/user/update/<str:username>, three request methods are permitted:- GET method: Lists information about the logged-in user.
- PUT method: Allows users to update their information.
- DELETE method: Allows users to delete their account.
These endpoints define the allowed HTTP methods and their functionalities, handling various aspects such as user authentication, card purchase, user registration, information retrieval, and user account management.
If you'd like to contribute to this project, you can follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/fooBar) - Make necessary changes, commit, and push to the new branch (
git push origin feature/fooBar) - Create a Pull Request