Centralized Online Banking With Crypto Mixture

This Django project provides a centralized online banking system with a mixture of traditional and cryptocurrency functionalities. It includes user authentication, product management, and transaction handling features.

Setup Instructions

To clone and set up the Django project, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/Alazar42/Centralized-Online-Banking-With-Crypto-Mixture.git
    
  2. Navigate to Project Directory:

    cd Centralized-Online-Banking-With-Crypto-Mixture
    
  3. Install Dependencies:

    pip install -r requirements.txt
    
  4. Run Migrations:

    python manage.py migrate
    
  5. Create Superuser (Optional):

    python manage.py createsuperuser
    
  6. Start the Development Server:

    python manage.py runserver
    
  7. Access the Application: Open a web browser and go to http://127.0.0.1:8000/ to view the application.

URLs and Views

The urlpatterns in the urls.py file define the URL routes and their corresponding views:

from django.urls import path
from . import views

urlpatterns = [
    path('', views.home),

    path('auth-register', views.user_register),
    path('auth-login', views.user_login),
    path('auth-logout', views.user_logout),

    path('products', views.products),
    path('products/<int:id>', views.each_product),
    path('products/<int:id>/buy', views.buy_product),
    # path('buy-shiling'),

    # path('transactions'),
    # path('')
]
  • /: Home page view.
  • /auth-register: User registration view.
  • /auth-login: User login view.
  • /auth-logout: User logout view.
  • /products: View to display products.
  • /products/<int:id>: View to display details of a specific product identified by its ID.
  • /products/<int:id>/buy: View to handle product purchase.

The commented-out routes are placeholders for future functionality and will be updated accordingly.

CORS Configuration (For Frontend Development)

If you are developing any frontend and need to communicate with this backend, you will need to enable CORS (Cross-Origin Resource Sharing) in the Django settings.

Add the following code to your settings.py file:

CORS_ORIGIN_ALLOW_ALL = True

# If you want to whitelist specific frontend app URLs, uncomment the following line and add your frontend app URL(s) to the list:
# CORS_ORIGIN_WHITELIST = [
#     'add your frontend app URL here'
# ]

This will allow requests from all origins during development. Ensure to configure CORS properly in production for security reasons.

Contribution Guidelines

If you would like to contribute to this project, please follow these guidelines:

  • Fork the repository.
  • Create your feature branch (git checkout -b feature/your-feature).
  • Commit your changes (git commit -am 'Add some feature').
  • Push to the branch (git push origin feature/your-feature).

License

This project is licensed under the MIT License - see the LICENSE file for details.

Built With

Share this project:

Updates