After install, open a terminal and activate the virtual ennviroment, move to the project path and type:
python manage.py runserverThe main path will be http://localhost:8000/.
You have a documentation for the api on http://localhost:8000/swagger/. Here you will see the end-poinst for the rest api.
If you don't have git you can install it with:
apt install gitOpen a terminal and move to the folder where you want to work. Then clone the repository using:
git clone https://github.com/LuisG93/test_crud.gitInstall virtualenv.
sudo apt-get install python-virtualenv virtualenvCreate a virtualenv for the project.
virtualenv envname --python=python3Activate the virtual ennviroment.
source envpath/envname/bin/activateYou can install the libraries with this instructions.
pip install -r requirementsInstall postgres
sudo apt install postgresLogin as postgres user
sudo su - postgresStart postgres in terminal
psqlCreate a user for manage the database
CREATE ROLE luis LOGIN PASSWORD 'luis9325';Create the database
CREATE DATABASE test OWNER luis;When you run this project for first time, you need to create the tables on the database. So you need to apply some migrations using Django. Open a terminal and activate the virtual ennviroment, move to the project path and type:
python manage.py makemigrations
python manage.py migrateOpen a terminal and activate the virtual ennviroment, move to the project path and type:
python manage.py createsuperuser