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...
Best API for scheduled tasks currently?
I need to set up automatic scheduled tasks. The tasks are pretty simple, like set `is_active_subscriber` to `False` when a user's subscription ends and auto-renewal is off.
I'm aware of cron, but I see that it hasn't been updated for a few years. For simple scheduled tasks, what API is the best option right now?
Thanks.
P.S. I'm building a MVP so I'll be expecting only a small amount of traffic when I first go live. So whatever method I end up using, it should be sufficiently scalable.
/r/django
https://redd.it/7fzled
I need to set up automatic scheduled tasks. The tasks are pretty simple, like set `is_active_subscriber` to `False` when a user's subscription ends and auto-renewal is off.
I'm aware of cron, but I see that it hasn't been updated for a few years. For simple scheduled tasks, what API is the best option right now?
Thanks.
P.S. I'm building a MVP so I'll be expecting only a small amount of traffic when I first go live. So whatever method I end up using, it should be sufficiently scalable.
/r/django
https://redd.it/7fzled
reddit
Best API for scheduled tasks currently? • r/django
I need to set up automatic scheduled tasks. The tasks are pretty simple, like set `is_active_subscriber` to `False` when a user's subscription...
I'm releasing a free code for the "Automate the Boring Stuff with Python" Udemy course
Use this link to sign up for the "Automate the Boring Stuff with Python" Udemy online course: https://www.udemy.com/automate/?couponCode=PY_ALL_THE_THINGS
It's free until the end of Friday, Dec 1, 2017. Afterwards it goes back to its normal $50 price. (Though you can use this link https://www.udemy.com/automate/?couponCode=FOR_LIKE_10_BUCKS to buy it for $10. And it's an open secret that if you browse Udemy in privacy mode, they'll show you the discount price to lure in a "new" customer. But course creators get a much larger cut when people use their referral codes.)
The course follows the book of the same name, which is available for free, in full, at https://automatetheboringstuff.com under a Creative Commons license. ([Which I encourage you to use to share your own creative works.](https://creativecommons.org/licenses/))
The course is 50 videos and made for people with no previous programming experience. The first 15 videos are free to view on YouTube: https://www.youtube.com/watch?v=1F_OgqRuSdI&list=PL0-84-yl1fUnRuXGFe_F7qSH1LEnn9LkW
And now I will go self-flagellate to atone for my part in legitimizing "cyber monday".
/r/Python
https://redd.it/7fxp46
Use this link to sign up for the "Automate the Boring Stuff with Python" Udemy online course: https://www.udemy.com/automate/?couponCode=PY_ALL_THE_THINGS
It's free until the end of Friday, Dec 1, 2017. Afterwards it goes back to its normal $50 price. (Though you can use this link https://www.udemy.com/automate/?couponCode=FOR_LIKE_10_BUCKS to buy it for $10. And it's an open secret that if you browse Udemy in privacy mode, they'll show you the discount price to lure in a "new" customer. But course creators get a much larger cut when people use their referral codes.)
The course follows the book of the same name, which is available for free, in full, at https://automatetheboringstuff.com under a Creative Commons license. ([Which I encourage you to use to share your own creative works.](https://creativecommons.org/licenses/))
The course is 50 videos and made for people with no previous programming experience. The first 15 videos are free to view on YouTube: https://www.youtube.com/watch?v=1F_OgqRuSdI&list=PL0-84-yl1fUnRuXGFe_F7qSH1LEnn9LkW
And now I will go self-flagellate to atone for my part in legitimizing "cyber monday".
/r/Python
https://redd.it/7fxp46
Udemy
Automate the Boring Stuff with Python Programming
A practical programming course for office workers, academics, and administrators who want to improve their productivity.
Free Python Games - Basic Python Games for Beginners
http://www.grantjenks.com/docs/freegames/
/r/Python
https://redd.it/7fzu88
http://www.grantjenks.com/docs/freegames/
/r/Python
https://redd.it/7fzu88
Using Python’s Pathlib Module - Practical Business Python
http://pbpython.com/pathlib-intro.html
/r/Python
https://redd.it/7fzvhj
http://pbpython.com/pathlib-intro.html
/r/Python
https://redd.it/7fzvhj
Pbpython
Using Python’s Pathlib Module
Using python's pathlib module.
pytest 3.3 released. built-in logging capture, new progress output and fixtures.
https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst
/r/Python
https://redd.it/7g349q
https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst
/r/Python
https://redd.it/7g349q
GitHub
pytest-dev/pytest
The pytest framework makes it easy to write small tests, yet scales to support complex functional testing - pytest-dev/pytest
Django URL Issue
I am building a blog. In the navigation menu, there are options for going through "Home" (which is index.html) and "Blog." "Home" is not working unless I place the index.html in the static folder and insert the following line in the code of navigation menu:
<a href="{% static "html/index.html" %}"
In short, when I click on "Home," the URL is being displayed as "http://127.0.0.1:8000/static/html/index.html" in the browser. But when I click on "Blog," the URL becomes "http://127.0.0.1:8000/blog/", which looks to be pretty standard. How can I change "http://127.0.0.1:8000/static/html/index.html" to simply "http://127.0.0.1:8000/index/".
I am a beginner. So, pardon if I make any silly mistake.
/r/djangolearning
https://redd.it/7g2f5h
I am building a blog. In the navigation menu, there are options for going through "Home" (which is index.html) and "Blog." "Home" is not working unless I place the index.html in the static folder and insert the following line in the code of navigation menu:
<a href="{% static "html/index.html" %}"
In short, when I click on "Home," the URL is being displayed as "http://127.0.0.1:8000/static/html/index.html" in the browser. But when I click on "Blog," the URL becomes "http://127.0.0.1:8000/blog/", which looks to be pretty standard. How can I change "http://127.0.0.1:8000/static/html/index.html" to simply "http://127.0.0.1:8000/index/".
I am a beginner. So, pardon if I make any silly mistake.
/r/djangolearning
https://redd.it/7g2f5h
reddit
Django URL Issue • r/djangolearning
I am building a blog. In the navigation menu, there are options for going through "Home" (which is index.html) and "Blog." "Home" is not working...
i wrote a script to make it easier to update my pythonAnywhere server whenever my code changes, help me make it better !
Hello !
Whenever I am happy with my code, I commit it to my Git repository, sync it up, and then use the following two files :
## update.bat
set login=brachamul
plink %login%@ssh.pythonanywhere.com -m update.txt
@echo "Work complete !"
This will open an SSH connection with pythonanywhere, and call my script from there.
## update.txt
echo
echo [Pulling from git]
git pull
echo
echo [Collecting static files]
workon MyEnv
python manage.py collectstatic --noinput
echo
echo [Migrating]
python manage.py migrate
echo
echo [Testing new setup]
python manage.py test
echo
echo [Reloading web app]
touch /var/www/www_mysite_com_wsgi.py
This will pull the new code from git, reload static files, migrate if migrations are needed, trigger the tests (but won't change anything if the tests are wrong, I don't know how to do that) and finally reload the app.
How can I improve on this code ? How do **you** do it ?
/r/djangolearning
https://redd.it/7elu71
Hello !
Whenever I am happy with my code, I commit it to my Git repository, sync it up, and then use the following two files :
## update.bat
set login=brachamul
plink %login%@ssh.pythonanywhere.com -m update.txt
@echo "Work complete !"
This will open an SSH connection with pythonanywhere, and call my script from there.
## update.txt
echo
echo [Pulling from git]
git pull
echo
echo [Collecting static files]
workon MyEnv
python manage.py collectstatic --noinput
echo
echo [Migrating]
python manage.py migrate
echo
echo [Testing new setup]
python manage.py test
echo
echo [Reloading web app]
touch /var/www/www_mysite_com_wsgi.py
This will pull the new code from git, reload static files, migrate if migrations are needed, trigger the tests (but won't change anything if the tests are wrong, I don't know how to do that) and finally reload the app.
How can I improve on this code ? How do **you** do it ?
/r/djangolearning
https://redd.it/7elu71
reddit
i wrote a script to make it easier to update my... • r/djangolearning
Hello ! Whenever I am happy with my code, I commit it to my Git repository, sync it up, and then use the following two files : ## update.bat ...
What's everyone working on this week?
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/7g4dnf
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/7g4dnf
reddit
What's everyone working on this week? • r/Python
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your...
How to automate Jupyter notebook slide generation. (get the most out of those slides!)
https://jellis18.github.io/post/2017-11-20-automating-jupyter-slides/
/r/IPython
https://redd.it/7g4n3a
https://jellis18.github.io/post/2017-11-20-automating-jupyter-slides/
/r/IPython
https://redd.it/7g4n3a
jellis18.github.io
Automating Jupyter Slides with Travis CI and gh-pages. |
Astrophysicist and Aspiring Data Scientist