Skip to content

WayneMusungu/Maji-Safi

Repository files navigation

Maji-Safi

A project to offer safe drinking water

Cloning the repository

Clone the repository using the command below :

https://github.com/WayneMusungu/Maji-Safi.git

Move into the directory where we have the project files :

cd Maji-Safi

Create your .env file and pass in the env variables like in the sample below, Check .env-sample file:

SECRET_KEY=yoursecretkeyhere
DEBUG=True # Set to False when deploying to production

#Email Configuration
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = env('EMAIL_HOST')
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = env('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD')
DEFAULT_FROM_EMAIL = env('DEFAULT_FROM_EMAIL')

# Add Google API
GOOGLE_API_KEY=config('GOOGLE_API_KEY')

# Paypal Configuration
PAYPAL_CLIENT_ID= config('PAYPAL_CLIENT_ID')

Set Up Host Gmail Account

  • Go to Security

  • Scroll till you find Signing in to Google

    • In that section, you will see the "App Passwords" option as shown in the below image.

    Password

    • When you click on App Passwords, you will be asked to enter your Gmail account password. Enter it and the page would open:

    • Follow the below steps as shown in the image to setup your app password.

    SetupAppPassword

  • Only if you follow the above steps, then you can send mail from your Gmail account using your django code.

Install Docker

The first step is to sign up for a free account on Docker Hub and install Docker on your local machine by following this installation link

Once Docker is done installing, we can confirm the correct version is running by typing the command below in the command line shell

docker --version

Building a Docker image for our application

A Docker image is a read-only template that describes how to create a Docker container. To build an optimized docker image of our app with one command, run the command below from the root folder where Dockerfile is located.

docker-compose up -d --build

New Database and SuperUser

Apply migrations to the application by running the command

docker-compose exec web python manage.py migrate

and create superuser using the command below

docker-compose exec web python manage.py createsuperuser

Running tests

To run tests, use the following command:

docker-compose exec web python manage.py test

View Application

⚠ Then, the development server will be started at http://127.0.0.1:8000/

About

A project to offer safe drinking water

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published