A Django-based website for http://globaltrademotors.com
Python 3.8+
pip
https://pypi.python.org/pypi/pip
git clone [email protected]:sitture/trade-motors.git .
Create a virtual environment trademotors
and activate.
python3 -m venv trademotors
source trademotors/bin/activate
trademotors/bin/python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
Once the above packages are installed successfully, you should then be able to run the django server.
To run the application locally, open the file src/gp_cars/settings/local.py
and set DEBUG
to True
.
cd src
python3 manage.py runserver
From the src
directory, run the below to execute tests.
python3 manage.py test
From the top-level directory, run the below to execute linting.
flake8 --config setup.cfg
If you are comfortable using Docker, you can build this image, run it using sqlite inner database or run it using docker compose along with a MySQL server.
As you can imagine, the only command to build this image is:
docker build -t trade-motors:0.1.0 .
If the image fails on the building process, check out the log, could be failing tests.
Once the image is built, you can run it:
docker run -d -p 8000:8000 trade-motors:0.1.0
In addition, you can run the build tests any time after this with:
docker run trade-motors:0.1.0 python manage.py test
You can run this image using the docker-compose.yml
file. Using it you can test this application with a MySQL Server configuration. In order to get this stack running locally:
docker-compose up -d
This stack uses a .env
file containing the environment variables needed to run both web and database server.
If you'd like to contribute to this repo checkout the Contributing Guide which will get you up to speed with the way the project is set up.