Concepts/ideas to be known to make this Date and time selection for a django booking app.
I have here screenshots of a booking app that I like. I'll try to do it with django for learning. I'm still wondering if this functionality (see image), which is selecting date then it's respective time has something to do with django models (making time options for respective date in [models.py](https://models.py) ). I'm also thinking that this can be just done with javascript (but i don't know js).
Well i don't know what would be the best choice . Any ideas or terms that you can comment on how I could do it would be a great help for me.
I also looked for the DateTimePicker in django but i don't know if that can fit my need for this feature. I will surely appreciate your responses.
​
https://i.redd.it/bpwbzxygg3931.png
Just to show the full functionality of this app, I'll show this second screenshot. Once time and date has been selected, I'm planning to grab the employees from django models if they are free or not.
https://i.redd.it/o94awnpgh3931.png
/r/django
https://redd.it/cam82h
I have here screenshots of a booking app that I like. I'll try to do it with django for learning. I'm still wondering if this functionality (see image), which is selecting date then it's respective time has something to do with django models (making time options for respective date in [models.py](https://models.py) ). I'm also thinking that this can be just done with javascript (but i don't know js).
Well i don't know what would be the best choice . Any ideas or terms that you can comment on how I could do it would be a great help for me.
I also looked for the DateTimePicker in django but i don't know if that can fit my need for this feature. I will surely appreciate your responses.
​
https://i.redd.it/bpwbzxygg3931.png
Just to show the full functionality of this app, I'll show this second screenshot. Once time and date has been selected, I'm planning to grab the employees from django models if they are free or not.
https://i.redd.it/o94awnpgh3931.png
/r/django
https://redd.it/cam82h
Help with getting currently logged in user's ID in views.py query
I am using and if else logic statement in my [views.py](https://views.py) file to return on template if is true and one template if is false.
​
Here is my code so far which is working with the user ID hard coded, I just cant figure out how to get the current users ID. When I try self.request.user i get self is undefined or request is not defined
​
class uploadNew(CreateView): # new
model = beat
fields = ['title', 'beat']
success_url = reverse_lazy('uploads')
def get_queryset():
return beat.objects.filter(producer="2")
if get_queryset().count() <= 1:
template_name = 'uploadNew.html'
else:
template_name = 'home.html'
/r/django
https://redd.it/caoo05
I am using and if else logic statement in my [views.py](https://views.py) file to return on template if is true and one template if is false.
​
Here is my code so far which is working with the user ID hard coded, I just cant figure out how to get the current users ID. When I try self.request.user i get self is undefined or request is not defined
​
class uploadNew(CreateView): # new
model = beat
fields = ['title', 'beat']
success_url = reverse_lazy('uploads')
def get_queryset():
return beat.objects.filter(producer="2")
if get_queryset().count() <= 1:
template_name = 'uploadNew.html'
else:
template_name = 'home.html'
/r/django
https://redd.it/caoo05
The opensource DeepNude is now banned from GitHub
https://github.com/deepinstruction/deepnude_official
/r/Python
https://redd.it/cakxcw
https://github.com/deepinstruction/deepnude_official
/r/Python
https://redd.it/cakxcw
Python Insider: Python 3.7.4 is now available
https://blog.python.org/2019/07/python-374-is-now-available.html
/r/Python
https://redd.it/catyzx
https://blog.python.org/2019/07/python-374-is-now-available.html
/r/Python
https://redd.it/catyzx
blog.python.org
Python Insider: Python 3.7.4 is now available
Awesome free open source software for data pipeline testing: Great Expectations
Check out this OSS for data pipeline testing with a lot of solid documentation and also has an active slack channel.
[Website](https://greatexpectations.io/?utm_source=reddit&utm_medium=post&utm_name=user-testing&utm_content=ml-v1)
[Github](https://github.com/great-expectations/great_expectations)
[Hello world blog](https://medium.com/@expectgreatdata/down-with-pipeline-debt-introducing-great-expectations-862ddc46782a)
​
**Also---** We are looking for user testers to get some feedback. In exchange for feedback on our features beta data context, profiling, and data documentation features we want to provide you one on one video conference onboarding assistance to ensure successful integration with your project. Feel free to comment if you have any questions otherwise you can sign up here: [https://greatexpectations.typeform.com/to/mN4UdQ](https://greatexpectations.typeform.com/to/mN4UdQ)
/r/Python
https://redd.it/cao1ez
Check out this OSS for data pipeline testing with a lot of solid documentation and also has an active slack channel.
[Website](https://greatexpectations.io/?utm_source=reddit&utm_medium=post&utm_name=user-testing&utm_content=ml-v1)
[Github](https://github.com/great-expectations/great_expectations)
[Hello world blog](https://medium.com/@expectgreatdata/down-with-pipeline-debt-introducing-great-expectations-862ddc46782a)
​
**Also---** We are looking for user testers to get some feedback. In exchange for feedback on our features beta data context, profiling, and data documentation features we want to provide you one on one video conference onboarding assistance to ensure successful integration with your project. Feel free to comment if you have any questions otherwise you can sign up here: [https://greatexpectations.typeform.com/to/mN4UdQ](https://greatexpectations.typeform.com/to/mN4UdQ)
/r/Python
https://redd.it/cao1ez
greatexpectations.io
Great Expectations: have confidence in your data, no matter what
Explore how our end-to-end SaaS solution for your data quality process and unique Expectation-based approach to testing can help you build trust in your data.
I have a csv with 50k observations and I’m trying to drop every row that contains a “.” In it.
I’ve tried df[column].str.contains(“.”) but it doesn’t seem to work a Series structure. How would I go about removing those rows?
/r/Python
https://redd.it/camd7z
I’ve tried df[column].str.contains(“.”) but it doesn’t seem to work a Series structure. How would I go about removing those rows?
/r/Python
https://redd.it/camd7z
reddit
r/Python - I have a csv with 50k observations and I’m trying to drop every row that contains a “.” In it.
15 votes and 14 comments so far on Reddit
Class based views or function based views?
I want to have a functionality in my django app where a user fills in a form with data, then that data is passed into a function as parameters. From there, the parameters and some other generated values based on input parameters are inserted into multiple sql tables that belong to different models.
​
For now I want to create dummy values that I can pass as parameters and insert into separate tables to test if the function is working and storing data correctly. How should I approach this issue? ( I am a little new to Django)
Thanks in advance for all tips/suggestions!
/r/django
https://redd.it/caqo8r
I want to have a functionality in my django app where a user fills in a form with data, then that data is passed into a function as parameters. From there, the parameters and some other generated values based on input parameters are inserted into multiple sql tables that belong to different models.
​
For now I want to create dummy values that I can pass as parameters and insert into separate tables to test if the function is working and storing data correctly. How should I approach this issue? ( I am a little new to Django)
Thanks in advance for all tips/suggestions!
/r/django
https://redd.it/caqo8r
reddit
r/django - Class based views or function based views?
9 votes and 10 comments so far on Reddit
[Ask Flask] Anyone know the difference between using unittest.main() and using addTest(), then run(suite)?
Hi all, I am testing a flask app and have done this many times before, however this time it is different. I am using the following to run the tests:
suite = unittest.TestSuite()
player1 = dict(BasicTest.player_pairs[0]['player1']
player2 = dict(BasicTest.player_pairs[0]['player2']
suite.addTest(BasicTest('test_player1_loses_money', player1, player2)
runner = unittest.TextTestRunner(verbosity=2=3, failfast=True)
runner.run(suite)
I am doing the above because I will then call addTest() in a loop to test many pairs of players.
The problem is that requests seem to no longer work. I get timeout errors. I am getting exceptions within exceptions. EXCEPTION INCEPTION lol.
HTTPConnectionPool(host='159.89.146.74', port=7076): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f05222e9668>: Failed to establish a new connection: [Errno 110] Connection timed out',))
When I run my test regularly using unittest.main() everything works fine, but I want to run 1 test case many times with different pairs of players.
My flask app is just Restful endpoints and inside those endpoints, I make calls to external services.
Does anyone know why requests is broken when I use addTest() method? I feel like the error is very obscure, I tried looking at
/r/flask
https://redd.it/cavp4m
Hi all, I am testing a flask app and have done this many times before, however this time it is different. I am using the following to run the tests:
suite = unittest.TestSuite()
player1 = dict(BasicTest.player_pairs[0]['player1']
player2 = dict(BasicTest.player_pairs[0]['player2']
suite.addTest(BasicTest('test_player1_loses_money', player1, player2)
runner = unittest.TextTestRunner(verbosity=2=3, failfast=True)
runner.run(suite)
I am doing the above because I will then call addTest() in a loop to test many pairs of players.
The problem is that requests seem to no longer work. I get timeout errors. I am getting exceptions within exceptions. EXCEPTION INCEPTION lol.
HTTPConnectionPool(host='159.89.146.74', port=7076): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f05222e9668>: Failed to establish a new connection: [Errno 110] Connection timed out',))
When I run my test regularly using unittest.main() everything works fine, but I want to run 1 test case many times with different pairs of players.
My flask app is just Restful endpoints and inside those endpoints, I make calls to external services.
Does anyone know why requests is broken when I use addTest() method? I feel like the error is very obscure, I tried looking at
/r/flask
https://redd.it/cavp4m
reddit
r/flask - [Ask Flask] Anyone know the difference between using unittest.main() and using addTest(), then run(suite)?
6 votes and 2 comments so far on Reddit
Heroku/Postgres database migration to Flask
I have a postgres database with a table set up on heroku and I've loaded my data into the database via a csv file. I've been trying to migrate the data from my heroku/postgres database to my flask app and query through some of it but all the tutorials I've read through have me instantiating the database and table within the flask app itself. Is there a way I can query my existing database without having to recreate it within flask itself?
/r/flask
https://redd.it/cavbf4
I have a postgres database with a table set up on heroku and I've loaded my data into the database via a csv file. I've been trying to migrate the data from my heroku/postgres database to my flask app and query through some of it but all the tutorials I've read through have me instantiating the database and table within the flask app itself. Is there a way I can query my existing database without having to recreate it within flask itself?
/r/flask
https://redd.it/cavbf4
reddit
r/flask - Heroku/Postgres database migration to Flask
2 votes and 1 comment so far on Reddit
Built my first web app, tips for documentation?
Hi, I have built my very first blog app by following this tutorial: [Django | Corey MS](https://www.youtube.com/watch?v=UmljXZIypDc&list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p). I have no prior coding experience besides a basic knowledge of Python.
The site is done, and I am very happy with what I have achieved so far. All that is left is adding a few more bells and whistles to the front end, and deployment.
This is my very first Django project, and it has been a fantastic experience. But, I feel like I am losing track of things I have learned. The concepts are still clear, but a lot of techniques that I have learned (from big things like how to create a custom model to little things like how to add django pagination or how to use libraries like pillow) are already blurry or forgotten.
I still haven't learned to use Git. That is my next target.
What is the best way to create a repository of personal documentation that I can refer back to at any time and easily understand what was going on and how things came to be? Code hosting platforms(Github)? Jupyter Notebook? Plain pen and paper? Please don't laugh.
I have a lot of small personal Django projects lined up
/r/djangolearning
https://redd.it/cawjrn
Hi, I have built my very first blog app by following this tutorial: [Django | Corey MS](https://www.youtube.com/watch?v=UmljXZIypDc&list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p). I have no prior coding experience besides a basic knowledge of Python.
The site is done, and I am very happy with what I have achieved so far. All that is left is adding a few more bells and whistles to the front end, and deployment.
This is my very first Django project, and it has been a fantastic experience. But, I feel like I am losing track of things I have learned. The concepts are still clear, but a lot of techniques that I have learned (from big things like how to create a custom model to little things like how to add django pagination or how to use libraries like pillow) are already blurry or forgotten.
I still haven't learned to use Git. That is my next target.
What is the best way to create a repository of personal documentation that I can refer back to at any time and easily understand what was going on and how things came to be? Code hosting platforms(Github)? Jupyter Notebook? Plain pen and paper? Please don't laugh.
I have a lot of small personal Django projects lined up
/r/djangolearning
https://redd.it/cawjrn
YouTube
Python Django Tutorial: Full-Featured Web App Part 1 - Getting Started
In this Python Django Tutorial, we will be learning how to get started using the Django framework. We will install the necessary packages and get a basic application running in our browser. Let's get started...
The code for this series can be found at:
…
The code for this series can be found at:
…
[For Beginners] How Django REST Framework is advantageous over vanilla Django
https://medium.com/@raaj.akshar/why-django-rest-framework-is-needed-over-vanilla-django-fa16296b3477
/r/django
https://redd.it/cb2he8
https://medium.com/@raaj.akshar/why-django-rest-framework-is-needed-over-vanilla-django-fa16296b3477
/r/django
https://redd.it/cb2he8
Medium
How Django REST Framework is advantageous over Vanilla Django
In this post we address the following confusions:
Heroku Chatbot with Celery, WebSockets, and Redis.
https://medium.com/p/340fcd160f06
/r/django
https://redd.it/cb1lpf
https://medium.com/p/340fcd160f06
/r/django
https://redd.it/cb1lpf
Medium
Heroku Chatbot with Celery, WebSockets, and Redis.
Let’s create a Chatbot which can execute tasks asynchronously using Celery and communicate via WebSockets.
Best method to plot time of day independent of date?
I often work data that needs to be plotted by time of day with no regard for the date. Typically I'm just making simple scatter plots of values vs time of day. I have a lot of issues plotting this as actual time so I've been covering time to minutes past midnight for a smooth plot. I'm certain this isn't an affective strategy and . Do y'all have recommendations? Pandas datetime format seems to wreak havoc on any plots I make and always adds a date.
/r/pystats
https://redd.it/cb50kz
I often work data that needs to be plotted by time of day with no regard for the date. Typically I'm just making simple scatter plots of values vs time of day. I have a lot of issues plotting this as actual time so I've been covering time to minutes past midnight for a smooth plot. I'm certain this isn't an affective strategy and . Do y'all have recommendations? Pandas datetime format seems to wreak havoc on any plots I make and always adds a date.
/r/pystats
https://redd.it/cb50kz
reddit
r/pystats - Best method to plot time of day independent of date?
0 votes and 0 comments so far on Reddit
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/cb1d1q
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/cb1d1q
reddit
r/Python - What's everyone working on this week?
2 votes and 6 comments so far on Reddit
Flask Dashboard - Open-Source Boilerplates
https://dev.to/sm0ke/flask-dashboard-open-source-boilerplates-dkg
/r/flask
https://redd.it/caji9n
https://dev.to/sm0ke/flask-dashboard-open-source-boilerplates-dkg
/r/flask
https://redd.it/caji9n
DEV Community
Flask Dashboard - Open-Source Boilerplates
Open-Source Flask dashboards released under the MIT license.
Jupyter Notebook Doesn't Show Files When It Loads
I start up Jupyter Notebook using the Anaconda prompt, it loads, and there are no files shown. I also can't create new files through Jupyter. I've reinstalled the program, restarted my computer, reinstalled Anaconda; nothing is working. Please help.
/r/JupyterNotebooks
https://redd.it/cb4qde
I start up Jupyter Notebook using the Anaconda prompt, it loads, and there are no files shown. I also can't create new files through Jupyter. I've reinstalled the program, restarted my computer, reinstalled Anaconda; nothing is working. Please help.
/r/JupyterNotebooks
https://redd.it/cb4qde
reddit
r/JupyterNotebooks - Jupyter Notebook Doesn't Show Files When It Loads
1 vote and 1 comment so far on Reddit
allowed_hosts behind load balancer
What value can I set allowed_hosts to if my server(s) are behind a reverse proxy or load balancer? In particular, this is an Elastic Load Balancer, so the front-end IPs are dynamic.
I have * as the current setting.
/r/django
https://redd.it/cb6tcq
What value can I set allowed_hosts to if my server(s) are behind a reverse proxy or load balancer? In particular, this is an Elastic Load Balancer, so the front-end IPs are dynamic.
I have * as the current setting.
/r/django
https://redd.it/cb6tcq
reddit
r/django - allowed_hosts behind load balancer
2 votes and 2 comments so far on Reddit
CAN NOT serve website with Apache2
I have been stuck on this for over a week now. Nothing I do fixes this problem.
​
Basically, on my digital Ocean VPS I have my Django project. When I run the command "python3 [manage.py](https://manage.py) runserver [0.0.0.0:8000](https://0.0.0.0:8000)" it perfectly works. I can open my vps IP address at the port :8000 and it loads just fine.
However, when I try to serve it using Apache and I go on the IP address, I just get a page that says "Server Error (500)".
My config file looks [The same as this](https://github.com/CoreyMSchafer/code_snippets/blob/master/Django_Blog/snippets/django_project.conf) except filled in with the correct file paths.
​
I have set the permissions using chmod and :www-data according to like 5 different tutorials, none have changed anything. What do I do?
/r/django
https://redd.it/cbbhb2
I have been stuck on this for over a week now. Nothing I do fixes this problem.
​
Basically, on my digital Ocean VPS I have my Django project. When I run the command "python3 [manage.py](https://manage.py) runserver [0.0.0.0:8000](https://0.0.0.0:8000)" it perfectly works. I can open my vps IP address at the port :8000 and it loads just fine.
However, when I try to serve it using Apache and I go on the IP address, I just get a page that says "Server Error (500)".
My config file looks [The same as this](https://github.com/CoreyMSchafer/code_snippets/blob/master/Django_Blog/snippets/django_project.conf) except filled in with the correct file paths.
​
I have set the permissions using chmod and :www-data according to like 5 different tutorials, none have changed anything. What do I do?
/r/django
https://redd.it/cbbhb2