-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment.ini
More file actions
64 lines (39 loc) · 2.15 KB
/
deployment.ini
File metadata and controls
64 lines (39 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
----------------------------------------------------------------------------------------------------------------------------------
reservaclickofficial@gmail.com is the aws account
Deployment in Amazon
Install docker from: https://docs.docker.com/engine/install/ubuntu/
git clone https://github.com/paketeserrano/appointments.git
create appointment_calendar/.env
Start app: sudo docker compose -f docker-compose.yml -f docker-compose.prod.yml up --build
Create superuser: sudo docker exec -it web-image-name bash -> python manage.py createsuperuser
----------------------------------------------------------------------------------------------------------------------------------
Mysql
mysql -u root -p password
Creating the project from scratch - Assumes that mysql is installed
python3.8 -m venv venv
source venv/bin/activate
pip install django
pip3 install mysqlclient
django-admin startproject appointment_calendar
cd appointment_calendar/
In .gitignore add .env file inside the project folder
IMPORTANT: Since this file is not in source control make sure you do not lose it
This is how to launch the app in prod or dev: sudo docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build
Uncomment AUTH_PASSWORD_VALIDATORS in the setting.py so Django doesn't allow easy passwords
Dump database:
mysqldump -u root -p appt_calendar > db.dump
Restore database:
mysql -u root -p appt_calendar < db.dump
Sending emails using google api here: https://console.developers.google.com/)
The project is 'Easy Appointments'
Interesting info about authentication using google sigin: https://developers.google.com/identity
Another interesting blog about django and connecting to social networks: https://python.plainenglish.io/django-social-authentication-login-with-google-30d82838fa33
----------- Set up project when pulling from github -------------------
python3.8 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Create a .env file inside appointments/appointment_calendar with this content:
EMAIL_HOST=smtp.gmail.com
EMAIL_HOST_USER=ADD_YOUR_EMAIL_HERE
EMAIL_HOST_PASSWORD=ADD YOUR PASSWORD_HERE
RECIPIENT_ADDRESS=ADD_RECIPIENT_ADDRESS_HERE