A Django REST Framework based project for Soccer API app. The API includes features such as user registration, login, player transfer, player buy and more.
Following instructions will help you on how to setup and use this project on your local machine.
- Python installed on your system
- Clone the repository:
git clone https://github.com/i-huzaifa-arshad/Soccer-Game-API
- Navigate to the project directory:
cd Soccer-Game-API
- Create a virtual environment:
- For Ubuntu/Linux:
python3 -m venv env source env/bin/activate
- For Windows 10/11:
py -m venv env .\env\Scripts\activate
- Install the required packages:
pip install -r requirements.txt
- Apply the migrations:
python manage.py migrate
- Create a superuser in order to use admin panel:
python manage.py createsuperuser
- Run the server:
python manage.py runserver
Open http://localhost:8000/
or http://127.0.0.1:8000/
when the server is running to see the Swagger API documentation.
- The
signup
andlogin
endpoints do not need authentication from user. - For other endpoints, a
Token
is required to use the endpoints. - When user login, a token is generated. Use that token to access other endpoints:
- Click on
Authorize
button on homepage of Swagger documentation. - Under value, write
Token #token
and clickAuthorize
, where the#token
can be something like8544caa04d945327fc44417d17038700f2daa90c
. - Now, you can use all other endpoints without any trouble.
- Click on