Skip to content

sd816224/bcbc

Repository files navigation

Feature:

  • users registration can be done by:
    • google account
    • email and confirmd by email link
    • user namd and password
  • profile for each user
  • blog > can be published by own/users
  • event > can be published by own/users
  • shop > display only now
  • users can RSVP/cancel the attending to the event

further dev:

  • build CICD pipeline for ease of future development
    • find a better way to pass env variables rather than manually
  • taking paymeng function for shop
  • upgrade css/looking
  • let user to comment below the blog
  • periodiclly auto backup database.

bcbc v1 was deployed by aws EC2 manually previously

bcbc v2 current version is deployed by aws EC2 elatstic beanstalk, independent RDS of postgres database and s3 bucket storing static/media file.

For v2, initial deploement as below for record, in case for rebuild in the future:

Takeaways:

divide static/media/DB

  • static: less change image/css/js files.

  • media: user upload ones.

  • STATIC_URL/MEDIA_URL: the paths the django gonne scan for collection

  • STATICFILES_DIRS: after scanning everywhere, looking this path for the extra static files

  • STATIC_ROOT/MEDIA_ROOT: destination path where to put the collections for serving the web.

  • to backup the database: python manage.py dumpdata> > backup.json

  • to load the data: python manage.py loaddata backup.json

  • even for a empty db without superuser. it can all be moved to.but need to remember to migrate before moving.

  • to reset db: python manage.py dbshell> : DROP SCHEMA public CASCADE;CREATE SCHEMA public;

  • django_site table: site_id is created whenever creating a new site

  • socialaccount_socialapp_sites is the cross table connect the django_site. site_id to the social_site_id

  • for init db without any data input. table would not created for the render. so we need to run following command after the init migrate. to avoid the bug: python migrate --run-syncdb

For further management of eb:

  • always work with use_s3 off. rds off for dev stage

  • before deploy

    • dumpdata to backup prod database
    • check static file, delete waste ones
    • pip freeze
  • be careful social application credential is shared when dump/load the data, can apply the partial dump/load to avoid it

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published