Can't access image from media loaction
Hello ,
I configured media location to keep images (like several times already) for a project i am currently working on.
just to add that current project i am using on top of [Django Dashboard AdminLTE](https://github.com/app-generator/django-dashboard-adminlte)
In addition i extended the user properties for user image , when i upload the user related image its loading correctly to the path designated , but when i using in HTML tag to show current user image , don't get anything html tag is
<img src="{ request.user.profile_image.url }" class="img-circle elevation-2" alt="User Image">
When i click show image its seems to follow the correct path but i get error that pic not found
I posted below my [settings.py](https://settings.py) and main [urls.py](https://urls.py) below , i run out of idea
Please advice
Thanks
​
https://preview.redd.it/ih2hbf1drwj51.jpg?width=674&format=pjpg&auto=webp&s=b74440430e9e6602ba254d34c43b87a284ab92f6
the settings file is looks like following
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config('DEBUG', default=False)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Static files (CSS, JavaScript, Images)
https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATIC_URL = '/static/'
Extra places for collectstatic to find static files.
STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'core/static'), )
#######################################################
#######################################################
/r/django
https://redd.it/iipg83
Hello ,
I configured media location to keep images (like several times already) for a project i am currently working on.
just to add that current project i am using on top of [Django Dashboard AdminLTE](https://github.com/app-generator/django-dashboard-adminlte)
In addition i extended the user properties for user image , when i upload the user related image its loading correctly to the path designated , but when i using in HTML tag to show current user image , don't get anything html tag is
<img src="{ request.user.profile_image.url }" class="img-circle elevation-2" alt="User Image">
When i click show image its seems to follow the correct path but i get error that pic not found
I posted below my [settings.py](https://settings.py) and main [urls.py](https://urls.py) below , i run out of idea
Please advice
Thanks
​
https://preview.redd.it/ih2hbf1drwj51.jpg?width=674&format=pjpg&auto=webp&s=b74440430e9e6602ba254d34c43b87a284ab92f6
the settings file is looks like following
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config('DEBUG', default=False)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Static files (CSS, JavaScript, Images)
https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATIC_URL = '/static/'
Extra places for collectstatic to find static files.
STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'core/static'), )
#######################################################
#######################################################
/r/django
https://redd.it/iipg83
GitHub
GitHub - app-generator/django-adminlte: AdminLTE Django - Open-source seed project | AppSeed
AdminLTE Django - Open-source seed project | AppSeed - GitHub - app-generator/django-adminlte: AdminLTE Django - Open-source seed project | AppSeed
Configure environment-specific settings in Django framework.
Wrote a short blog on implementing environment-specific settings in Django Framework. Hope this will be useful!
[https://thequickblog.com/how-to-configure-environment-specific-settings-in-python-django-framework/](https://thequickblog.com/how-to-configure-environment-specific-settings-in-python-django-framework/)
/r/django
https://redd.it/iip1eq
Wrote a short blog on implementing environment-specific settings in Django Framework. Hope this will be useful!
[https://thequickblog.com/how-to-configure-environment-specific-settings-in-python-django-framework/](https://thequickblog.com/how-to-configure-environment-specific-settings-in-python-django-framework/)
/r/django
https://redd.it/iip1eq
Tasks - is APScheduler better than Cron/Schedule modules?
I want the best one to automate a task, my function makes an API call every 15 minutes and saves data to csv and then calculates that CSV data to show on a chart. What task module would be the best in my case? APScheduler/Cron/Schedule/Celery?
PS: I'll be deploying to Heroku, so I'd appreciate anyone telling me about compatibility issues with Heroku.
/r/flask
https://redd.it/iiu14x
I want the best one to automate a task, my function makes an API call every 15 minutes and saves data to csv and then calculates that CSV data to show on a chart. What task module would be the best in my case? APScheduler/Cron/Schedule/Celery?
PS: I'll be deploying to Heroku, so I'd appreciate anyone telling me about compatibility issues with Heroku.
/r/flask
https://redd.it/iiu14x
reddit
Tasks - is APScheduler better than Cron/Schedule modules?
I want the best one to automate a task, my function makes an API call every 15 minutes and saves data to csv and then calculates that CSV data to...
'users.apps.AppConfig' must supply a name attribute
i am creating a blog with django . i created an app named users . and when i write python [manage.py](https://manage.py) runserver it gives me this eror . how can i fix this? ( i am newbie )
https://preview.redd.it/7k5a6mq60yj51.png?width=1363&format=png&auto=webp&s=b68fe40a64a135d3d451d57a15b37a10d4f96f2d
https://preview.redd.it/q99w71380yj51.png?width=1366&format=png&auto=webp&s=d4bf0a83ace26fd1dd4bc853c4a76d050d50f354
https://preview.redd.it/j9jgc7j80yj51.png?width=1362&format=png&auto=webp&s=f24fede528e7709870437d9c860a48f9f70fdb95
/r/django
https://redd.it/iisbkg
i am creating a blog with django . i created an app named users . and when i write python [manage.py](https://manage.py) runserver it gives me this eror . how can i fix this? ( i am newbie )
https://preview.redd.it/7k5a6mq60yj51.png?width=1363&format=png&auto=webp&s=b68fe40a64a135d3d451d57a15b37a10d4f96f2d
https://preview.redd.it/q99w71380yj51.png?width=1366&format=png&auto=webp&s=d4bf0a83ace26fd1dd4bc853c4a76d050d50f354
https://preview.redd.it/j9jgc7j80yj51.png?width=1362&format=png&auto=webp&s=f24fede528e7709870437d9c860a48f9f70fdb95
/r/django
https://redd.it/iisbkg
[D] Image Decomposition AI - Edit Highlights and Textures Easily
https://youtu.be/sdbMbMKTitM
/r/MachineLearning
https://redd.it/iioqk0
https://youtu.be/sdbMbMKTitM
/r/MachineLearning
https://redd.it/iioqk0
YouTube
Image Decomposition AI - Edit Highlights and Textures Easily [Appearance Eraser]
MATLAB is not free, unfortunately... But it is a great tool if it can be run on any systems easily! Another amazing work from lllyasviel. I sense this can be...
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
Why do I get this error sometimes? I even get it when I don't let my computer turn off/sleep or similar.
/r/JupyterNotebooks
https://redd.it/iirl50
Why do I get this error sometimes? I even get it when I don't let my computer turn off/sleep or similar.
/r/JupyterNotebooks
https://redd.it/iirl50
reddit
ConnectionAbortedError: [WinError 10053] An established connection...
Why do I get this error sometimes? I even get it when I don't let my computer turn off/sleep or similar.
Can passing Flask app context to multiple processes lead to problems while performing database operations using Flask-SQLAlchemy?
I am developing a backend which requires some processes to be spawned automatically, and constantly perform database operations from there. I am making use of the Flask SQLAlchemy ORM to interact with the database.
I was able to pass the 'app' variable as an argument to a new process, and perform DB operations from there. But the application requires several such processes to be running at once. Thus, several processes can be making database operations using the Flask app context, in addition to the APIs created inside of Flask itself. Can someone please tell me if this will lead to some sort of a conflict/error?
Thanks in advance!
/r/flask
https://redd.it/iiwc3t
I am developing a backend which requires some processes to be spawned automatically, and constantly perform database operations from there. I am making use of the Flask SQLAlchemy ORM to interact with the database.
I was able to pass the 'app' variable as an argument to a new process, and perform DB operations from there. But the application requires several such processes to be running at once. Thus, several processes can be making database operations using the Flask app context, in addition to the APIs created inside of Flask itself. Can someone please tell me if this will lead to some sort of a conflict/error?
Thanks in advance!
/r/flask
https://redd.it/iiwc3t
reddit
Can passing Flask app context to multiple processes lead to...
I am developing a backend which requires some processes to be spawned automatically, and constantly perform database operations from there. I am...
Long term impact of using UUID as a unique identifier for models
I am developing an app that enables users to post discussion questions and allows other users to react and rate the questions. However, instead of using pk or id to map question urls I'm thinking about creating unique ids for each question using UUID. This is to prevent users from both monitoring site usage and being able to quickly iterate through questions by incrementing id.
So far, I've decided to assign each question on creation a unique id: uuid.uuid4().hex\[:6\].upper(). However, I was wondering the long term effect of this implementation. Every time I create a new object, Django will have to iterate through all existing questions. Will this have a significant computational effect over time? If so, are there any other more efficient implementations of assigning unique ids? Perform some function on the id (but then wouldn't some original issues persist)?
/r/django
https://redd.it/ij0gp3
I am developing an app that enables users to post discussion questions and allows other users to react and rate the questions. However, instead of using pk or id to map question urls I'm thinking about creating unique ids for each question using UUID. This is to prevent users from both monitoring site usage and being able to quickly iterate through questions by incrementing id.
So far, I've decided to assign each question on creation a unique id: uuid.uuid4().hex\[:6\].upper(). However, I was wondering the long term effect of this implementation. Every time I create a new object, Django will have to iterate through all existing questions. Will this have a significant computational effect over time? If so, are there any other more efficient implementations of assigning unique ids? Perform some function on the id (but then wouldn't some original issues persist)?
/r/django
https://redd.it/ij0gp3
reddit
Long term impact of using UUID as a unique identifier for models
I am developing an app that enables users to post discussion questions and allows other users to react and rate the questions. However, instead of...
Sunday megathread: 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/ij317r
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/ij317r
reddit
Sunday megathread: 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...
I’m learning Python, but I also came across my dads old BASIC textbook. The problem solving aspect of the book is almost better than any modern one I’ve read.
/r/Python
https://redd.it/iix2ru
/r/Python
https://redd.it/iix2ru
I made an IMDB webscraper
So this is pretty beginner, but it's my first real project, and today I finished the first version of it. Without going into to much detail, the user pastes a link to IMDB and the program scrapes the shows, gets an average rating for each season, the entire show, creates a graph with the average of each season, and then shows the user IMDB's top 250 rated TV shows and gives them the option to search for a show and see if it's in the top 250. That's pretty simplified and I won't paste all 200+ lines of code but [here is the github](https://github.com/NerdyBread/IMDB-Webscraping) if anyone is interested. I'd love any feedback that anyone has, good or bad.
/r/Python
https://redd.it/iiu17w
So this is pretty beginner, but it's my first real project, and today I finished the first version of it. Without going into to much detail, the user pastes a link to IMDB and the program scrapes the shows, gets an average rating for each season, the entire show, creates a graph with the average of each season, and then shows the user IMDB's top 250 rated TV shows and gives them the option to search for a show and see if it's in the top 250. That's pretty simplified and I won't paste all 200+ lines of code but [here is the github](https://github.com/NerdyBread/IMDB-Webscraping) if anyone is interested. I'd love any feedback that anyone has, good or bad.
/r/Python
https://redd.it/iiu17w
GitHub
NerdyBread/IMDB-Webscraping
Contribute to NerdyBread/IMDB-Webscraping development by creating an account on GitHub.
How to use Django Model Managers? understanding the Django ORM
# Model managers, understanding the Django ORM
[A video in YouTube](https://preview.redd.it/gb9xndstl3k51.png?width=1280&format=png&auto=webp&s=962eb3a6e6e63e9e28d206348e2bd751e7f29171)
​
Hey guys, recently while working on a project I bumped into model managers. I knew they existed but didn't bother to learn more about them. But then I had to work with my own custom user models in Django.
So I plowed through the documentation and learned it all.
I prepared a video for anyone who intends to learn more about them :) Keep Learning!!!
Link to video-
[How to use Django Model Managers?](https://youtu.be/gxeCoRr5zL8)
/r/Python
https://redd.it/ij9dm0
# Model managers, understanding the Django ORM
[A video in YouTube](https://preview.redd.it/gb9xndstl3k51.png?width=1280&format=png&auto=webp&s=962eb3a6e6e63e9e28d206348e2bd751e7f29171)
​
Hey guys, recently while working on a project I bumped into model managers. I knew they existed but didn't bother to learn more about them. But then I had to work with my own custom user models in Django.
So I plowed through the documentation and learned it all.
I prepared a video for anyone who intends to learn more about them :) Keep Learning!!!
Link to video-
[How to use Django Model Managers?](https://youtu.be/gxeCoRr5zL8)
/r/Python
https://redd.it/ij9dm0
How do I optimise my Django project for speed and performance?
Hey guys, hope you are all doing well. I recently deployed a django app to Heroku and it is super slow (5 - 6 seconds on average for a page), in part because I live in India and that's also where the majority of my users are. However, I recently tried shifting my site to AWS Lambda on the Mumbai server, which resulted in RELATIVELY faster load times (2 - 3 seconds for non database pages; pages that fetch stuff from the database are approximately the same if not even slower). This led me to believe that my site may be genuinely slow because the code isn't very efficient. To confirm this, I tested the response times locally using Google Chrome Dev tools. Sure enough, the site pages were taking 1 - 2 seconds on avg. to load locally. For comparison, I also checked the response time locally for a django blog project I had done earlier, and it was around 100 - 200 milliseconds. My current Django app is actually a marketplace, and is a fair bit more complicated than the blog, but it still shouldn't be 10X slower. Any tips on how I can make it faster /
/r/django
https://redd.it/ij6ud0
Hey guys, hope you are all doing well. I recently deployed a django app to Heroku and it is super slow (5 - 6 seconds on average for a page), in part because I live in India and that's also where the majority of my users are. However, I recently tried shifting my site to AWS Lambda on the Mumbai server, which resulted in RELATIVELY faster load times (2 - 3 seconds for non database pages; pages that fetch stuff from the database are approximately the same if not even slower). This led me to believe that my site may be genuinely slow because the code isn't very efficient. To confirm this, I tested the response times locally using Google Chrome Dev tools. Sure enough, the site pages were taking 1 - 2 seconds on avg. to load locally. For comparison, I also checked the response time locally for a django blog project I had done earlier, and it was around 100 - 200 milliseconds. My current Django app is actually a marketplace, and is a fair bit more complicated than the blog, but it still shouldn't be 10X slower. Any tips on how I can make it faster /
/r/django
https://redd.it/ij6ud0
reddit
How do I optimise my Django project for speed and performance?
Hey guys, hope you are all doing well. I recently deployed a django app to Heroku and it is super slow (5 - 6 seconds on average for a page), in...
Python - Date format Part-1
https://www.youtube.com/watch?v=3ZgnxXLqhkg&feature=share
/r/Python
https://redd.it/ij7pny
https://www.youtube.com/watch?v=3ZgnxXLqhkg&feature=share
/r/Python
https://redd.it/ij7pny
YouTube
Python - Date format Part-1
#Python #Python3 #DateFunction #DateInPython #DateFormats
Date function one of the most widely used functions in Python. Python provides the different libraries to find the date and time in different formats. This video deals with the date function in Python…
Date function one of the most widely used functions in Python. Python provides the different libraries to find the date and time in different formats. This video deals with the date function in Python…
How to integrate a machine learning model from Azure?
I built a machine learning model on Azure platform and want to connect it to the web app using Dash(which is built upon Flask) and the model changes continuously with the data. How do I connect the ml model with the web app?
/r/flask
https://redd.it/ij8ai0
I built a machine learning model on Azure platform and want to connect it to the web app using Dash(which is built upon Flask) and the model changes continuously with the data. How do I connect the ml model with the web app?
/r/flask
https://redd.it/ij8ai0
reddit
How to integrate a machine learning model from Azure?
I built a machine learning model on Azure platform and want to connect it to the web app using Dash(which is built upon Flask) and the model...
PyCon India 2020!
Ticket sales for PyConIndia2020 are open.
Rush to get your ticket: [https://in.pycon.org/2020/#ticket](https://in.pycon.org/2020/#ticket)
PyCon India is the annual gathering of Pythonistas, run by the Indian Python community, to foster adoption of the Python programming language.
With over 250+ proposals coming in globally, job board, workshops, dev sprints, and networking opportunities. This year PyCon India 2020 is set to be the biggest one yet.
We will be having a job board where you can find exciting job openings from various companies that uses Python and related technologies in various domains like web, infra, security, embedded, or data science.
No matter if you are a student, someone who is just starting out with Python, a seasoned programmer, or looking for your first programming gig there is something for all.
To make the event inclusive and accessible to all, we have kept the ticket prices to a bare minimum of 199 INR, or roughly 2.68 USD.
Regards,
On Behalf of PyCon India Organising Team
https://preview.redd.it/2owzws0q06k51.jpg?width=1280&format=pjpg&auto=webp&s=27d11d5f1b1e20d61a748801798628c6eabf93b8
/r/flask
https://redd.it/ijfczy
Ticket sales for PyConIndia2020 are open.
Rush to get your ticket: [https://in.pycon.org/2020/#ticket](https://in.pycon.org/2020/#ticket)
PyCon India is the annual gathering of Pythonistas, run by the Indian Python community, to foster adoption of the Python programming language.
With over 250+ proposals coming in globally, job board, workshops, dev sprints, and networking opportunities. This year PyCon India 2020 is set to be the biggest one yet.
We will be having a job board where you can find exciting job openings from various companies that uses Python and related technologies in various domains like web, infra, security, embedded, or data science.
No matter if you are a student, someone who is just starting out with Python, a seasoned programmer, or looking for your first programming gig there is something for all.
To make the event inclusive and accessible to all, we have kept the ticket prices to a bare minimum of 199 INR, or roughly 2.68 USD.
Regards,
On Behalf of PyCon India Organising Team
https://preview.redd.it/2owzws0q06k51.jpg?width=1280&format=pjpg&auto=webp&s=27d11d5f1b1e20d61a748801798628c6eabf93b8
/r/flask
https://redd.it/ijfczy
Jupyter notebook on tablet?
Is there such a thing? I am on android. I am not necessarily looking to install a native android app. Just the web version isn't easy to use on tablet. Like how do you even alt-enter or ctrl-enter on a tablet keyboard?
Maybe not even the full functionality of jupyter but is there a mobile website for such a thing?
/r/JupyterNotebooks
https://redd.it/ij7hj6
Is there such a thing? I am on android. I am not necessarily looking to install a native android app. Just the web version isn't easy to use on tablet. Like how do you even alt-enter or ctrl-enter on a tablet keyboard?
Maybe not even the full functionality of jupyter but is there a mobile website for such a thing?
/r/JupyterNotebooks
https://redd.it/ij7hj6
reddit
Jupyter notebook on tablet?
Is there such a thing? I am on android. I am not necessarily looking to install a native android app. Just the web version isn't easy to use on...
How Django Model Managers work? Keep Learning!!!
https://youtu.be/gxeCoRr5zL8
/r/django
https://redd.it/ij95rl
https://youtu.be/gxeCoRr5zL8
/r/django
https://redd.it/ij95rl
YouTube
Django Model Managers | Advanced Django ORM | Custom Model Managers
Django model manager
It is a python class that handles the database operations of a model.
In this video, we are going to learn how the Django ORM works under the hood and how the model managers work ?
We will also learn how to make your own model managers.…
It is a python class that handles the database operations of a model.
In this video, we are going to learn how the Django ORM works under the hood and how the model managers work ?
We will also learn how to make your own model managers.…
I made a terminal-based presentation tool with colors and effects!
Hey everyone, I made `present` which is a terminal-based presentation tool with some extra goodies! You can write slides using Markdown (I also plan to add Jupyter notebook support) and also play codios (pre-recorded playable code blocks) which can be useful for live demos! Here's the [code on Github](https://github.com/vinayak-mehta/present). And here's a demo:
​
https://i.redd.it/ei6flui6i5k51.gif
/r/Python
https://redd.it/ijdmca
Hey everyone, I made `present` which is a terminal-based presentation tool with some extra goodies! You can write slides using Markdown (I also plan to add Jupyter notebook support) and also play codios (pre-recorded playable code blocks) which can be useful for live demos! Here's the [code on Github](https://github.com/vinayak-mehta/present). And here's a demo:
​
https://i.redd.it/ei6flui6i5k51.gif
/r/Python
https://redd.it/ijdmca
GitHub
GitHub - vinayak-mehta/present: A terminal-based presentation tool with colors and effects.
A terminal-based presentation tool with colors and effects. - vinayak-mehta/present