Skip to content

Commit f42c706

Browse files
authored
Merge pull request #38 from sneh-create/main
Containerization of App
2 parents 8d77f5c + 59a86a9 commit f42c706

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#base image
2+
3+
From python:3.13.0
4+
5+
#working directory
6+
7+
WORKDIR /app
8+
9+
#copy code
10+
11+
COPY . .
12+
13+
#requirement libraries
14+
15+
RUN pip install -r requirements.txt
16+
17+
#run libraries
18+
19+
#RUN python3 manage.py runserver
20+
21+
#cmd
22+
23+
CMD ["python3","manage.py","runserver","0.0.0.0:8000"]

Weather-Application-Django/Weather/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# SECURITY WARNING: don't run with debug turned on in production!
3232
DEBUG = True
3333

34-
ALLOWED_HOSTS = []
34+
ALLOWED_HOSTS = ["*"]
3535

3636

3737
# Application definition

Weather-Application-Django/mainapp/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def index(request):
1212
BASE_URL ='http://api.weatherapi.com/v1'
1313

1414
# 2. After generating your API key, copy it and then paste it into the "API_KEY" variable as given below:
15-
API_KEY = 'paste-your-api-key' # ***************
15+
API_KEY = '' # ***************
1616

1717
if request.method=='POST':
1818
city=request.POST.get('city').lower()
@@ -63,4 +63,4 @@ def index(request):
6363
return render(request,'index.html',{'static_city':city,'checker':'Please enter valid city'})
6464

6565

66-
return render(request,'index.html',{})
66+
return render(request,'index.html',{})

0 commit comments

Comments
 (0)