-
-
Notifications
You must be signed in to change notification settings - Fork 177
docs: improve setup instructions, add .env.sample and basic test #1051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,71 @@ | ||
| DEBUG=False | ||
| # Core Django settings | ||
| # Use "development" for local work. Production/staging deployments should override this. | ||
| ENVIRONMENT=development | ||
| SECRET_KEY=your-secret-key-here | ||
| DATABASE_URL=sqlite:///db.sqlite3 | ||
| EMAIL_FROM=admin@example.com | ||
| SENDGRID_API_KEY=your-sendgrid-api-key | ||
| SENDGRID_PASSWORD=your-sendgrid-password | ||
| SLACK_WEBHOOK_URL=your-slack-webhook-url | ||
|
|
||
| # Replace this in shared or deployed environments. | ||
| SECRET_KEY=django-insecure-change-me | ||
|
|
||
| # Must be a valid Fernet key. Generate one with: python web/master_key.py | ||
| MESSAGE_ENCRYPTION_KEY=5ezrkqK2lhifqBRt9f8_dZhFQF_f5ipSQDV8Vzv9Dek= | ||
| # Generate a key by running: python web/master_key.py | ||
|
|
||
| # Stripe Configuration | ||
| STRIPE_PUBLISHABLE_KEY=your-stripe-publishable-key | ||
| STRIPE_SECRET_KEY=your-stripe-secret-key | ||
| STRIPE_WEBHOOK_SECRET=your-stripe-webhook-secret | ||
| DJANGO_DEBUG=True | ||
| # Comma-separated hostnames/origins used by Django security checks. | ||
| ALLOWED_HOSTS=127.0.0.1,localhost | ||
| CSRF_TRUSTED_ORIGINS=http://127.0.0.1:8000,http://localhost:8000 | ||
|
|
||
| # Admin Configuration | ||
| # The admin is mounted at /en/<ADMIN_URL>/. | ||
| ADMIN_URL=a-dmin-url123 | ||
|
|
||
| # Google Cloud Storage Configuration | ||
| GS_BUCKET_NAME=your-bucket-name | ||
| GS_PROJECT_ID=your-project-id | ||
| SERVICE_ACCOUNT_FILE=your-service-account-file-path | ||
|
|
||
| #Twitter Configuration | ||
| TWITTER_API_KEY=your_api_key_here | ||
| TWITTER_API_SECRET_KEY=your_api_secret_here | ||
| TWITTER_ACCESS_TOKEN=your_access_token_here | ||
| TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret_here | ||
|
|
||
| #Deployment Configuration | ||
| APP_PORT=8000 | ||
| DOMAIN_NAME=yourdomain.com | ||
| ENABLE_HTTPS_REDIRECT=True | ||
| PROJECT_NAME=education-website | ||
| PYTHON_VERSION=3.11 | ||
| VPS_IP=your-vps-ip | ||
| VPS_PASSWORD=your-vps-password | ||
| VPS_USER=root | ||
| DB_NAME=education_website | ||
| DB_USER=root | ||
| DB_PASSWORD=your_secure_database_password | ||
| GIT_REPO=your_git_repo_to_deploy | ||
| GIT_BRANCH=your_repo_branch | ||
| ALLOWED_HOSTS=example.com,www.example.com,127.0.0.1,localhost | ||
| CSRF_TRUSTED_ORIGINS=http://domain.com | ||
| # Local services | ||
| # Keep the SQLite value for the simplest local setup. | ||
| DATABASE_URL=sqlite:///db.sqlite3 | ||
| REDIS_URL=redis://127.0.0.1:6379/0 | ||
| MEDIA_ROOT=media | ||
| CACHE_MIDDLEWARE_SECONDS=300 | ||
| CACHE_MIDDLEWARE_KEY_PREFIX=aol | ||
| CSRF_COOKIE_SECURE=False | ||
| SESSION_COOKIE_SECURE=False | ||
|
|
||
| # Email and notifications | ||
| EMAIL_FROM=noreply@example.com | ||
| SLACK_WEBHOOK_URL= | ||
| EMAIL_SLACK_WEBHOOK= | ||
| MAILGUN_SENDING_KEY= | ||
| MAILGUN_DOMAIN= | ||
|
|
||
| # Legacy system status check; only needed if you still use SendGrid. | ||
| SENDGRID_PASSWORD= | ||
|
|
||
| # Billing | ||
| STRIPE_PUBLISHABLE_KEY= | ||
| STRIPE_SECRET_KEY= | ||
| STRIPE_WEBHOOK_SECRET= | ||
|
|
||
| # Monitoring | ||
| SENTRY_DSN= | ||
| SENTRY_LOG_LEVEL=INFO | ||
| SENTRY_TRACES_SAMPLE_RATE=0.0 | ||
|
|
||
| # Content and social integrations | ||
| MAILCHIMP_API_KEY= | ||
| MAILCHIMP_LIST_ID= | ||
| INSTAGRAM_ACCESS_TOKEN= | ||
| FACEBOOK_ACCESS_TOKEN= | ||
| TWITTER_USERNAME=alphaonelabs | ||
| TWITTER_API_KEY= | ||
| TWITTER_API_SECRET_KEY= | ||
| TWITTER_ACCESS_TOKEN= | ||
| TWITTER_ACCESS_TOKEN_SECRET= | ||
| YOUTUBE_API_KEY= | ||
| YOUTUBE_CHANNEL_ID= | ||
|
|
||
| # GitHub integrations | ||
| GITHUB_ACCESS_TOKEN= | ||
| GITHUB_TOKEN= | ||
| GITHUB_REPO=AlphaOneLabs/education-website | ||
| GITHUB_WEBHOOK_SECRET= | ||
|
|
||
| # Google Cloud Storage | ||
| # Leave these blank unless you are testing cloud media storage. | ||
| GS_BUCKET_NAME= | ||
| GS_PROJECT_ID= | ||
| SERVICE_ACCOUNT_FILE=google_credentials.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,10 +127,11 @@ setup_steps: | |
| name: "Run Development Server" | ||
| description: "Start the Django development server" | ||
| commands: | ||
| - "python manage.py runserver" | ||
| - "poetry run uvicorn web.asgi:application --host 127.0.0.1 --port 8000 --reload" | ||
| notes: | ||
| - "Server runs at http://localhost:8000" | ||
| - "Admin panel available at http://localhost:8000/admin" | ||
| - "Server runs at http://127.0.0.1:8000/en/" | ||
| - "Use Uvicorn for local WebSocket support" | ||
| - "Admin panel path is controlled by ADMIN_URL in .env" | ||
|
Comment on lines
127
to
+134
|
||
| - "Press Ctrl+C to stop the server" | ||
|
|
||
| docker_setup: | ||
|
|
@@ -211,7 +212,7 @@ tech_stack: | |
| - "Nginx" | ||
| - "Uvicorn (ASGI)" | ||
| - "Django Channels (WebSockets)" | ||
| - "SendGrid for emails" | ||
| - "Mailgun with Slack notification fallback" | ||
| - "Stripe for payments" | ||
|
|
||
| important_notes: | ||
|
|
@@ -225,7 +226,7 @@ important_notes: | |
|
|
||
| useful_commands: | ||
| development: | ||
| run_server: "python manage.py runserver" | ||
| run_server: "poetry run uvicorn web.asgi:application --host 127.0.0.1 --port 8000 --reload" | ||
| make_migrations: "python manage.py makemigrations" | ||
| migrate: "python manage.py migrate" | ||
| create_superuser: "python manage.py createsuperuser" | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.env.samplecurrently ships a concreteMESSAGE_ENCRYPTION_KEYvalue. Because this key protects encrypted messaging data, providing a real (valid) key in-repo increases the risk that someone deploys with the sample key unchanged. Safer pattern is to leave it blank (or set an obvious placeholder) and document generating a per-environment key (settings.py already has a default generator).