Skip to content

Commit 54ffc15

Browse files
committed
Merge branch 'deploy-django' of https://github.com/croolicjah/zappycode-django into croolicjah-deploy-django
2 parents 6770980 + 9f15dc3 commit 54ffc15

File tree

8 files changed

+127
-0
lines changed

8 files changed

+127
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
{% extends "sitewide/base.html" %}
2+
{% load static %}
3+
4+
{% block content %}
5+
<style>
6+
.rotation {
7+
animation: spin 2s infinite linear;
8+
}
9+
@keyframes spin {
10+
from {
11+
transform: rotate(0deg);
12+
}
13+
to {
14+
transform: rotate(359deg);
15+
}
16+
}
17+
18+
.github {
19+
animation: spin3D 2s infinite linear;
20+
}
21+
@keyframes spin3D {
22+
from {
23+
transform: rotateY(0deg);
24+
}
25+
to {
26+
transform: rotateY(359deg);
27+
}
28+
}
29+
</style>
30+
31+
<div class="row bg-white justify-content-center">
32+
<div class="container">
33+
<div class="row justify-content-between">
34+
<div class="col-md-8 text-center">
35+
<div class="text-left display-2 d-none d-lg-block">How to deploy a&nbsp;Django project</div>
36+
<div class="text-left display-4 d-lg-none">How to deploy a&nbsp;Django project</div>
37+
<div class="text-left">
38+
<p >All guides assume that you keep your project on any VCS. We are using Github. How to prepare the code and push it to Github you find <a href="#">here</a>.</p>
39+
<p>Choose below where you want to deploy your project. Linux guide assumes that you have got access to Ubuntu server.</p>
40+
</div>
41+
<div class="">
42+
<a href="https://www.zappycode.com/posts/20/deploy-django-project-on-pythonanywhere" class="mb-3 w-75 btn btn-outline-primary">
43+
<img class="w-75" src="{% static 'sitewide/python.png' %}" alt="deploy on pythonanywhere">
44+
</a>
45+
46+
<a href="https://www.zappycode.com/posts/19/deploy-django-project-on-heroku" class="mb-3 w-75 btn btn-outline-success ">
47+
<img class="w-75" src="{% static 'sitewide/heroku.png' %}" alt="deploy on heroku" >
48+
</a>
49+
<a href="https://www.zappycode.com/posts/21/deploying-django-project-on-linux-server-ubuntu-gunicorn-nginx-supervisor-ufw" class="mb-3 w-75 btn btn-outline-warning">
50+
<img class="w-50" src="{% static 'sitewide/linux.png' %}" alt="deploy on linux server" >
51+
</a>
52+
</div>
53+
</div>
54+
<div class="row col-md-4 ml-auto mr-auto mt-3">
55+
<div class="col-6 col-md-12">
56+
<a href="https://www.zappycode.com/posts/1/django-cheat-sheet" class="">
57+
<img class="w-100" id="django" src="{% static 'sitewide/djangoCheetSheetbutton.png' %}" alt="django chaetsheet">
58+
</a>
59+
</div>
60+
<div class="col-6 col-md-12">
61+
<a href="https://www.zappycode.com/posts/22/preparing-project-to-deploy-and-pushing-it-to-github" class="btn btn-outline-info shadow rounded-circle" >
62+
<img id="github" class="w-100" src="{% static 'sitewide/github_napisy.png' %}" alt="how to push code to github">
63+
</a>
64+
</div>
65+
</div>
66+
</div>
67+
</div>
68+
</div>
69+
<! -- links to Django courses -->
70+
<div class="row bg-dark ">
71+
<div class="container">
72+
<div class="row justify-content-center pt-3 ">
73+
{% for course in courses %}
74+
<div class="col-md-6 col-lg-4">
75+
<a href="{% url 'course_landing_page' course.slug %}">
76+
<div class="card mb-4 shadow-sm mr-0">
77+
<img alt="" src="{{ course.image.url}}" class="card-img-top img-fluid" width="150" height="225">
78+
<div class="card-body">
79+
<h5 class="card-title">{{ course.title }}</h5>
80+
<p class="card-text">{{ course.subtitle }}</p>
81+
</div>
82+
</div>
83+
</a>
84+
</div>
85+
{% endfor %}
86+
</div>
87+
</div>
88+
</div>
89+
{% endblock %}
90+
91+
{% block javascript %}
92+
<script>
93+
$("#django").hover(
94+
function() {
95+
$(this).addClass("rotation");
96+
},
97+
function() {
98+
$(this).removeClass("rotation");
99+
}
100+
);
101+
102+
$("#github").hover(
103+
function() {
104+
$(this).addClass("github");
105+
},
106+
function() {
107+
$(this).removeClass("github");
108+
}
109+
);
110+
</script>
111+
{% endblock %}
112+
113+
114+
115+
116+
117+
118+
119+
120+
121+

courses/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ def view_lecture(request, course_slug, lecturepk, lecture_slug):
5050
})
5151

5252

53+
def deploy_django(request):
54+
courses = Course.objects.filter(title__icontains="django").order_by("-release_date")
55+
return render(request, 'courses/deploy.html', {'courses': courses})
56+
57+
5358
def course_landing_page(request, course_slug):
5459
videos_number = 0
5560
course = get_object_or_404(Course, slug=course_slug)
152 KB
Loading
242 KB
Loading
42.2 KB
Loading

sitewide/static/sitewide/linux.png

217 KB
Loading
19.2 KB
Loading

zappycode/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
path('paypal_validation', sitewide.views.paypal_validation, name='paypal_validation'),
4141
path('discourse/sso', chit_chat.views.discourse_sso, name='discourse_sso'),
4242
path('tinymce/', include('tinymce.urls')),
43+
path('deploy', courses.views.deploy_django, name='django'),
4344

4445
path("robots.txt", TemplateView.as_view(template_name="sitewide/robots.txt", content_type="text/plain")),
4546
path("sitemap.xml", sitemap, {"sitemaps": sitemaps}, name="django.contrib.sitemaps.views.sitemap"),

0 commit comments

Comments
 (0)