Does anyone know of an open source DRF project which implements user registration really well? I'm struggling to find one that's more production hardened...
/r/django
https://redd.it/7fhsfr
/r/django
https://redd.it/7fhsfr
reddit
Does anyone know of an open source DRF project which... • r/django
8 points and 9 comments so far on reddit
Graphs/Charts on webpage
Hey is there a way to display graphs or charts on a webpage? I have dug around a little and the libraries I found seemed like the cost to use for production. I was wondering if I could use seaborne or something for them.
I’m trying to display metrics of my objects so like total counts and how maybe are stock and deployed. I would like my homepage be a dashboard.
/r/django
https://redd.it/7fk0x0
Hey is there a way to display graphs or charts on a webpage? I have dug around a little and the libraries I found seemed like the cost to use for production. I was wondering if I could use seaborne or something for them.
I’m trying to display metrics of my objects so like total counts and how maybe are stock and deployed. I would like my homepage be a dashboard.
/r/django
https://redd.it/7fk0x0
reddit
Graphs/Charts on webpage • r/django
Hey is there a way to display graphs or charts on a webpage? I have dug around a little and the libraries I found seemed like the cost to use for...
[AF]How to work with an API and routes
I'm trying to develop a REST API using Flask. I chose this framework since I like python to do common tasks, also Flask seems easier than Django.
The goal of developing a REST API is to later consume it from a webpage and from an android/iOS app (as you may see is a big personal project).
I'm having a hard time thinking of how the consumption of the api should be since I don't know anything about front nor backend.
Here goes my question:
Suppose I have this route - mydomain.com/api/1.0/tasks. This route is made to return a json with all the tasks. I was thinking of defining an html page with a button and when the button is pressed, the action of that button equals a route of the shape mydomain.com/tasks...this route internally calls the api, the api returns a json to the function inside that route. then that json is passed as an argument to a render_template('tasks.html',json) and finally that render_template is returned. Is that correct? Or maybe a frontend framework like angular/react is capable of handling and presenting a json?
I need a bit of guidance in how to desing the api to work with views.
If any of you need any further details dont hesitate to ask, I really need to work this out.
/r/flask
https://redd.it/7anx2j
I'm trying to develop a REST API using Flask. I chose this framework since I like python to do common tasks, also Flask seems easier than Django.
The goal of developing a REST API is to later consume it from a webpage and from an android/iOS app (as you may see is a big personal project).
I'm having a hard time thinking of how the consumption of the api should be since I don't know anything about front nor backend.
Here goes my question:
Suppose I have this route - mydomain.com/api/1.0/tasks. This route is made to return a json with all the tasks. I was thinking of defining an html page with a button and when the button is pressed, the action of that button equals a route of the shape mydomain.com/tasks...this route internally calls the api, the api returns a json to the function inside that route. then that json is passed as an argument to a render_template('tasks.html',json) and finally that render_template is returned. Is that correct? Or maybe a frontend framework like angular/react is capable of handling and presenting a json?
I need a bit of guidance in how to desing the api to work with views.
If any of you need any further details dont hesitate to ask, I really need to work this out.
/r/flask
https://redd.it/7anx2j
Django template inclusion issue
Hi,
being lost how include a template without that annoying newline added.
For example, separated and generalized logic for generating attributes for a html tag:
# templates/widgets/attrs.html
{% for name, value in attrs.items %} {{ name }}="{{ value|stringformat:'s' }}"{% endfor %}
When included in a parent template,
# widgets/list_widget_item.html
<li{% include "widgets/attrs.html" %}>List Item Element</li>
django renders it with unwanted newline
<li class="my-li-class"
>List Item Element</li>
Although valid and handled properly by most browsers, I'd like to get expected result instead of that compromise.
I've tried enclose inclusion with `spaceless` tag, however it removes *all* whitespace characters including (optional) leading space, not only the newline.
Any better solution to this straight and trivial demand ?
/r/django
https://redd.it/7fnv8c
Hi,
being lost how include a template without that annoying newline added.
For example, separated and generalized logic for generating attributes for a html tag:
# templates/widgets/attrs.html
{% for name, value in attrs.items %} {{ name }}="{{ value|stringformat:'s' }}"{% endfor %}
When included in a parent template,
# widgets/list_widget_item.html
<li{% include "widgets/attrs.html" %}>List Item Element</li>
django renders it with unwanted newline
<li class="my-li-class"
>List Item Element</li>
Although valid and handled properly by most browsers, I'd like to get expected result instead of that compromise.
I've tried enclose inclusion with `spaceless` tag, however it removes *all* whitespace characters including (optional) leading space, not only the newline.
Any better solution to this straight and trivial demand ?
/r/django
https://redd.it/7fnv8c
reddit
Django template inclusion issue • r/django
Hi, being lost how include a template without that annoying newline added. For example, separated and generalized logic for generating...
Django too complicated for someone like me?
I've been trying to create some sort of political quiz for a long, long while now.
I have little programming knowledge, although I've been using Python in not much depth for the past year.
My progress has been awfully slow, I haven't found the tutorials to be helpful at all and nobody else is really helping me in any depth... is it worth just giving up for now and returning to Django when I have more knowledge of Python?
All I've been trying to do is make a quiz, which has about 50 questions, all which have the options "Strongly Agree" to "Strongly Disagree" with a Neutral option. I wanted the result to be stored in some sort of database so they could be interpreted and a result be generated at the end.
I have gone from using two separate models like the Django tutorial have (Questions and Choices) to just one (Questions) that has the options hard coded into it... but I haven't been able to get those to show up anywhere (things jinja templating are completely lost on me)
/r/djangolearning
https://redd.it/7fesgx
I've been trying to create some sort of political quiz for a long, long while now.
I have little programming knowledge, although I've been using Python in not much depth for the past year.
My progress has been awfully slow, I haven't found the tutorials to be helpful at all and nobody else is really helping me in any depth... is it worth just giving up for now and returning to Django when I have more knowledge of Python?
All I've been trying to do is make a quiz, which has about 50 questions, all which have the options "Strongly Agree" to "Strongly Disagree" with a Neutral option. I wanted the result to be stored in some sort of database so they could be interpreted and a result be generated at the end.
I have gone from using two separate models like the Django tutorial have (Questions and Choices) to just one (Questions) that has the options hard coded into it... but I haven't been able to get those to show up anywhere (things jinja templating are completely lost on me)
/r/djangolearning
https://redd.it/7fesgx
reddit
Django too complicated for someone like me? • r/djangolearning
I've been trying to create some sort of political quiz for a long, long while now. I have little programming knowledge, although I've been using...
"The one thing that Python definitely does not want to be is a GENERAL purpose programming language." - GvR
http://ftp.ntua.gr/mirror/python/search/hypermail/python-1992/0001.html
/r/Python
https://redd.it/7fltpi
http://ftp.ntua.gr/mirror/python/search/hypermail/python-1992/0001.html
/r/Python
https://redd.it/7fltpi
reddit
"The one thing that Python definitely does not want to... • r/Python
139 points and 45 comments so far on reddit
is "Flask Web Development: Developing Web Applications with Python 1st edition" still readable or is too outdated?
this is the link for it on amazon,
https://www.amazon.com/Flask-Web-Development-Developing-Applications/dp/1449372627
I have it in print but don't know if it's worth the effort?
/r/flask
https://redd.it/7fq6es
this is the link for it on amazon,
https://www.amazon.com/Flask-Web-Development-Developing-Applications/dp/1449372627
I have it in print but don't know if it's worth the effort?
/r/flask
https://redd.it/7fq6es
When would I use Docker?
I’m currently work on 2 apps on my windows computer, using virtualenv and PostgreSQL. At some point I plan on deploying to the web. Where, I’m not sure. It might end up being my company’s webserver (I need web hosting in Canada which narrows the choices).
I just learned about Docker and I’m wondering if this type of tool is something I should start learning about and using? I’m not 100% sure of what Docker does so I’m just trying to figure out if it’s something I need to spend time on. Certainly the little bit I know makes it appealing: develop in a Docker container and then I’d be able to (more easily?) deploy my container and app to whatever webserver I choose.
/r/django
https://redd.it/7fokfz
I’m currently work on 2 apps on my windows computer, using virtualenv and PostgreSQL. At some point I plan on deploying to the web. Where, I’m not sure. It might end up being my company’s webserver (I need web hosting in Canada which narrows the choices).
I just learned about Docker and I’m wondering if this type of tool is something I should start learning about and using? I’m not 100% sure of what Docker does so I’m just trying to figure out if it’s something I need to spend time on. Certainly the little bit I know makes it appealing: develop in a Docker container and then I’d be able to (more easily?) deploy my container and app to whatever webserver I choose.
/r/django
https://redd.it/7fokfz
reddit
When would I use Docker? • r/django
I’m currently work on 2 apps on my windows computer, using virtualenv and PostgreSQL. At some point I plan on deploying to the web. Where, I’m not...
Implementing a Neural Network from Scratch in Python – An Introduction
https://www.datasciencecentral.com/profiles/blogs/implementing-a-neural-network-from-scratch-in-python-an
/r/Python
https://redd.it/7fq5ss
https://www.datasciencecentral.com/profiles/blogs/implementing-a-neural-network-from-scratch-in-python-an
/r/Python
https://redd.it/7fq5ss
Datasciencecentral
Implementing a Neural Network from Scratch in Python – An Introduction
This article was written by Denny Britz.
In this post we will implement a simple 3-layer neural network from scratch. We won’t derive all the math that’s requi…
In this post we will implement a simple 3-layer neural network from scratch. We won’t derive all the math that’s requi…
What kind of projects do you use Django for?
https://www.reddit.com/r/django/comments/7b36b8/what_kind_of_projects_do_you_use_django_for/
/r/djangolearning
https://redd.it/7fse3v
https://www.reddit.com/r/django/comments/7b36b8/what_kind_of_projects_do_you_use_django_for/
/r/djangolearning
https://redd.it/7fse3v
reddit
What kind of projects do you use Django for? • r/django
Hola! In which of the following contexts do you use the Django web framework? 1. Bootstrapped business websites (e.g. eCommerce, SaaS, etc) 2....
[R] StarGAN: Unified Generative Adversarial Networks for Multi-Domain Image-to-Image Translation
/r/MachineLearning
https://redd.it/7fro3g
/r/MachineLearning
https://redd.it/7fro3g
Python Guess The Number Game
Just made my first real app in python and was wondering if anyone wanted to give some feedback on it. All is appreciated!
Code:
import random
# Prints credits
print("\t\t\tGuess The Number")
print("\t\t\t \\ \\ \\ \\ \\ \\ \\ \\")
print("\t\t\t\tby")
print("\t\t\t Brook Jeynes")
print("\t\t\t \\ \\ \\ \\ \\ \\")
# Setting values
number_of_guesses = 3
computer_choice = random.randint(1,10)
# Testing number choice
while number_of_guesses != 0:
user_choice = int(input("\nI'm thinking of a number
between 1 and 10:\n"))
# If you guess the number print VVV
if user_choice == computer_choice:
print("Congratulations, you guessed my number")
print("My number was", computer_choice)
number_of_guesses = number_of_guesses - 1
print("You had", number_of_guesses, "guesses left")
number_of_guesses = number_of_guesses + 1
break
# If you didn't guess the number print VVV
elif user_choice != computer_choice:
print("You did not guess my number:\n")
if user_choice > computer_choice:
print("Your guess is too high. Guess lower...")
elif user_choice < computer_choice:
print("Your guess is too low. Guess higher...")
number_of_guesses = number_of_guesses - 1
print("You have", number_of_guesses, "guesses
left")
# Test number of guesses
if number_of_guesses == 0:
print("""
_______ _______ _______ _______ _______ _______ _______
( ____ \( ___ )( )( ____ \ ( ___ )|\ /|( ____ \( ____ )
| ( \/| ( ) || () () || ( \/ | ( ) || ) ( || ( \/| ( )|
| | | (___) || || || || (__ | | | || | | || (__ | (____)|
| | ____ | ___ || |(_)| || __) | | | |( ( ) )| __) | __)
| | \_ )| ( ) || | | || ( | | | | \ \_/ / | ( | (\ (
| (___) || ) ( || ) ( || (____/\ | (___) | \ / | (____/\| ) \ \__
(_______)|/ \||/ \|(_______/ (_______) \_/ (_______/|/ \__/
""")
print("You did not guess my number")
print("My number was", computer_choice)
/r/Python
https://redd.it/7ftn3c
Just made my first real app in python and was wondering if anyone wanted to give some feedback on it. All is appreciated!
Code:
import random
# Prints credits
print("\t\t\tGuess The Number")
print("\t\t\t \\ \\ \\ \\ \\ \\ \\ \\")
print("\t\t\t\tby")
print("\t\t\t Brook Jeynes")
print("\t\t\t \\ \\ \\ \\ \\ \\")
# Setting values
number_of_guesses = 3
computer_choice = random.randint(1,10)
# Testing number choice
while number_of_guesses != 0:
user_choice = int(input("\nI'm thinking of a number
between 1 and 10:\n"))
# If you guess the number print VVV
if user_choice == computer_choice:
print("Congratulations, you guessed my number")
print("My number was", computer_choice)
number_of_guesses = number_of_guesses - 1
print("You had", number_of_guesses, "guesses left")
number_of_guesses = number_of_guesses + 1
break
# If you didn't guess the number print VVV
elif user_choice != computer_choice:
print("You did not guess my number:\n")
if user_choice > computer_choice:
print("Your guess is too high. Guess lower...")
elif user_choice < computer_choice:
print("Your guess is too low. Guess higher...")
number_of_guesses = number_of_guesses - 1
print("You have", number_of_guesses, "guesses
left")
# Test number of guesses
if number_of_guesses == 0:
print("""
_______ _______ _______ _______ _______ _______ _______
( ____ \( ___ )( )( ____ \ ( ___ )|\ /|( ____ \( ____ )
| ( \/| ( ) || () () || ( \/ | ( ) || ) ( || ( \/| ( )|
| | | (___) || || || || (__ | | | || | | || (__ | (____)|
| | ____ | ___ || |(_)| || __) | | | |( ( ) )| __) | __)
| | \_ )| ( ) || | | || ( | | | | \ \_/ / | ( | (\ (
| (___) || ) ( || ) ( || (____/\ | (___) | \ / | (____/\| ) \ \__
(_______)|/ \||/ \|(_______/ (_______) \_/ (_______/|/ \__/
""")
print("You did not guess my number")
print("My number was", computer_choice)
/r/Python
https://redd.it/7ftn3c
reddit
Python Guess The Number Game • r/Python
Just made my first real app in python and was wondering if anyone wanted to give some feedback on it. All is appreciated! Code: import...
Need help with passing href parameters!
So I'm having trouble with passing an argument through href. I'm using twitter api and trying to return info on users, but it's returning nothing. What am I doing wrong in the view?
base.html:
<a href="{% url 'users' get_user=search.user.screen_name %}" class="user-profile" name="user">
urls.py:
from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^$', views.index, name='views'),
url(r'^user/(?P<get_user>\w+)', views.user, name='users'),
views.py:
def index(request):
if request.GET.get('get_user', None):
user_search = request.GET.get('get_user', None)
get_user = api.GetUser(user_id=None, screen_name=user_search)
return render(request, 'scrape/user/users.html', {'get_user': get_user})
trends = api.GetTrendsCurrent(exclude=None)
searches = api.GetSearch(term='moments', raw_query=None, geocode=None, since_id=None,
max_id=None, until=None, since=None, count=30,
lang=None, locale=None, result_type="popular", include_entities=None)
return render(request, 'scrape/base.html', {'trends': trends, 'searches': searches})
def user(request, get_user):
return render(request, 'scrape/user/users.html', {'get_user': get_user})
/r/django
https://redd.it/7fsm87
So I'm having trouble with passing an argument through href. I'm using twitter api and trying to return info on users, but it's returning nothing. What am I doing wrong in the view?
base.html:
<a href="{% url 'users' get_user=search.user.screen_name %}" class="user-profile" name="user">
urls.py:
from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^$', views.index, name='views'),
url(r'^user/(?P<get_user>\w+)', views.user, name='users'),
views.py:
def index(request):
if request.GET.get('get_user', None):
user_search = request.GET.get('get_user', None)
get_user = api.GetUser(user_id=None, screen_name=user_search)
return render(request, 'scrape/user/users.html', {'get_user': get_user})
trends = api.GetTrendsCurrent(exclude=None)
searches = api.GetSearch(term='moments', raw_query=None, geocode=None, since_id=None,
max_id=None, until=None, since=None, count=30,
lang=None, locale=None, result_type="popular", include_entities=None)
return render(request, 'scrape/base.html', {'trends': trends, 'searches': searches})
def user(request, get_user):
return render(request, 'scrape/user/users.html', {'get_user': get_user})
/r/django
https://redd.it/7fsm87
reddit
Need help with passing href parameters! • r/django
So I'm having trouble with passing an argument through href. I'm using twitter api and trying to return info on users, but it's returning nothing....
New Twilio site built on Django and Vue
https://www.twilio.com/blog/2017/11/building-twilioquest-with-twilio-sync-django-and-vue-js.html
/r/django
https://redd.it/7fui9e
https://www.twilio.com/blog/2017/11/building-twilioquest-with-twilio-sync-django-and-vue-js.html
/r/django
https://redd.it/7fui9e
Twilio Blog
Building TwilioQuest with Twilio Sync, Django, and Vue.js
Learn how Twilio built the gamified training experience TwilioQuest using Python, Django, Wagtail, Vue.js, and Twilio Sync. Ready player 1!
Flask support for gentelella bootstrap template
https://github.com/afourmy/flask-gentelella
/r/flask
https://redd.it/7fvwwi
https://github.com/afourmy/flask-gentelella
/r/flask
https://redd.it/7fvwwi
GitHub
GitHub - afourmy/flask-gentelella: Gentelella template powered by Flask
Gentelella template powered by Flask. Contribute to afourmy/flask-gentelella development by creating an account on GitHub.
3x faster than Flask; Quart as a upgrade to Flask
https://medium.com/@pgjones/3x-faster-than-flask-8e89bfbe8e4f
/r/Python
https://redd.it/7fva42
https://medium.com/@pgjones/3x-faster-than-flask-8e89bfbe8e4f
/r/Python
https://redd.it/7fva42
Hacker Noon
3x faster Flask apps
With minimal effort
What are the benefits of using Django to create a website as opposed to using something like WordPress?
/r/djangolearning
https://redd.it/7fpmcp
/r/djangolearning
https://redd.it/7fpmcp
reddit
What are the benefits of using Django to create... • r/djangolearning
2 points and 7 comments so far on reddit
A general query about django / javascript patterns and how to best organize/encapsulate
I am currently coding webapps in django and using a bit of javascript to do this and that. Naturally, I sometimes want my javascript apps from knowing the context of my Django template, so the way I've been doing it is hardcoding the js into the .html file.
Example
<script>
var my_var = {{ my_var_from_context }}
Clearly this is ugly as all hell as it forces me to keep my javascript code inside of the .html file. I'd like to make my .js file separate and load it.
Clearly thee are some options like write a function that takes arguments that can be captured in the template then passed.
e.g.
var my_var = {{ my_django_var }}
myFunctionFromScript(my_var)
Is this the best way to be doing this? Is there a better pattern? What are others doing?
Thanks for your help.
-Joe
/r/django
https://redd.it/7fwzqk
I am currently coding webapps in django and using a bit of javascript to do this and that. Naturally, I sometimes want my javascript apps from knowing the context of my Django template, so the way I've been doing it is hardcoding the js into the .html file.
Example
<script>
var my_var = {{ my_var_from_context }}
Clearly this is ugly as all hell as it forces me to keep my javascript code inside of the .html file. I'd like to make my .js file separate and load it.
Clearly thee are some options like write a function that takes arguments that can be captured in the template then passed.
e.g.
var my_var = {{ my_django_var }}
myFunctionFromScript(my_var)
Is this the best way to be doing this? Is there a better pattern? What are others doing?
Thanks for your help.
-Joe
/r/django
https://redd.it/7fwzqk
reddit
A general query about django / javascript patterns and... • r/django
I am currently coding webapps in django and using a bit of javascript to do this and that. Naturally, I sometimes want my javascript apps from...
Paypal, Django, Local Bank, Integration
I'm thinking about making a web system where people can send me money through their local bank account for buying an online item and I'll buy them that item using my paypal account. So this would be 2 step process. At first they will send me money through their local account and then I'll convert that money into paypal dollars and use those dollars to buy that item for them. I want to know is that possible and if it is, then from where should I start?
/r/djangolearning
https://redd.it/7etabj
I'm thinking about making a web system where people can send me money through their local bank account for buying an online item and I'll buy them that item using my paypal account. So this would be 2 step process. At first they will send me money through their local account and then I'll convert that money into paypal dollars and use those dollars to buy that item for them. I want to know is that possible and if it is, then from where should I start?
/r/djangolearning
https://redd.it/7etabj
reddit
Paypal, Django, Local Bank, Integration • r/djangolearning
I'm thinking about making a web system where people can send me money through their local bank account for buying an online item and I'll buy them...