for loop with range in template
In my template I want to iterate through multiple lists at the same time, so to me it makes sense to use a range. So for example, I want to do something like:
{{a.0.data}} {{b.0.data}} {{c.0.data}}
on the first loop, and on the second loop:
{{a.1.data}} {{b.1.data}} {{c.1.data}}
a,b,c are lists and the 0's are indexes that iterate.
In my views.py I added
{"range": range(10) to the context.}
Now if I do
{% for i in range %}
<p>{{i}}</p>
{% endfor %}
It works fine, but If I try something like:
{% for i in range %}
{{a.i.data}} {{b.i.data}} {{c.i.data}}
{% endfor %}
to try to iterate through the indexes It doesn't seem to work. Is there a proper way to go about this?
edit: formatting
/r/djangolearning
https://redd.it/7d1b04
In my template I want to iterate through multiple lists at the same time, so to me it makes sense to use a range. So for example, I want to do something like:
{{a.0.data}} {{b.0.data}} {{c.0.data}}
on the first loop, and on the second loop:
{{a.1.data}} {{b.1.data}} {{c.1.data}}
a,b,c are lists and the 0's are indexes that iterate.
In my views.py I added
{"range": range(10) to the context.}
Now if I do
{% for i in range %}
<p>{{i}}</p>
{% endfor %}
It works fine, but If I try something like:
{% for i in range %}
{{a.i.data}} {{b.i.data}} {{c.i.data}}
{% endfor %}
to try to iterate through the indexes It doesn't seem to work. Is there a proper way to go about this?
edit: formatting
/r/djangolearning
https://redd.it/7d1b04
reddit
for loop with range in template • r/djangolearning
In my template I want to iterate through multiple lists at the same time, so to me it makes sense to use a range. So for example, I want to do...
Model inheritance: Can you access a child object from the parent object?
* I have 2 classes : Class A & Class B.
* Class B inherits from Class A. Example:: **Class B(A)**
* Class A is not Abstract
* When I create a Class B object, it also creates a Class A object
Can you access the Class B object from the corresponding Class A object? Example: **classa_object.classb_object** ?
I'm trying to reference the Class B objects from a Class A queryset.
EDIT:
Here is [the code](https://gist.github.com/emilepetrone/40469ea24f4b365473cf57e44320affa) I'm reffering to. I broke the class Transaction up into child models of the various status options.
"The problem I thought I had was a class starting to have too many fields only being used when the object was in certain states. 6 different states, different fields used in different states. I was thinking I should break that up into Parent (the fields they all use), and then Children models for the subset each uses.
Maybe I'm thinking about it wrong?
The example:
class Transaction
states: buy, sold, dividend, withdrawl etc"
/r/django
https://redd.it/7d0fn6
* I have 2 classes : Class A & Class B.
* Class B inherits from Class A. Example:: **Class B(A)**
* Class A is not Abstract
* When I create a Class B object, it also creates a Class A object
Can you access the Class B object from the corresponding Class A object? Example: **classa_object.classb_object** ?
I'm trying to reference the Class B objects from a Class A queryset.
EDIT:
Here is [the code](https://gist.github.com/emilepetrone/40469ea24f4b365473cf57e44320affa) I'm reffering to. I broke the class Transaction up into child models of the various status options.
"The problem I thought I had was a class starting to have too many fields only being used when the object was in certain states. 6 different states, different fields used in different states. I was thinking I should break that up into Parent (the fields they all use), and then Children models for the subset each uses.
Maybe I'm thinking about it wrong?
The example:
class Transaction
states: buy, sold, dividend, withdrawl etc"
/r/django
https://redd.it/7d0fn6
Gist
gist:40469ea24f4b365473cf57e44320affa
Return only the form in the UpdateView class ?
I am trying to switch form a functional view that edits and submits a form to class based view, UpdateView. I need to access only the form.
Until now I use this view:
@login_required
def edit_sale_view(request, id):
instance = get_object_or_404(Sale, id=id)
form = EditSaleForm(instance=instance)
if request.method == "POST":
form = EditSaleForm(request.POST, instance=instance)
if form.is_valid():
obj = form.save(commit=False)
obj.user = request.user
obj.save()
return JsonResponse({'msg': 'Data saved'})
else:
return JsonResponse({'msg': 'Data not saved'})
return HttpResponse(form.as_p())
The form.as_p() is important because it is used in the form that is displayed in a modal window.
So, I think that I need to find out how to return only the form and not the whole template.
/r/django
https://redd.it/7d3gwy
I am trying to switch form a functional view that edits and submits a form to class based view, UpdateView. I need to access only the form.
Until now I use this view:
@login_required
def edit_sale_view(request, id):
instance = get_object_or_404(Sale, id=id)
form = EditSaleForm(instance=instance)
if request.method == "POST":
form = EditSaleForm(request.POST, instance=instance)
if form.is_valid():
obj = form.save(commit=False)
obj.user = request.user
obj.save()
return JsonResponse({'msg': 'Data saved'})
else:
return JsonResponse({'msg': 'Data not saved'})
return HttpResponse(form.as_p())
The form.as_p() is important because it is used in the form that is displayed in a modal window.
So, I think that I need to find out how to return only the form and not the whole template.
/r/django
https://redd.it/7d3gwy
reddit
Return only the form in the UpdateView class ? • r/django
I am trying to switch form a functional view that edits and submits a form to class based view, UpdateView. I need to access only the form. Until...
scikit-video: all-in-one video processing solution for Python
http://www.scikit-video.org/stable/
/r/Python
https://redd.it/7cxhoo
http://www.scikit-video.org/stable/
/r/Python
https://redd.it/7cxhoo
reddit
scikit-video: all-in-one video processing solution for... • r/Python
40 points and 3 comments so far on reddit
Microservices with Docker, Flask, and React
https://testdriven.io/part-four-e2e-test-setup/
/r/flask
https://redd.it/7d3a7y
https://testdriven.io/part-four-e2e-test-setup/
/r/flask
https://redd.it/7d3a7y
reddit
Microservices with Docker, Flask, and React • r/flask
4 points and 1 comments so far on reddit
Automating the Boring Search for an iPhone X
http://anthonyfox.io/iphone
/r/Python
https://redd.it/7d4b91
http://anthonyfox.io/iphone
/r/Python
https://redd.it/7d4b91
Anthony Fox
For reasons I still don’t understand, T-Mobile effectively prevented me from preordering the iPhone X. This had something to do with Apples payment plans and T-Mobile’s stipulations. It ultimately meant that if I wanted an iPhone X I’d have to go in store…
Simple way to navigate a JSON object?
Is there a simple way to navigate a large JSON object in jupyter notebook?
For example in https://jsonformatter.curiousconcept.com I can paste in a json object and then minimize/expand different layers. This is much more productive than reading through a printed json object.
I could just paste in the json object I get into the above site, but I would like a solution with the notebook so I can have a simpler workflow.
/r/JupyterNotebooks
https://redd.it/7d4zrh
Is there a simple way to navigate a large JSON object in jupyter notebook?
For example in https://jsonformatter.curiousconcept.com I can paste in a json object and then minimize/expand different layers. This is much more productive than reading through a printed json object.
I could just paste in the json object I get into the above site, but I would like a solution with the notebook so I can have a simpler workflow.
/r/JupyterNotebooks
https://redd.it/7d4zrh
Curiousconcept
JSON Formatter & Validator
Format and validate JSON data so that it can easily be read by human beings.
What's up with Shuup (previously Shoop)?
TL;DR: Is Shuup about to go subscription/enterprise mode with a limited CE edition?
Asking because:
* Search for shoop/shuup on r/django turns up ONE result,
* 2 months ago shoop was renamed shuup with a new github repo, it has ONE commit since then,
* shuup.com menu for "Products" only lists "Entersprise" and "Why shuup?",
* Download page goes to typical marketing signup-before-download page,
* Only mention of github is in the footer,
* Install docs for latest version doesn't work, requires multiple tweaks to even get to the migration.
Longer version:
I'm evaluating CMS+eCommerce options for a freelance project I've been asked to send a proposal for. I wished to try something different than the wordpress swamp this time, preferably python since I dunno, I like it?
My search first lead me to Saleor (not customizable enough for my client) -> Django-CMS+Django-Shop (couldn't get the apphooks to work easily) -> Django-Oscar (too basic, tight deadline) -> Mezzanine+Cartridge (my weapon of choice, everything just worked). But another team member suggested I check shuup as well, because they seemed to have more features (demo page looks very nice: https://demo2.shuup.com/), but the more I read and check about shuup the less I feel for it. All the activity graphs of their repos are equally dead. I mean, they have more stars, followers and forks than Cartridge, but no commits in 2 months?
Am I missing something obvious here? To me it seems like they've been bought and are in a hush-hush phase of commercializing the product and mainly focus on an enterprise version.
I just don't want to be stuck with a non-supported and/or costly framework for this project...
EDIT: Typo
/r/django
https://redd.it/7d5t15
TL;DR: Is Shuup about to go subscription/enterprise mode with a limited CE edition?
Asking because:
* Search for shoop/shuup on r/django turns up ONE result,
* 2 months ago shoop was renamed shuup with a new github repo, it has ONE commit since then,
* shuup.com menu for "Products" only lists "Entersprise" and "Why shuup?",
* Download page goes to typical marketing signup-before-download page,
* Only mention of github is in the footer,
* Install docs for latest version doesn't work, requires multiple tweaks to even get to the migration.
Longer version:
I'm evaluating CMS+eCommerce options for a freelance project I've been asked to send a proposal for. I wished to try something different than the wordpress swamp this time, preferably python since I dunno, I like it?
My search first lead me to Saleor (not customizable enough for my client) -> Django-CMS+Django-Shop (couldn't get the apphooks to work easily) -> Django-Oscar (too basic, tight deadline) -> Mezzanine+Cartridge (my weapon of choice, everything just worked). But another team member suggested I check shuup as well, because they seemed to have more features (demo page looks very nice: https://demo2.shuup.com/), but the more I read and check about shuup the less I feel for it. All the activity graphs of their repos are equally dead. I mean, they have more stars, followers and forks than Cartridge, but no commits in 2 months?
Am I missing something obvious here? To me it seems like they've been bought and are in a hush-hush phase of commercializing the product and mainly focus on an enterprise version.
I just don't want to be stuck with a non-supported and/or costly framework for this project...
EDIT: Typo
/r/django
https://redd.it/7d5t15
django-Filter: Only show filter options contained in queryset
I'm using the excellent [django-filter](https://github.com/carltongibson/django-filter) app to filter a queryset of model objects. Let's say my model and view look as follows:
#model
[...]
class Animal(models.Model):
REGION_CHOICES = (
(0, 'Africa'),
(1, 'Europe'),
)
name = models.CharField(max_length=100)
region = models.CharField(choices=REGION_CHOICES, max_length=100)
[...]
#view
[...]
qs = Animal.objects.all()
filter = AnimalFilter(request.GET, qs)
[...]
Assuming there are two animals in the database:
zebra = Animal(name='Zebra', region='Africa')
frog = Animal(name='Frog', region'Europe')
When I render the filter in the template, I correctly get a selector for region which contains the two options Europe and Africa.
But if I use some logic in the view to .exclude() objects from the queryset like this:
#view
[...]
qs = Animal.objects.all().exclude(name='Frog')
filter = AnimalFilter(request.GET, qs)
[...]
Now if I render the filter in the template I still get the two optione Europe and Africa for region although the queryset only contains one animal which has the region Africa.
Any ideas how I could get the correct options for the region field rendered in the template? Any help is greatly appreciated.
/r/djangolearning
https://redd.it/7d32ck
I'm using the excellent [django-filter](https://github.com/carltongibson/django-filter) app to filter a queryset of model objects. Let's say my model and view look as follows:
#model
[...]
class Animal(models.Model):
REGION_CHOICES = (
(0, 'Africa'),
(1, 'Europe'),
)
name = models.CharField(max_length=100)
region = models.CharField(choices=REGION_CHOICES, max_length=100)
[...]
#view
[...]
qs = Animal.objects.all()
filter = AnimalFilter(request.GET, qs)
[...]
Assuming there are two animals in the database:
zebra = Animal(name='Zebra', region='Africa')
frog = Animal(name='Frog', region'Europe')
When I render the filter in the template, I correctly get a selector for region which contains the two options Europe and Africa.
But if I use some logic in the view to .exclude() objects from the queryset like this:
#view
[...]
qs = Animal.objects.all().exclude(name='Frog')
filter = AnimalFilter(request.GET, qs)
[...]
Now if I render the filter in the template I still get the two optione Europe and Africa for region although the queryset only contains one animal which has the region Africa.
Any ideas how I could get the correct options for the region field rendered in the template? Any help is greatly appreciated.
/r/djangolearning
https://redd.it/7d32ck
GitHub
GitHub - carltongibson/django-filter: A generic system for filtering Django QuerySets based on user selections
A generic system for filtering Django QuerySets based on user selections - carltongibson/django-filter
How do i filter Django list using my bootstrap form?
I have been using Django and its default admin templates for my app. There is a certain list view for which I have decided to create my own bootstrap form for filtering objects. I want the values in the form fields to be used to filter on the queryset. How do I POST the data to Django and tell it to reload the page bearing in mind the choices in the form? Basically, how do I tell Django to "refresh this page" but apply the values in the form to queryset? Here is my code for the customized list
{% extends 'admin/change_list.html' %}
{% load i18n admin_urls static admin_list %}
{% block extrastyle %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" />
{% if cl.formset %}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />
{% endif %}
{% if cl.formset or action_form %}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{% endif %}
{{ media.css }}
{% if not actions_on_top and not actions_on_bottom %}
<style>
#changelist table thead th:first-child {width: inherit}
</style>
{% endif %}
{% endblock %}
{% block content_title %}
<h1> Activity Summary </h1>
{% endblock %}
{% block object-tools-items %}
{% if has_add_permission %}
{{ block.super }}
<!-- Modal -->
<button type="button" data-toggle="modal" data-target="#filterModal" class="btn btn-primary">Launch modal</button>
<div class="modal fade" id="filterModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Filter</h4>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="user">Users:</label>
<input type="text" class="form-control" id="user">
</div>
<div class="form-group">
<label for="text">Date</label>
<input type="text" class="form-control" id="text">
</div>
<div class="checkbox">
<label><input type="checkbox"> Verified </label>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
<div class="modal-footer">
<a href="#" data-dismiss="modal" class="btn">Close</a>
<a href="#" class="btn btn-primary">Save changes</a>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
{% load humanize %}
{% block result_list %}
<script type="text/javascript">
$(document).ready(function() {
$("#user").autocomplete(
{
minLength: 2,
source: function (request, response)
{
$.ajax(
{
url: "/autocomplete/",
data: {term: request.term},
dataType: "json",
appendTo : "ui-id-1",
success: function (jsonDataReceivedFromServer)
{
//alert (JSON.stringify (jsonDataReceivedFromServer));
// console.log (jsonDataReceivedFromServer);
response ($.map(jsonDataReceivedFromServer, function (item)
{
console.log (item.firstname);
return {
id: item.firstname, value: item.email, label: item.firstname };
}));
}
});
},
});
});
</script>
<div class="results">
<table>
<thead>
<tr>
<th>
<div class="text">
<a href="#">Employee</a>
</div>
</th>
<th>
</table>
</div>
{% endblock %}
{% block pagination %}{% endblock %}
/r/djangolearning
https://redd.it/7d2kaj
I have been using Django and its default admin templates for my app. There is a certain list view for which I have decided to create my own bootstrap form for filtering objects. I want the values in the form fields to be used to filter on the queryset. How do I POST the data to Django and tell it to reload the page bearing in mind the choices in the form? Basically, how do I tell Django to "refresh this page" but apply the values in the form to queryset? Here is my code for the customized list
{% extends 'admin/change_list.html' %}
{% load i18n admin_urls static admin_list %}
{% block extrastyle %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" />
{% if cl.formset %}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />
{% endif %}
{% if cl.formset or action_form %}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{% endif %}
{{ media.css }}
{% if not actions_on_top and not actions_on_bottom %}
<style>
#changelist table thead th:first-child {width: inherit}
</style>
{% endif %}
{% endblock %}
{% block content_title %}
<h1> Activity Summary </h1>
{% endblock %}
{% block object-tools-items %}
{% if has_add_permission %}
{{ block.super }}
<!-- Modal -->
<button type="button" data-toggle="modal" data-target="#filterModal" class="btn btn-primary">Launch modal</button>
<div class="modal fade" id="filterModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Filter</h4>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="user">Users:</label>
<input type="text" class="form-control" id="user">
</div>
<div class="form-group">
<label for="text">Date</label>
<input type="text" class="form-control" id="text">
</div>
<div class="checkbox">
<label><input type="checkbox"> Verified </label>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
<div class="modal-footer">
<a href="#" data-dismiss="modal" class="btn">Close</a>
<a href="#" class="btn btn-primary">Save changes</a>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
{% load humanize %}
{% block result_list %}
<script type="text/javascript">
$(document).ready(function() {
$("#user").autocomplete(
{
minLength: 2,
source: function (request, response)
{
$.ajax(
{
url: "/autocomplete/",
data: {term: request.term},
dataType: "json",
appendTo : "ui-id-1",
success: function (jsonDataReceivedFromServer)
{
//alert (JSON.stringify (jsonDataReceivedFromServer));
// console.log (jsonDataReceivedFromServer);
response ($.map(jsonDataReceivedFromServer, function (item)
{
console.log (item.firstname);
return {
id: item.firstname, value: item.email, label: item.firstname };
}));
}
});
},
});
});
</script>
<div class="results">
<table>
<thead>
<tr>
<th>
<div class="text">
<a href="#">Employee</a>
</div>
</th>
<th>
</table>
</div>
{% endblock %}
{% block pagination %}{% endblock %}
/r/djangolearning
https://redd.it/7d2kaj
reddit
How do i filter Django list using my bootstrap... • r/djangolearning
I have been using Django and its default admin templates for my app. There is a certain list view for which I have decided to create my own...
[D] Should we introduce an "Inaccurate"/"Misleading" tag for posts?
As a moderator, simply removing a post doesn't seem to curb the amount self-promotion and inaccurate submissions that continue to crop up. This is mainly because these posts come from a different author each time.
There's no incentive to not post since there will be some amount of visibility before it gets removed. To disincentivize these types of posts, should we introduce "Inaccurate" and "Misleading" tags to inform the community that the post could be misleading. The author can appeal this tag with the moderators, but it will be at our discretion whether it will be removed or not.
/r/MachineLearning
https://redd.it/7d6dkw
As a moderator, simply removing a post doesn't seem to curb the amount self-promotion and inaccurate submissions that continue to crop up. This is mainly because these posts come from a different author each time.
There's no incentive to not post since there will be some amount of visibility before it gets removed. To disincentivize these types of posts, should we introduce "Inaccurate" and "Misleading" tags to inform the community that the post could be misleading. The author can appeal this tag with the moderators, but it will be at our discretion whether it will be removed or not.
/r/MachineLearning
https://redd.it/7d6dkw
reddit
[D] Should we introduce an... • r/MachineLearning
As a moderator, simply removing a post doesn't seem to curb the amount self-promotion and inaccurate submissions that continue to crop up. This is...
Install flask production on centos 7
I can't find a tutorial online that gives a step by step on how to install Flask for production on Centos 7 that uses port 80 with either nginix or apache. Does anyone have a good tutorial on this? It's always setting it up with "venv" and then port 5000. I want to use it on a production machine on port 80 but can't find a good tutorial.
/r/flask
https://redd.it/7d8ue0
I can't find a tutorial online that gives a step by step on how to install Flask for production on Centos 7 that uses port 80 with either nginix or apache. Does anyone have a good tutorial on this? It's always setting it up with "venv" and then port 5000. I want to use it on a production machine on port 80 but can't find a good tutorial.
/r/flask
https://redd.it/7d8ue0
reddit
Install flask production on centos 7 • r/flask
I can't find a tutorial online that gives a step by step on how to install Flask for production on Centos 7 that uses port 80 with either nginix...
Dropbox releases PyAnnotate -- auto-generate type annotations for mypy
http://mypy-lang.blogspot.de/2017/11/dropbox-releases-pyannotate-auto.html
/r/Python
https://redd.it/7d7aqw
http://mypy-lang.blogspot.de/2017/11/dropbox-releases-pyannotate-auto.html
/r/Python
https://redd.it/7d7aqw
mypy-lang.blogspot.co.uk
Dropbox releases PyAnnotate -- auto-generate type annotations for mypy
For statically checking Python code, mypy is great, but it only works after you have added type annotations to your codebase. When you h...
Django 2.0 release candidate 1 released | Weblog
https://www.djangoproject.com/weblog/2017/nov/15/django-20-release-candidate-1-released/
/r/Python
https://redd.it/7d8r0x
https://www.djangoproject.com/weblog/2017/nov/15/django-20-release-candidate-1-released/
/r/Python
https://redd.it/7d8r0x
reddit
Django 2.0 release candidate 1 released | Weblog • r/Python
19 points and 1 comments so far on reddit
Django 2.0 release candidate 1 released | Weblog
https://www.djangoproject.com/weblog/2017/nov/15/django-20-release-candidate-1-released/
/r/django
https://redd.it/7d8ta8
https://www.djangoproject.com/weblog/2017/nov/15/django-20-release-candidate-1-released/
/r/django
https://redd.it/7d8ta8
reddit
Django 2.0 release candidate 1 released | Weblog • r/django
38 points and 1 comments so far on reddit
[N] Numpy dropping Python 2.7
https://github.com/numpy/numpy/blob/master/doc/neps/dropping-python2.7-proposal.rst
/r/MachineLearning
https://redd.it/7d7ge0
https://github.com/numpy/numpy/blob/master/doc/neps/dropping-python2.7-proposal.rst
/r/MachineLearning
https://redd.it/7d7ge0
[AF] Example of Flask app w/search form
I'm a new Flask (and Python) user, and was wondering if there is a good example of a Flask application that uses a search form as a basis for a database query. Especially if it uses Pagination.
Miguel's tutorial has an example of full-text search, but in general the things I've found only show some simpler parts of the process--using forms for user login, or getting all examples of something from the database (and then paginating this). I'd love a good model to follow for generating a perhaps-complicated query, which would involve using non-trivial bits of WTForms, SQLAlchemy, &c.
/r/flask
https://redd.it/7d527c
I'm a new Flask (and Python) user, and was wondering if there is a good example of a Flask application that uses a search form as a basis for a database query. Especially if it uses Pagination.
Miguel's tutorial has an example of full-text search, but in general the things I've found only show some simpler parts of the process--using forms for user login, or getting all examples of something from the database (and then paginating this). I'd love a good model to follow for generating a perhaps-complicated query, which would involve using non-trivial bits of WTForms, SQLAlchemy, &c.
/r/flask
https://redd.it/7d527c
reddit
[AF] Example of Flask app w/search form • r/flask
I'm a new Flask (and Python) user, and was wondering if there is a good example of a Flask application that uses a search form as a basis for a...
I wrote an article for Florida CPA Today on why accountants should learn Python
http://www.ficpa.org/Content/Files/Docs/Flipbooks/2017/NovDec.pdf
/r/Python
https://redd.it/7d6i0z
http://www.ficpa.org/Content/Files/Docs/Flipbooks/2017/NovDec.pdf
/r/Python
https://redd.it/7d6i0z
reddit
I wrote an article for Florida CPA Today on why... • r/Python
43 points and 1 comments so far on reddit
Flask apache hello world
I have an amazon aws server and was attempting to use flask to do a simple hello world on the server.
I have tried a few options listed at http://flask.pocoo.org/docs/0.12/deploying/ and can't seem to get any of them to work and I'm not entirely sure why. I also can't seem to find a simple hello world tutorial showing what I am trying to do.
So my question is what is the simplest way to have my server when accessed through a web browser display "Hello World"
Note the script is called hello_world.py: https://pastebin.com/30nutV4c
/r/flask
https://redd.it/7dbo3x
I have an amazon aws server and was attempting to use flask to do a simple hello world on the server.
I have tried a few options listed at http://flask.pocoo.org/docs/0.12/deploying/ and can't seem to get any of them to work and I'm not entirely sure why. I also can't seem to find a simple hello world tutorial showing what I am trying to do.
So my question is what is the simplest way to have my server when accessed through a web browser display "Hello World"
Note the script is called hello_world.py: https://pastebin.com/30nutV4c
/r/flask
https://redd.it/7dbo3x
Pastebin
[Python] from flask import Flask app = Flask(__name__) @app.route('/') def index() - Pastebin.com