Skip to content
Snippets Groups Projects
Unverified Commit 00947abe authored by Kenneth Reitz's avatar Kenneth Reitz Committed by GitHub
Browse files

collectstatic metrics (#660)

parent d0c98aa5
No related branches found
No related tags found
No related merge requests found
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<div class="container">
<h2>Page View Report</h2>
<ul>
{% for greeting in greetings %}
<li>{{ greeting.when }}</li>
{% endfor %}
</ul>
</div>
{% endblock %}
\ No newline at end of file
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<div class="jumbotron text-center">
<div class="container">
<a href="/" class="lang-logo">
<img src="{% static 'lang-logo.png'%}">
</a>
<h1>Getting Started with Python on Heroku</h1>
<p>This is a sample Python application deployed to Heroku. It's a reasonably simple app - but a good foundation for understanding how to get the most out of the Heroku platform.</p>
<a type="button" class="btn btn-lg btn-default" href="https://devcenter.heroku.com/articles/getting-started-with-python"><span class="glyphicon glyphicon-flash"></span> Getting Started with Python</a>
<a type="button" class="btn btn-lg btn-primary" href="https://github.com/heroku/python-getting-started"><span class="glyphicon glyphicon-download"></span> Source on GitHub</a>
</div>
</div>
<div class="container">
<div class="alert alert-info text-center" role="alert">
To deploy your own copy, and learn the fundamentals of the Heroku platform, head over to the <a href="https://devcenter.heroku.com/articles/getting-started-with-python" class="alert-link">Getting Started with Python on Heroku</a> tutorial.
</div>
<hr>
<div class="row">
<div class="col-md-6">
<h3><span class="glyphicon glyphicon-info-sign"></span> How this sample app works</h3>
<ul>
<li>This app was deployed to Heroku, either using Git or by using <a href="https://github.com/heroku/python-getting-started">Heroku Button</a> on the repository.</li>
<li>When Heroku received the source code, it fetched all the dependencies in the <a href="https://github.com/heroku/python-getting-started/blob/master/Pipfile">Pipfile</a>, creating a deployable slug.</li>
<li>The platform then spins up a dyno, a lightweight container that provides an isolated environment in which the slug can be mounted and executed.</li>
<li>You can scale your app, manage it, and deploy over <a href="https://addons.heroku.com/">150 add-on services</a>, from the Dashboard or CLI.</li>
</ul>
</div>
<div class="col-md-6">
<h3><span class="glyphicon glyphicon-link"></span> Next Steps</h3>
<ul>
<li>If you are following the <a href="https://devcenter.heroku.com/articles/getting-started-with-python">Getting Started</a> guide, then please head back to the tutorial and follow the next steps!</li>
<li>If you deployed this app by deploying the Heroku Button, then in a command line shell, run:</li>
<ul>
<li><code>git clone https://github.com/heroku/python-getting-started.git</code> - this will create a local copy of the source code for the app</li>
<li><code>cd python-getting-started</code> - change directory into the local source code repository</li>
<li><code>heroku git:remote -a &lt;your-app-name></code> - associate the Heroku app with the repository</li>
<li>You'll now be set up to run the app locally, or <a href="https://devcenter.heroku.com/articles/getting-started-with-python#push-local-changes">deploy changes</a> to Heroku</li>
</ul>
</ul>
<h3><span class="glyphicon glyphicon-link"></span> Helpful Links</h3>
<ul>
<li><a href="https://www.heroku.com/home">Heroku</a></li>
<li><a href="https://devcenter.heroku.com/">Heroku Dev Center</a></li>
<li><a href="https://devcenter.heroku.com/articles/getting-started-with-python">Getting Started with Python on Heroku</a></li>
<li><a href="https://devcenter.heroku.com/articles/django-app-configuration">Configuring Django Apps for Heroku</a></li>
</ul>
</div>
</div> <!-- row -->
<div class="alert alert-info text-center" role="alert">
Please do work through the Getting Started guide, even if you do know how to build such an application. The guide covers the basics of working with Heroku, and will familiarize you with all the concepts you need in order to build and deploy your own apps.
</div>
</div>
{% endblock %}
from django.contrib.auth.models import AnonymousUser, User
from django.test import TestCase, RequestFactory
from .views import index
class SimpleTest(TestCase):
def setUp(self):
# Every test needs access to the request factory.
self.factory = RequestFactory()
def test_details(self):
# Create an instance of a GET request.
request = self.factory.get('/')
request.user = AnonymousUser()
# Test my_view() as if it were deployed at /customer/details
response = index(request)
self.assertEqual(response.status_code, 200)
\ No newline at end of file
from django.shortcuts import render
from django.http import HttpResponse
from .models import Greeting
# Create your views here.
def index(request):
# return HttpResponse('Hello from Python!')
return render(request, 'index.html')
def db(request):
greeting = Greeting()
greeting.save()
greetings = Greeting.objects.all()
return render(request, 'db.html', {'greetings': greetings})
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gettingstarted.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
...@@ -27,6 +27,11 @@ testNoRequirements() { ...@@ -27,6 +27,11 @@ testNoRequirements() {
assertCapturedError assertCapturedError
} }
testCollectstatic() {
compile "collectstatic"
assertCaptured "collectstatic"
}
testGEOS() { testGEOS() {
BUILD_WITH_GEO_LIBRARIES=1 compile "geos" BUILD_WITH_GEO_LIBRARIES=1 compile "geos"
assertCaptured "geos" assertCaptured "geos"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment