Skip to content

Commit ecf4346

Browse files
Phase 8: Add Configuration section to docs and allow env-based DB URL
1 parent daab39f commit ecf4346

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,29 @@ Manage your entire project from one place:
3737

3838
---
3939

40+
## ⚙️ Configuration
41+
42+
Your project settings are managed via the `.env` file in your root directory.
43+
44+
### Database Connection
45+
By default, `pythoncms` uses SQLite. To use a different database, update the `SQLALCHEMY_DATABASE_URI`:
46+
47+
```bash
48+
# SQLite (default)
49+
SQLALCHEMY_DATABASE_URI = "sqlite:///mysite.db"
50+
51+
# PostgreSQL
52+
SQLALCHEMY_DATABASE_URI = "postgresql://user:password@localhost/dbname"
53+
```
54+
55+
### Other Settings
56+
- `APP_NAME`: Change the display name of your application.
57+
- `SECRET_KEY`: Used for session encryption. Automatically generated on `start`.
58+
- `ACTIVE_FRONT_THEME`: Choose between `editorial` or `hyperspace`.
59+
- `ACTIVE_BACK_THEME`: Choose between `sneat` or `sbadmin`.
60+
61+
---
62+
4063
## ✨ Features
4164

4265
- 🏗️ **Content Types:** Define custom schemas with JSON.

pythoncms/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ class DevelopmentConfig(BaseConfig):
7777
MAIL_DEFAULT_SENDER = "ma@mail.com"
7878

7979
# database configs
80-
SQLALCHEMY_DATABASE_URI = "sqlite:///shopyo.db"
80+
SQLALCHEMY_DATABASE_URI = (
81+
os.environ.get("SQLALCHEMY_DATABASE_URI") or "sqlite:///shopyo.db"
82+
)
8183

8284
# unknown configs
8385
PASSWORD_SALT = "some pasword salt"

0 commit comments

Comments
 (0)