- install PostgreSQL (v14.11 works perfectly)
- Python<3.10 (v3.9.19 works perfectly)
Set env variables in .env
file. You can use .env.example
as template to copy from.
cp .env.example .env
- Create python virtual environment and start it
python3 -m venv venv
source venv/bin/activate
Note: you can quit virtual environment by running deactivate
(venv)$ deactivate
- Install python dependencies
(venv)$ pip install -r requirements.txt
(venv)$ pip install -r requirements-dev.txt
- Copy local settings
(venv)$ cp deprepagos/local_settings.py.example deprepagos/local_settings.py
- Start postgresql server
brew services start postgresql #for mac
- Create db
(venv)$ createdb deprepagos_development
- Apply db updates
(venv)$ python manage.py migrate
- Create Django admin user
(venv)$ python manage.py createsuperuser # provide username, leave email empty, and set some password. You can use whoami in mac to get a username
Create a SELLER TEST USER in MercadoPago and set the following envs. Instructions here
Set the envs MERCADOPAGO_PUBLIC_KEY
, MERCADOPAGO_ACCESS_TOKEN
with the onces from the SELLER TEST USER.
Then set up a webhook
pointing to {your local env url}/webhooks/mercadopago
. And set the env MERCADOPAGO_WEBHOOK_SECRET
with the secret
you set in the webhook creation.
I recommend using a cloudflare tunnel, or ngrok, or similar to expose your local server to the internet.
Create a project in Google Cloud Platform and enable the Google+ API. Then create OAuth 2.0 credentials and set the envs
GOOGLE_CLIENT_ID
and GOOGLE_CLIENT_SECRET
with the values from the credentials.
On the OAuth consent screen, set the authorized redirect URIs to {your local env url}/accounts/google/login/callback/
For email testing use https://mailtrap.io/
- Create an account
- Get HOST, PORT, USERNAME and PASSWORD from Email Testing > Inboxes > SMTP
(venv)$ python manage.py runserver
Just push to the dev
branch and the pipeline will deploy to the dev environment.
Important
In OS X you need to use a Docker image to have the same linux environment as the one that runs in AWS Lambda to install the correct dependencies.
$ docker build . -t ticketera-zappashell
$ alias zappashell='docker run -ti -e AWS_PROFILE=default -v "$(pwd):/var/task" -v ~/.aws/:/root/.aws --rm ticketera-zappashell'
$ zappashell
zappashell> zappa update dev
Please don't push to the main
branch directly. Create a PR and merge it on dev
first. Then create a PR from dev
to main
.
TODO ongoing: The pipeline will deploy to the prod environment.
If for some horrible reason you need to push to main
directly, PLEASE, make sure to backport the changes to dev
afterwards.
3. Update the static files to S3:
$ python manage.py collectstatic --settings=deprepagos.settings_prod
We have an external Google
doc
with instructions on how to create a new Event
for the community members in
charge of communication and design.
When starting to prepare a new Event share this doc with the appropiate people.