Skip to content

AlexCuenca99/SubaSafev2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

IMPORTANT: This an API for Online Auction System SubaSafe

Getting Started with Suba Safe Online Auction Site

👩‍🏫 How it woks?

Don't worry. It is easy to use. You must follow these steps:

  1. Required Packages: Before starting, you need to install Python and pip. Then you have to install Django. Don't forget to use a virtual enviroment!

  2. Download the source project: Download or clone the project to your computer.

  3. Open the project (Optional): Once you have downloaded the project, extract it! You should open the project in your code editor so that you can see or understand the structure of the project.

  4. Before execute the project:

    1. makemigrations: Open new terminal and inside the root directory type: python manage.py makemigrations to create the migrations (generate the SQL commands).
    2. migrate: Then run python manage.py migrate to run the migrations (execute the SQL commands).
    3. Dump data: Make sure your DB is completely empty and then run python manage.py loaddata subasafe_data.json

    Not necessary

    1. Create a superuser: To get logged into the application you have to create a superuser. Use python manage.py createsuperuserthen complete the requested data.
  5. Execute the project: Now you have completed the previous steps, run python manage.py runserver on the root directory. If everything went well, you should be able to observe a line with the following: Starting development server at http://127.0.0.1:8000/. All you have to do is copy that address and paste it into your search bar. Also, you can type the address localhost:8000.

Python Version

3.7.9

📢 USEFUL INFORMATION

FIREBASE UNIQUE IDENTIFIER

subasafe-e683d

☑️ USEFUL COMMANDS

  • In order to activate the Virtual Enviroment on Windows OS use .\envs\subaSafe\Scripts\activate

  • SuperUser:

    • Username: admin,
    • Email: admin@subasafe.com,
    • Password: admin
  • All users:

    • username: <my_username>
    • email: <my_username>@subasafe.com
    • password: <my_username>
  • How to know my installed packages

    • pip freeze --local
  • Registrar un usuario vía Firebase (Google):

    1. Ingresar a la URL http://localhost:8000/login/ aplastar sobre registrar y registrar la cuenta de google
    2. Desde la consola del navegador, copiar el token otorgado por Firebase y copiarlo en la dirección http://localhost:8000/api/google-login/
    3. Ahora se ha guardado un token dentro de la base de datos.
  • Registrar un usuario dentro de la app interna:

    1. Ingresar a la URL http://127.0.0.1:8000/api/auth/register/ y proveer los datos.

    2. Ingresar al correo. Se observará algo así: Hi AlexSubaSafe Use the link below to verify your email http://127.0.0.1:8000/verificar-email/? token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9. eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjUyNjQ5NTMwLCJpYXQiOjE2NDIyODE1MzAsImp0a SI6IjNkZGJhMThkMzBhMDQ4N2ZiYzM0NGQzYTYxMTg4OTI4IiwidXNlcl9pZCI6NH0. XktbXFfCutND9AlmJKasaLoXmn4vxEEwo53ls1Uk-hY.

      Debería copiar: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9. eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjUyNjQ5NTMwLCJpYXQiOjE2NDIyODE1MzAsImp0a SI6IjNkZGJhMThkMzBhMDQ4N2ZiYzM0NGQzYTYxMTg4OTI4IiwidXNlcl9pZCI6NH0. XktbXFfCutND9AlmJKasaLoXmn4vxEEwo53ls1Uk-hY.

    3. Copie el token en la dirección ​http://127.0.0.1:8000/verificar-email​/. Si tiene un mensaje de {"STATUS": "El usuario ha sido activado"} entonces puede continuar.

  • Autenticación de Sesión con Firebase Google:

    1. Para poder hacer las operaciones CRUD, se debe enviar los datos por cabecera.

      Key: Authorization Value: Token 'token en la BD'

  • Autenticación de Sesión con un usuario interno:

    1. Ingrese en la dirección http://127.0.0.1:8000/api/auth/login/ y loguee el correo y contraseña.

    2. Para poder hacer las operaciones CRUD, se debe enviar los datos por cabecera.

      Key: Authorization Value: Bearer 'token de acceso del paso anterior'

⁉️ TROUBLESHOOTING

By: Alex Cuenca

About

SubaSafe Logic Layer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published