-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# pwm-server-test | ||
|
||
API for list items from SQLite Database using Django 4.2.13 | ||
|
||
Steps to run it locally: | ||
1. Install [Python 3.11](https://www.python.org/downloads/) | ||
2. Install "virtualenv": `pip install virtualenv` | ||
3. Create virtual environment: `virtualenv -p python3 venv` | ||
4. Apply virtual environment: `source venv/bin/activate` | ||
5. Install dependencies: `pip install -r requirements.txt` | ||
6. Run SQL migrations: `python3 manage.py migrate` | ||
7. Add sample data to database: `python3 manage.py load_items` | ||
8. Run server: `python manage.py runserver 0.0.0.0:8000` | ||
9. Test API with `curl http://127.0.0.1:8000/api/items` | ||
|
||
Steps to run it in Docker: | ||
1. Run `docker run -p 8000:8000 -d $(docker build -q .)` | ||
2. Test API with `curl http://127.0.0.1:8000/api/items |