Metadata-Version: 2.4
Name: fastjango
Version: 0.1.1
Summary: A fastweb framework inspired by Django using FastAPI as core
Home-page: https://github.com/fastjango/fastjango
Author: Bhavik Shah
Author-email: Bhavik Shah - FastJango Team <bhavik1st@gmail.com>
License: MIT License
        
        Copyright (c) 2025 FastJango (by https://github.com/bhavik1st)
        
        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.
        
Project-URL: Documentation, https://github.com/fastjango/fastjango
Project-URL: Source, https://github.com/fastjango/fastjango
Project-URL: Tracker, https://github.com/fastjango/fastjango/issues
Keywords: fastapi,django,web framework
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi<0.101.0,>=0.100.0
Requires-Dist: uvicorn<0.24.0,>=0.23.0
Requires-Dist: jinja2<3.2.0,>=3.1.2
Requires-Dist: python-multipart<0.0.7,>=0.0.6
Requires-Dist: pydantic<3.0.0,>=2.0.0
Requires-Dist: typer<0.10.0,>=0.9.0
Requires-Dist: rich<13.5.0,>=13.4.0
Requires-Dist: sqlalchemy<2.1.0,>=2.0.19
Requires-Dist: alembic<1.12.0,>=1.11.1
Provides-Extra: dev
Requires-Dist: pytest<7.5.0,>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov<4.2.0,>=4.1.0; extra == "dev"
Requires-Dist: black<23.8.0,>=23.7.0; extra == "dev"
Requires-Dist: isort<5.13.0,>=5.12.0; extra == "dev"
Requires-Dist: flake8<6.2.0,>=6.1.0; extra == "dev"
Requires-Dist: httpx<0.25.0,>=0.24.1; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs<1.6.0,>=1.5.2; extra == "docs"
Requires-Dist: mkdocs-material<9.3.0,>=9.2.7; extra == "docs"
Requires-Dist: mkdocstrings<0.24.0,>=0.23.0; extra == "docs"
Requires-Dist: mkdocstrings-python<1.7.0,>=1.6.0; extra == "docs"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# FastJango

FastJango is a fast web framework inspired by Django built on FastAPI. 
It provides a familiar Django-like experience with the performance and modern features of FastAPI. FastJango prefers convention over configuration and simplifies development of API First Web Services.

## Features

- Django-like project structure
- FastAPI's high performance
- Type annotations and automatic validation
- Dependency injection
- Automatic API documentation with Swagger and ReDoc
- Familiar Django-like URL patterns
- FastAPI-powered REST API with automatic OpenAPI docs
- Integrated authentication system
- Django-like template system with Jinja2
- ORM support via SQLAlchemy (planned)

pip install typer rich fastapi uvicorn jinja2 python-multipart pydantic

## Installation

```bash
pip install fastjango
```

For development:

```bash
git clone https://github.com/yourusername/fastjango.git
cd fastjango
pip install -e ".[dev]"
```

## Quick Start

### Create a new project

```bash
fastjango-admin startproject myproject
cd myproject
```

### Create a new app

```bash
fastjango-admin startapp myapp
```

Don't forget to add your app to `INSTALLED_APPS` in `settings.py`:

```python
INSTALLED_APPS = [
    # FastJango apps
    "myproject.core",
    
    # Your apps
    "myapp",
]
```

### Define models in myapp/models.py

```python
from fastjango.db import models
from fastjango.core.exceptions import ValidationError


class Item(models.Model):
    name = models.CharField(max_length=100)
    description = models.TextField(blank=True, null=True)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    
    class Meta:
        ordering = ["-created_at"]
    
    def __str__(self):
        return self.name
```

### Define routes in myapp/routes.py

```python
from fastapi import APIRouter, HTTPException, Depends, status
from typing import List

from fastjango.core.dependencies import get_current_user
from .schemas import ItemCreate, ItemRead, ItemUpdate
from .services import ItemService

router = APIRouter(prefix="/items", tags=["items"])
service = ItemService()


@router.get("/", response_model=List[ItemRead])
async def list_items(skip: int = 0, limit: int = 100):
    return await service.get_all(skip=skip, limit=limit)


@router.post("/", response_model=ItemRead, status_code=status.HTTP_201_CREATED)
async def create_item(item: ItemCreate, current_user = Depends(get_current_user)):
    return await service.create(item)
```

### Run the development server

```bash
fastjango-admin runserver
```

Or using the manage.py script:

```bash
python manage.py runserver
```

Visit http://127.0.0.1:8000/docs to see the automatic API documentation.

## Project Structure

When you create a new project, FastJango will generate the following structure:

```
myproject/
├── myproject/
│   ├── __init__.py
│   ├── asgi.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── templates/
└── manage.py
```

When you create a new app, FastJango will generate:

```
myapp/
├── __init__.py
├── models.py
├── routes.py
├── schemas.py
├── services.py
└── tests/
    ├── __init__.py
    ├── test_models.py
    └── test_routes.py
```

## Built With

* [FastAPI](https://fastapi.tiangolo.com/) - Web framework
* [Pydantic](https://pydantic-docs.helpmanual.io/) - Data validation
* [Typer](https://typer.tiangolo.com/) - CLI commands
* [SQLAlchemy](https://www.sqlalchemy.org/) - ORM (planned)

## License

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

# Make sure to reinstall after changes
pip install -e .

# Then start your project
./fastjango-admin.py startproject myproject
cd myproject
./fastjango-admin.py runserver 
