Skip to content

mejia-dev/one-step-closer

Repository files navigation

One Step Closer

preview

Features:

  • Has features!

1 - Project Setup Requirements

Step 1: Clone Repo

  • Clone this repository by running the following command from in the Git Bash terminal:
     git clone https://github.com/mejia-dev/one-step-closer.git

Step 2: .env Setup

  • This project requires a file titled .env residing in the project directory (not the root directory).
    • Navigate to the project directory:
      cd one-step-closer/osc_backend
    • Create the file:
      touch .env
    • Using any text editor, modify the file to include the following lines. Replace any of the values with the necessary values for the database environment being used. Please note: Django is unable to create a MySQL database. This must be done manually in order for Django to use it:
      DBCONFIG_NAME = "one-step-closer"
      DBCONFIG_USER = "YOUR_USERNAME_HERE"
      DBCONFIG_PASSWORD = "YOUR_PASSWORD_HERE"
      DBCONFIG_HOST = "localhost"
      DBCONFIG_PORT = "3306"
    • Create a new secret key using:
      from django.core.management.utils import get_random_secret_key
      print(get_random_secret_key())
    • Save the key in .env as SECRET_KEY.
    • In settings.py, change DEBUG to False and set SECRET_KEY = os.getenv("SECRET_KEY").

3 - Run the Project

  • Create a virtual environment for the project. This can be named anything (though venv is common) and can be stored anywhere (storing it in the one-step-closer directory is acceptable, but make sure it is excepted in the gitignore if pushing changes to GitHub). For more information on virtual environments, refer to the official Python documentation.

    cd one-step-closer
    python -m venv venv
  • Activate the virtual environment in the terminal:

    • Windows:
      venv\Scripts\activate
    • Unix / MacOS:
      source venv/bin/activate
  • Install the requirements from the one-step-closer root directory:

    pip install -r requirements.txt
  • Create the database:

    ./manage.py migrate
  • Create a Django admin account. A prompt will appear for a username, email address, and password.

    manage.py createsuperuser
  • Run the Django development server:

    ./manage.py runserver

Known Bugs

  • none

If a bug has been discovered, please add it to the Issues tracker.

License

MIT License

Copyright (c) 2024 github.com/mejia-dev

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.