Coder Social home page Coder Social logo

louisreed / ac-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9.48 MB

This project is a Django REST API that provides endpoints for viewing and editing user, group, error log, update check, and firmware data. It includes viewsets for each of these models, which handle standard CRUD (create, read, update, delete) operations through various HTTP methods.

Python 100.00%

ac-api's Introduction

Altered Carbon API

This project is a Django REST API that provides endpoints for viewing and editing user, group, error log, update check, and firmware data. It includes viewsets for each of these models, which handle standard CRUD (create, read, update, delete) operations through various HTTP methods. The serializers define how the model instances are converted to JSON format for use in the API.

This project could be used as a backend for a variety of web or mobile applications that need to store and retrieve data related to users, groups, and firmware. By providing an API, developers can easily communicate with the backend without needing to worry about database management or low-level networking code. Additionally, this project uses Django's built-in authentication and permission classes to ensure that only authorized users can access the API, which improves security. Overall, this project provides a robust backend for managing and storing data in a secure and standardized way.

Prerequisites

Before you begin, make sure you have the following installed:

  • Python (3.10.0)
  • pip (package installer for Python)
  • PostgreSQL (optional, if using PostgreSQL as the database)

Installation

  1. Clone the repository:
git clone https://github.com/your-username/project-name.git
  1. Change into the project directory:
cd project-name
  1. Create a virtual environment:
python -m venv env
  1. Activate the virtual environment:
  • For Windows:

    .\env\Scripts\activate
    
  • For macOS/Linux:

    source env/bin/activate
    
  1. Install the project dependencies:
pip install -r requirements.txt
  1. Run database migrations:
python manage.py migrate

Configuration

Before running the project, you need to configure the necessary settings.

  1. Create a new file named .env in the project root directory.

  2. Open the .env file and set the following environment variables:

SECRET_KEY=your-secret-key
DEBUG=True
DATABASE_URL=your-database-url

Make sure to replace your-secret-key and your-database-url with your actual values. Refer to the Environment Variables section for more information.

Save and close the .env file.

Usage

To start the development server, run the following command:

python manage.py runserver

The project will be accessible at http://localhost:8000.

Environment Variables (Optional)

The following environment variables are used in the project:

SECRET_KEY: A secret key used for cryptographic signing. It should be a long and randomly generated string.
DEBUG: Set to True to enable debugging mode. In production, set it to False.
DATABASE_URL: The URL or connection string for your database. For example, for PostgreSQL: postgres://username:password@localhost/database.

You may need to add additional environment variables depending on the project's requirements.

License

MIT License

ac-api's People

Contributors

louisreed avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.