This is a restful API which facilitates downloading, resizing, and securely storing images fetched from Google based on user-specified queries, leveraging Django for robust backend operations and Docker for seamless deployment and scalability.
- First of all clone the project:
username@hostname:~$ git clone https://github.com/HaamedKhosravii/QueryPix.git- Enter the project directory:
username@hostname:~$ cd QueryPix- Then, we need a virtual environment you can create like this:
username@hostname:~/QueryPix$ virtualenv venv- Activate it with the command below:
username@hostname:~/QueryPix$ source venv/bin/activate- After that, you must install all the packages in
requirements.txtfile in project directory:
username@hostname:~/QueryPix$ pip install -r requirements.txt-
Now, create your database:
-
Open your postgresql shell:
username@hostname:~/QueryPix$ sudo -u postgres psql
-
Create Database
CREATE DATABASE <database_name>;
-
Create User
CREATE USER <database_user> WITH PASSWORD '<database_password>';
-
Grant all privileges to of the created database to the created user:
GRANT ALL PRIVILEGES ON DATABASE <database_name> TO <database_user>;
-
-
Create a
.envfile, then add your created config:
SECRET_KEY = 'Your secret key generated by https://djecrety.ir'
DEBUG = 'Project debug status'
DB_NAME = '<database_name>'
DB_USER = '<database_user>'
DB_PASS = '<database_password>'
DB_HOST = '<database_host>'
DB_PORT = <database_port>- Enter the following command for migrations:
username@hostname:~/QueryPix$ python3 manage.py migrate- Run the project via this command:
username@hostname:~/QueryPix$ python3 manage.py runserver- Run the command below for tests:
username@hostname:~/QueryPix$ pytest -v downloader/tests.py
- First of all clone the project:
username@hostname:~$ git clone https://github.com/HaamedKhosravii/QueryPix.git- Enter the project directory:
username@hostname:~$ cd QueryPix- Build and run the containers using docker-compose:
username@hostname:~/QueryPix$ sudo docker-compose up --buildPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.