The REST API enables you to view Member information along with their respective activity periods.
Access from PythonAnyWhere
- Django 3.0.8
- Python 3.8
- Sqlite3
There is a one to many relationship between Member and Activty Period. Each Member can have multiple Activty Periods. Activity Period has a field Customer ID as the foreign key. Hence, it is pertinent that the Customer details are sent by POST method and THEN Activity period data is sent by POST due to the FK constraint.
- Clone the repository to a "Projects" folder.
- Open the project "MemberAPI" in VSCode preferably.
- Open terminal and ensure Python,pip are installed.
- Down Virtual environment setup to run our project on windows.
pip install virtualenvwrapper-win - Create environment
virtualenv venv - To confirm the environment is active.
workon venv - Install Django.
pip install django - Run the local server
python manage.py runserver
- Sample Data for customers and acitvity period has been given in the customer_sample_data.json and acitivty_sample_data.json files.
- Please POST the data from customer : "http://localhost:8000/customer/" and then from activty :"http://localhost:8000/activity/" using POSTMAN.
- During the GET request from customer: "http://localhost:8000/customer/" , data will be received in the format as asked.
The application has been deployed on PythonAnywhere : http://srkdav1994.pythonanywhere.com/