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
Django Channels/Daphne - I am going insane.

SOLUTION EDIT:

Ran:

python3 -m pip install -r requirements.txt

Whereas I'd just used previously;

pip install -r requirements.txt

HOWEVER!

Plain old pip.exe was installing to one python environment, and then when I tried to run:

python3 manage.py startapp chat

It was pulling from a different environment.

Yes, this was all done inside the same virtual environment.

Huge thanks to u/codingranger. Copy pasted their explanation here for anyone who's interested:

>To explain the issue:
You have two programs: python3.exe and pip.exe. Those don't always point to the same underlying Python environment. So your pip.exe was installing to one environment and then when you ran the thing using python3.exe it didn't see the installed code. So using python3.exe -m pip
instead of pip.exe we can be 1000% sure no exceptions it's pointed to the same place both times. This is a good general habit to get in, just pretend pip.exe doesn't exist.

\--------------------------------------

Original Post

\--------------------------------------

Can somebody please help me?

Trying to practice using Channels and build a lil' webchat app but literally stuck at the get go. So started venv, installed django, installed channels and daphne, started project with django-admin.exe, andmodified asgi.py installed apps/asgi_installation in settings.py.

When I run:



/r/djangolearning
https://redd.it/12e36wx
Thoropass is hiring Engineers! (Django required)

Thoropass helps companies manage compliance, obtain security certifications, and build trust with enterprise customers.

​

**Senior Back End Software Engineer**
LatAm

**Staff Front End Software Engineer**
LatAm

/r/django
https://redd.it/12eznuk
Saturday Daily Thread: Resource Request and Sharing! Daily Thread

Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?

Use this thread to chat about and share Python resources!

/r/Python
https://redd.it/12f4hre
What recommendations for a frontend UI with Flask?

I'm building a website to play poker. I have all the game logic running behind in the backend, but need a good way to build a front end with images, animations, custom buttons.

Does anyone have a recommendation?

With a tutorial recommendation if possible too.

I am currently just styling my html page with css and divs etc.

/r/flask
https://redd.it/12f1v4o
model attribute in generics.ListView

At the very end of the 4th part of the Writing you first Django App tutorial, it states that both generic views, generic.ListView and generic.DetailView "needs to know what model it will be acting upon. This is provided using the model attribute." However for generic.ListView, I noticed it doesn't need the model attribute to be set to work properly. Is it setting the model through the get_queryset method?

/r/django
https://redd.it/12f7s78
Frontend for django

I know how to do the backend, but I don't know how to do the front. Am I correct in assuming that most pet projects start with the frontend? I know some js, should I start learning react?

/r/django
https://redd.it/12fku5j
INTERN

I am a student looking for an internship to validate my current year. I specialize in web development and have experience working with Django, Flask, and React. contact me at thabelkodjo@gmail.com

/r/flask
https://redd.it/12fqdk6
Django Exportmanager with Templates

Is there an easy solution to integrate an Exportmanager with Export-Templates in Django admin?
The user should create his own template for an CSV-Export. He choose the columns he want to export.
Also it should possible to save the template to reuse the custom Export the next time.

Does anybody know if there is an plugin for this?

/r/djangolearning
https://redd.it/12ftsh2
Port Issue

For Intro to Software Engineering class, deployed Flask App in Docker Container to Azure. Can connect on port 5000 (http://{ ipaddress}:5000) outside of university wifi network, but does not connect when within university wifi. Is this a port issue? Can someone suggest why this might be and what I may need to do to fix it? Thanks.

/r/flask
https://redd.it/12g547w
Trying to deploy a flask app to a custom domain

Hi friends, I’m still new to Python, but I made a simple flask app that I want to share with the world. I have a domain, and I hosting through Dreamhost. Ive looked around the internet for a tutorial or guide that can walk me through making it go live on my custom domain via Dreamhost. They have a tool called Passenger, specifically for Python and Ruby apps, but has anyone tried that? Any tips or youtube links you can point me to?
Would it be easier to add Wordpress to my domain and try to upload my flask app through that? Thanks

/r/flask
https://redd.it/12g0zp3
Can't assign variable in Jupyter

I'm new to learning python. I'm using jupyter notebook. But I'm unable to assigning variables. Everytime I assign variable it say variable in undefined. Can anyone help?

/r/JupyterNotebooks
https://redd.it/12fw11y
How to use Flask to check if files exist in existing Application

I have an application that fetches historical data from an api for and inputted date range. The application caches the data so that it can be used from the cache if desired. Now I need to write a flask app that checks if the data is in the cache, and if it isn't then fetch the data and cache. This is a stepping stone towards being able to use the flask app to run numerous requests at once but I am struggling to understand how I use flask at this stage. Many of the tutorials online seem to be focused on using flask for web applications and I am struggling to wrap my head around how to use flask for my challenge. Can anyone explain how flask would lend its self to my task, so that I can write the logic for it to check if the data is in the cache?

/r/flask
https://redd.it/12fjefs
Sunday Daily Thread: 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/12g2rk1
I want to create a website displaying tables/statistics similar to Basketball Reference. Does Django make sense?

So, I have a small league that I run with friends and I think it’d be cool to make a website for it.

I want it to have a table with stats for each player page like this

And one for each game like this

My ideal project is at a far smaller scale (like 100 individual games rather than 100k lol) and less complex (not as many variables and what not) but the structure is similar

So, a few questions:

- Is Django the right tool for something like this? Are there better options?

- My current skills are Python and basically nothing else. What is most important for me to learn? I assume SQL/MySQL to deal with the database (I just have csv files atm). Frontend perhaps too? Not sure how much of that can be avoided with templates and what not

- Given my lack of knowledge, is this perhaps too ambitious for a beginner?

/r/django
https://redd.it/12gb2z8
how to keep the front end and back end models in sync?

Hi all,

I am contemplating a mobile app with a flutter front end and DRF for back end. Coming from django templates, I never had to worry about duplicating the models. Are there any smart way to go DRY on this or is that a necessary evil?

I am conceptually attracted to server side rendering. Anyone has successfully implemented this on a mobile app?

Thanks

/r/django
https://redd.it/12gf5vo
what is the best way to send notification to a mobile app from django?

Hi there. I am working on a feature to send notification from django to a mobile app and I read about fcm-django, but I don't know if it is the best approach. what do you think? is there a better approach?

/r/django
https://redd.it/12giio8
How to test Absract Views in Django

Hello django fellas, i currently working and AbstractViews in Django that looks like this

 python
class MyAbstractView(AnotherAbstract):
argument1 = ...
argument2 = ...

def dispath():
...
def foo():
...
def bar():
...



how to test this ?

/r/django
https://redd.it/12gkkb3
Linode vs Render.com

I'm looking to deploy a Web Service with a Flask back-end. I want to hear from folks about their experience self-hosting with Linode vs. using Render.com, or other cloud hosting, with respect to utility and cost to both users and developers.

/r/flask
https://redd.it/12gndu7