Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
New to Django, how do i know which imports i need and where do i found or learn them?

I am new to Django and Python, and this is the first time that i am learning and using a Framework (MVT). My question is, how do i know which kind of imports i need when using Django?
Example: from django.conf.urls import url
How do i know i need to include it. I learned some PHP and i didn't have to import classes/functions manually?
How do i learn what i need and where can i find what i need? Isn't this a bit to complex, why do i need to add and import everything manually?

/r/djangolearning
https://redd.it/6zed09
I made a hacker news clone for practice

I post the Pinterest clone about a week ago, now its the time for me to post a [hacker news clone](https://hnews-clone.herokuapp.com/) and I don't know but I think it's much better than my last one app who doesn't allow you to sign up and the CBV login view don't have any style class

I use bootstrap for this one, and I think, the only issue is my cancel button when I try to delete because doesn't redirect to the detail view again and give an error. And maybe add a pagination after 30 items.

Well, tell me anything or suggest me another app to build

[github](https://github.com/iKenshu/hnews)

/r/django
https://redd.it/6zewgx
Detailed Flask Web Development Series

Hey guys,

I’ve been working on building a really detailed course around the Flask framework to get many beginners started with web development with Python.

Course Page: https://www.thecodewolf.com/courses/python-flask-web-development/

Here are the first few videos of the series, I’ve also have written tutorials with the videos as well:

* Overview & Installation
* [Video](https://youtu.be/Ty2qAlDsAxc)
* [Blog Post](https://www.thecodewolf.com/introduction-to-python-flask-web-development-overview-of-flask/)
* Hello World & Flask Application Structure
* [Video](https://youtu.be/OrTWfZpv0i0)
* [Blog Post](https://www.thecodewolf.com/python-flask-web-development-hello-world-flask-application-structure/)
* Flask Templates, Jinja2 Tutorial, Bootstrap Integration, and Custom Error Pages
* [Video](https://youtu.be/0M74EGmqWIY)
* [Blog Post](https://www.thecodewolf.com/python-flask-web-development-flask-templates-and-flask-bootstrap-integration/)

The next few videos and guides will be coming out in the next few days/weeks, and I’ll be releasing new content on a regular basis.

**My goal is to create the best foundational web development course with the Flask framework to get as many people started with Flask as a stepping stone in web development with Python.**

If you guys enjoy the content, I will also be working on a detailed series like this with Django as well.

Here are some of the following videos that will be coming up with the series:

* Web Forms with Flask
* Database Integrations with Flask

Then I will be working on content that will actually have you build a complete blog application with users, blog posts, and all sorts of other really cool stuff.

With the current content so far, I would love to hear some feedback as well.

~ CW

/r/flask
https://redd.it/6zihsb
Django User's Sessions

So I don't have a DB full of users but have a third party company that contains all my customer data in a DB like users' login credentials. If I am using an API to query the user's data what would be the best practice for creating a users session. like 'django.contrib.sessions' does with the creation of users.
As of now, I can create new users using a form that salts and hashes password, POSTing them to the Third Party companies DB using their API but I don't know how to create a session for the user after I authenticate them.

The API has an SDK for this but it's in PHP thinking everyone would use WordPress. but I won't go that route.

HELP ME GET MY PONIES.

/r/django
https://redd.it/6ziw1d
URL Confusion

I am following the django tutorial of thenewboston on Youtube. In tutorial number 12 he goes into creating a URL. I understand what the outcome is I just don't understand how it works or how I would write it myself. Here are the URL patterns.

urlpatterns = [
#/music/
url(r'^$', views.index, name='index'),

#/music/2
#This just blew my freaking mind
url(r'^(?P<album_id>[0-9]+)/$', views.detail, name="detail"),
]
If someone could help explain to me how the second URL works or point me towards an article that would explain it I would be very appreciative.

/r/djangolearning
https://redd.it/6zk5tn
Is there a way of inputing data into an excel spreadsheet from python?

I am trying to create a program for my school which would allows users to input the books they read, author, date finished etc and then have it stored into a personal spreadsheet. As someone who has little experience doing python how doable is this task? Manu Thanks.

/r/Python
https://redd.it/6zm0s7
Do all the databases work the same in django?

I think this is a stupid question but i have to ask. I'm a total noob and just started working on django. It keeps scaring by saying over and over again that we should use other databases for larger projects.

Honestly, i have no clue what this means. Moreover i don't have any experience with databases. I started learning python 3 months ago and now i'm thinking i should try django.

What i want to know is if the databases work the same in django? Like will sqlite3 and postgresql work the same or will i have to learn something before doing it? And should i learn databases before learning django or not? IT would help me alot if anyone could clear these things up for me.

/r/djangolearning
https://redd.it/6zlhs6
Security best practices for Javascript generated field.

I'm using flask_wtf FlaskForm. I would like to sanitize string user input for a JavaScript generated form field. Now there are plenty of external libraries to do this, but I was hoping to find a way within the existing libraries. Any ideas?



/r/flask
https://redd.it/6zngt3