FAQ
Frequently asked questions
Frequently Asked Questions¶
How do I create an admin user?¶
For local development, use the custom management command:
uv run python manage.py create_dev_superuser
This creates a user with credentials from your .env file (DEV_SUPERUSER_USERNAME and DEV_SUPERUSER_PASSWORD).
For manual creation:
uv run python manage.py createsuperuser
How do I change the primary color?¶
Edit static/css/theme.css and update the --primary variable:
:root {
--primary: #your-color;
--primary-hover: #darker-variant;
}
Don't forget to update the dark mode version too in [data-theme="dark"].
How do I add a new page to the sidebar?¶
Edit templates/admin_theme/includes/sidebar.html:
<li class="nav-item">
<a href="{% url 'your_url_name' %}" class="nav-link {% nav_active 'your_url_name' %}">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor">
<!-- Your icon SVG path -->
</svg>
<span>Your Page</span>
</a>
</li>
How do I reset my password?¶
Click "Forgot your password?" on the login page. If email is configured, you'll receive a reset link.
For local development without email, use the admin panel or:
uv run python manage.py changepassword username
How do I upload a profile photo?¶
- Log in to your account
- Click your username in the top right
- Select "Profile" from the dropdown
- Click "Edit Profile"
- Upload your photo in the Profile Photo section
Photos must be JPG, PNG, GIF, or WebP format, max 5MB.
Why isn't dark mode saving?¶
Dark mode preference is stored in browser localStorage. Make sure:
- You're not in private/incognito mode
- JavaScript is enabled
- localStorage isn't being cleared
To manually set the theme:
localStorage.setItem('smallstack-theme', 'dark');
location.reload();
How do I run tests?¶
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov
# Run specific app tests
uv run pytest apps/profile/
How do I deploy to production?¶
We recommend Docker for simple deployments. See the Docker Deployment guide.
For production, remember to:
- Set
DEBUG=False - Use a strong
SECRET_KEY - Configure
ALLOWED_HOSTS - Set up a proper database (PostgreSQL recommended)
- Configure email for password resets
- Use HTTPS
How do I add a new Django app?¶
-
Create the app directory in
apps/:bash mkdir apps/myfeature -
Add the standard Django app files
-
Register in
config/settings/base.py:python INSTALLED_APPS = [ ... "apps.myfeature", ] -
Add URL routing in
config/urls.py -
Run migrations
See Project Structure for details.
How do I customize the User model?¶
The custom User model is in apps/accounts/models.py. It already extends AbstractBaseUser for maximum flexibility.
To add fields:
- Add the field to the
Userclass - Create a migration:
python manage.py makemigrations - Run migration:
python manage.py migrate
Where are uploaded files stored?¶
By default, uploaded files go to the media/ directory. This is configured in settings:
MEDIA_URL = "/media/"
MEDIA_ROOT = config("MEDIA_ROOT", default=str(BASE_DIR / "media"))
In Docker, media files are stored in the media_data volume for persistence.
How do I add a new help page?¶
See Using the Help System for complete instructions. Quick steps:
- Create a
.mdfile inapps/help/content/ - Add the page to
_config.yaml - Restart the server
Can I use a different database?¶
Yes! The project uses SQLite by default for simplicity, but you can switch to PostgreSQL or MySQL.
For PostgreSQL:
- Install the driver:
uv add psycopg2-binary - Update settings:
python DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql", "NAME": "your_db", "USER": "your_user", "PASSWORD": "your_password", "HOST": "localhost", "PORT": "5432", } } - Run migrations
How do I contribute?¶
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request
Please follow the existing code style and include tests for new features.