Skip to content

Commit

Permalink
production changes
Browse files Browse the repository at this point in the history
  • Loading branch information
skfile committed Aug 30, 2020
1 parent ee983e1 commit 95f74dc
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 25 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ RUN pip install -r requirements.txt
# # For more information, please refer to https://aka.ms/vscode-docker-python
# FROM python:3.8-slim-buster

# EXPOSE 8000
EXPOSE 80
EXPOSE 443

# # Keeps Python from generating .pyc files in the container
# ENV PYTHONDONTWRITEBYTECODE 1
Expand All @@ -18,12 +19,12 @@ RUN pip install -r requirements.txt
# ADD requirements.txt .
# RUN python -m pip install -r requirements.txt

# WORKDIR /app
# ADD . /app
WORKDIR /app
ADD . /app

# # Switching to a non-root user, please refer to https://aka.ms/vscode-docker-python-user-rights
# RUN useradd appuser && chown -R appuser /app
# USER appuser

# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "SellersInn.wsgi"]
CMD ["gunicorn", "--bind", "0.0.0.0", "SellersInn.wsgi"]
Binary file modified SellersInn/__pycache__/settings.cpython-37.pyc
Binary file not shown.
Binary file modified SellersInn/__pycache__/settings.cpython-38.pyc
Binary file not shown.
8 changes: 7 additions & 1 deletion SellersInn/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
'django.contrib.staticfiles',
'django.contrib.postgres',

'main'
'main',

'google_analytics'
]

MIDDLEWARE = [
Expand Down Expand Up @@ -143,3 +145,7 @@
# )

# STATIC_ROOT = os.path.join(BASE_DIR, 'static')

GOOGLE_ANALYTICS = {
'google_analytics_id': 'UA-93164009-3',
}
5 changes: 3 additions & 2 deletions SellersInn/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.urls import path, include, re_path

urlpatterns = [
path('admin/', admin.site.urls),
path('', include('main.urls'))
path('', include('main.urls')),
re_path('djga/', include('google_analytics.urls')),
]
Binary file modified db.sqlite3
Binary file not shown.
26 changes: 26 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: "3.4"

# services:
# sellersinn:
# image: sellersinn
# build:
# context: .
# dockerfile: Dockerfile
# ports:
# - 8000

services:
###
# services
###
django:
build: .
command: python manage.py runserver 0.0.0.0:3001
volumes:
- .:/app
ports:
- "3001:3001"
tty: true
stdin_open: true
dns:
- 8.8.8.8
20 changes: 6 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
version: "3.4"

# services:
# sellersinn:
# image: sellersinn
# build:
# context: .
# dockerfile: Dockerfile
# ports:
# - 8000

services:
###
# services
###
django:
build: .
command: python manage.py runserver 0.0.0.0:3001
command: bash -c "python manage.py runserver 0.0.0.0:80 && python manage.py runserver 0.0.0.0:443"
volumes:
- .:/app
ports:
- "3001:3001"
- "80:80"
- "443:443"
tty: true
stdin_open: true
dns:
- 8.8.8.8
expose:
- 80
- 443
Binary file modified main/__pycache__/admin.cpython-37.pyc
Binary file not shown.
Binary file modified main/__pycache__/forms.cpython-37.pyc
Binary file not shown.
Binary file modified main/__pycache__/models.cpython-37.pyc
Binary file not shown.
Binary file modified main/__pycache__/urls.cpython-37.pyc
Binary file not shown.
Binary file modified main/__pycache__/views.cpython-37.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 8 additions & 2 deletions main/templates/main/Main.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Sellers Inn</title>
<meta name="description" content="Sellers Inn - A Reviews Analyzer Application">
<meta name="description" content="Sellers Inn is a Reviews Analyzer Service that helps sellers understand what their customers are thinking and make smarter, more effective decisions about their products.">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1" />
<meta name="Keywords" content="eCommerce, Analytics, Sellers, Amazon, EBay, Walmart, Graphs, Data, Machine Learning, Artifical Intelligence, AI, Sentiment Analysis, Products, Customers, Plotly, Natural Language Processing">
<link rel="icon" href="{% static "images\favicon.png" %}" type="image/x-icon">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
Expand Down Expand Up @@ -92,12 +94,16 @@
</div>
</nav>


{% block content %}


{% endblock content %}


{% load google_analytics_tags %}
<div style="display:none">
<img src="{% google_analytics %}" width="0" height="0" />
</div>

<footer class="text-center">
<div class="container">
Expand Down
2 changes: 1 addition & 1 deletion main/templates/main/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h2>Request a Product Analysis</h2>
required="required">
</div>
<div class="form-group">
<input type="text" class="form-control" name="Zip_Code" placeholder="Zip Code" required="required">
<input type="text" class="form-control" name="Zip_Code" placeholder="Zip Code">
</div>
<div class="form-group">
<label class="form-check-label"><input type="checkbox" required="required"> I accept the <a
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ urllib3==1.25.3
w3lib==1.21.0
numpy==1.18.5
pandas==1.1.0
psycopg2==2.8.5
psycopg2==2.8.5
django-google-analytics-app==4.4.2
Binary file added static/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 95f74dc

Please sign in to comment.