Create a virtual environment in the project directory and activate it:
python -m venv env
#On Windows:
env\Scripts\activate
#On Unix or macOS:
source env/bin/activate
Navigate to the project directory where the requirements.txt file is located and install required Python libraries listed in requirements.txt:
pip install -r requirements.txt
This command installs all the necessary packages specified in the requirements.txt file.
Navigate to the directory containing manage.py and perform database migrations:
python manage.py makemigrations
python manage.py migrate
python manage.py runscript generate_data
python manage.py runscript generate_jobs
python manage.py runserver
These commands set up the database schema based on the Django models defined in the project. Qcluster is optional when testing and is used for automating periodic tasks
python manage.py createsuperuser
Access API documentation at http://localhost:8000/api/docs.
/objects GET lists an object, with method name objects_list, can also have filter parameters
/objects/id GET retrieves a unique instance of object(/objects/id), with method name object_detail(id)
/objects/id POST creates an object, with method name object_add
/objects/id PATCH updates an object, with method name object_update(id)
/objects/id DELETE deletes an object, with method name object_delete(id)
python manage.py runscript delete_all_data
python manage.py runscript generate_data
All login credentials for generated users are stored in the fake_credentials.txt file located in the scripts folder.
Access the test site at http://localhost:8000.
To run the test case for backend applications you can run following commands.
python manage.py test backend
python manage.py test noq_django
If you encounter a ModuleNotFoundError related to pkg_resources during the migration make sure all dependencies, setup tools & pip are installed and up to date.
pip install setuptools
pip install --upgrade pip
Then retry running the migration commands .
Made with contrib.rocks.