Should I move from 1.11 to 2 before deploying on a server ?
I have almost finished a Django project I have been developing. I have started on 1.11 but now I see that there is Django 2.
I am wondering if I should move to Django 2 before putting my project on a server.
/r/django
https://redd.it/7ou5sm
I have almost finished a Django project I have been developing. I have started on 1.11 but now I see that there is Django 2.
I am wondering if I should move to Django 2 before putting my project on a server.
/r/django
https://redd.it/7ou5sm
reddit
Should I move from 1.11 to 2 before deploying on a server ? • r/django
I have almost finished a Django project I have been developing. I have started on 1.11 but now I see that there is Django 2. I am wondering if I...
How do I use Django to execute PostGIS query to get polygons within four points?
https://gis.stackexchange.com/questions/267147/how-do-i-use-django-to-execute-postgis-query-to-get-polygons-within-four-points
/r/django
https://redd.it/7omym5
https://gis.stackexchange.com/questions/267147/how-do-i-use-django-to-execute-postgis-query-to-get-polygons-within-four-points
/r/django
https://redd.it/7omym5
Geographic Information Systems Stack Exchange
How do I use Django to execute PostGIS query to get polygons within four points?
Here's a sample PostGIS query I use to get geometries within four points:
SELECT *
FROM myTable
WHERE ST_MakeEnvelope(-97.82381347656252, 30.250444940663296, -97.65901855468752, 30.29595835209862,...
SELECT *
FROM myTable
WHERE ST_MakeEnvelope(-97.82381347656252, 30.250444940663296, -97.65901855468752, 30.29595835209862,...
Making a currency/point system for a site?
Hey my friends and I are often betting on stuff (like who will win a football game or who will get drunk first) so I thought I would make something like a 'betting' app for us to bet like 2 points/coin on something. Does anyone know how to make currency or point systems and or a betting system?
/r/django
https://redd.it/7ojing
Hey my friends and I are often betting on stuff (like who will win a football game or who will get drunk first) so I thought I would make something like a 'betting' app for us to bet like 2 points/coin on something. Does anyone know how to make currency or point systems and or a betting system?
/r/django
https://redd.it/7ojing
reddit
Making a currency/point system for a site? • r/django
Hey my friends and I are often betting on stuff (like who will win a football game or who will get drunk first) so I thought I would make...
Why is git push heroku master not working in this situation?
Im tryin to push django project i have on git.
I created runtime.txt file in root direcotry with the text 'python-3.4.0'
I also created Pocfile with the text 'web: gunicorn mb_project.wsgi --log-file -'
I have no idea why is this not working, checked a lot of threads on quora and stackoverflow... MAybe heroku doesnt like python 3.4.0 ? But i changed it to 3.6.3 and i still got the same error
/r/django
https://redd.it/7okffi
Im tryin to push django project i have on git.
I created runtime.txt file in root direcotry with the text 'python-3.4.0'
I also created Pocfile with the text 'web: gunicorn mb_project.wsgi --log-file -'
I have no idea why is this not working, checked a lot of threads on quora and stackoverflow... MAybe heroku doesnt like python 3.4.0 ? But i changed it to 3.6.3 and i still got the same error
/r/django
https://redd.it/7okffi
reddit
Why is git push heroku master not working in this... • r/django
Im tryin to push django project i have on git. I created runtime.txt file in root direcotry with the text 'python-3.4.0' I also created Pocfile...
Bonobo: Lightweight ETL Toolkit for Python 3 (Interview)
https://www.podcastinit.com/bonobo-with-romain-dorgueil-episode-143/
/r/Python
https://redd.it/7oxn08
https://www.podcastinit.com/bonobo-with-romain-dorgueil-episode-143/
/r/Python
https://redd.it/7oxn08
Podcast.__init__('Python')
Bonobo: Lightweight ETL Toolkit for Python 3 with Romain Dorgueil – Episode 143
A majority of the work that we do as programmers involves data manipulation in some manner. This can range from large scale collection, aggregation, and statistical analysis across distrbuted systems, or it can be as simple as making a graph in a spreadsheet.…
Seeking advice on putting together the model structure for a 1-to-1 chat using Channels.
I'm struggling with implementing the data structure for a chat system. I've looked through most of the popular tutorials but I'm still having trouble applying it to my own use-case.
I am looking to allow a chat system similar in structure(not UI) to facebook or AIM from back in the day--one on one messaging, with message persistence, and a user able to have many chats.
The tutorials I've looked through have conflicting suggestions.
Given that I already have a model called `Pair` which has two `ForeignKeys`, named `requester` and `accepter`, each pointing to a `User`, how might I structure the messages or rooms around this `Pair`? (structuring around `Pair` isn't mandatory, I just thought it may be convenient)
What I've brainstormed:
1) Have a single `Room` model with a FK to the `Pair` model, and two TextFields for the messages: `to_accepter` & `from_accepter` to denote the messages belonging to the appropriate user.
2) Have a `Room` model and a separate `Message` model. The message will have an FK to the room, and have fields: `sent_from`(message sender), a timestamp(to eventually organize the list of displayed messages, and the TextField.
Is there an ideal way to go about this? I'm open to any suggestion.
Thanks in advance.
/r/django
https://redd.it/7ob65e
I'm struggling with implementing the data structure for a chat system. I've looked through most of the popular tutorials but I'm still having trouble applying it to my own use-case.
I am looking to allow a chat system similar in structure(not UI) to facebook or AIM from back in the day--one on one messaging, with message persistence, and a user able to have many chats.
The tutorials I've looked through have conflicting suggestions.
Given that I already have a model called `Pair` which has two `ForeignKeys`, named `requester` and `accepter`, each pointing to a `User`, how might I structure the messages or rooms around this `Pair`? (structuring around `Pair` isn't mandatory, I just thought it may be convenient)
What I've brainstormed:
1) Have a single `Room` model with a FK to the `Pair` model, and two TextFields for the messages: `to_accepter` & `from_accepter` to denote the messages belonging to the appropriate user.
2) Have a `Room` model and a separate `Message` model. The message will have an FK to the room, and have fields: `sent_from`(message sender), a timestamp(to eventually organize the list of displayed messages, and the TextField.
Is there an ideal way to go about this? I'm open to any suggestion.
Thanks in advance.
/r/django
https://redd.it/7ob65e
reddit
Seeking advice on putting together the model structure... • r/django
I'm struggling with implementing the data structure for a chat system. I've looked through most of the popular tutorials but I'm still having...
Issues on the development of a Flask API service that loop through data sources, cache the data, and give rapid feedback on a query.
https://stackoverflow.com/questions/48154467/python-flask-api-service-loop-trough-api-data-sources-cache-and-give-rapid
/r/flask
https://redd.it/7ozxts
https://stackoverflow.com/questions/48154467/python-flask-api-service-loop-trough-api-data-sources-cache-and-give-rapid
/r/flask
https://redd.it/7ozxts
Stackoverflow
Python - Flask API service - Loop trough API data sources, cache, and give rapid feedback on call
I'm trying to develop an API service that after collecting data continuously from different sources, elaborate that data, and keep that information ready from being requested from another service. ...
Redefining or updating a migrated model
I find myself modifying and changing features on some of my models often and sometimes get this message because I changed a foreign key:
You are trying to add a non-nullable field 'client' to env_contact without a default;
we can't do that (the database needs something to populate existing rows).
Please select a fix:
1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
2) Quit, and let me add a default in models.py
Usually I have mock data or no data in these tables. Is there a way to delete the tables and migrations and redefine the model from scratch without doing a data dump, nuking the db and then resetting the models?
/r/djangolearning
https://redd.it/7p0yas
I find myself modifying and changing features on some of my models often and sometimes get this message because I changed a foreign key:
You are trying to add a non-nullable field 'client' to env_contact without a default;
we can't do that (the database needs something to populate existing rows).
Please select a fix:
1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
2) Quit, and let me add a default in models.py
Usually I have mock data or no data in these tables. Is there a way to delete the tables and migrations and redefine the model from scratch without doing a data dump, nuking the db and then resetting the models?
/r/djangolearning
https://redd.it/7p0yas
reddit
Redefining or updating a migrated model • r/djangolearning
I find myself modifying and changing features on some of my models often and sometimes get this message because I changed a foreign key: You...
[Blog series] Django, GraphQL & React
Hello,
I wrote a blog series where I connect django app to react & relay using GraphQL. All comments welcome!
Links: https://krzysztofzuraw.com/blog/2017/django-graphql-react-part-one.html (at the bottom of the post you can find link to next blog post in the series).
/r/django
https://redd.it/7p1v76
Hello,
I wrote a blog series where I connect django app to react & relay using GraphQL. All comments welcome!
Links: https://krzysztofzuraw.com/blog/2017/django-graphql-react-part-one.html (at the bottom of the post you can find link to next blog post in the series).
/r/django
https://redd.it/7p1v76
Krzysztofzuraw
Django, GraphQL & React - part one | Krzysztof Żuraw
Hello! Welcome back after a little break - I recently started working
on a project that uses GraphQL. Thant’s why I thought that it will be…
on a project that uses GraphQL. Thant’s why I thought that it will be…
Qgrid 1.0 - An interactive grid for sorting, filtering, and editing pandas DataFrames in Jupyter Notebook
https://github.com/quantopian/qgrid#qgrid
/r/IPython
https://redd.it/7p37x8
https://github.com/quantopian/qgrid#qgrid
/r/IPython
https://redd.it/7p37x8
GitHub
GitHub - quantopian/qgrid: An interactive grid for sorting, filtering, and editing DataFrames in Jupyter notebooks
An interactive grid for sorting, filtering, and editing DataFrames in Jupyter notebooks - quantopian/qgrid
Where do I find projects to contribute to as a beginner?
I am new to Python and would like to work with others, but I don't know where I can find projects that match my skill level.
/r/Python
https://redd.it/7p1ltq
I am new to Python and would like to work with others, but I don't know where I can find projects that match my skill level.
/r/Python
https://redd.it/7p1ltq
reddit
Where do I find projects to contribute to as a beginner? • r/Python
I am new to Python and would like to work with others, but I don't know where I can find projects that match my skill level.
Having trouble with static files in a docker-django build on the Docker Toolkit
Posting this in both Django and Docker subs. I have tried a lot of combinations of setting static_url/dirs/and roots but so far no luck. File structure is wonky but I think it's right:
-US
--Static
---USApp
----/style.css
--USPro
---settings.py
end of my settings file currently looks like this:
STATIC_URL = '/Static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "Static/USApp"),
]
STATIC_ROOT = "/US/Static/USApp/"
any help would be greatly appreciated!
/r/django
https://redd.it/7p49sj
Posting this in both Django and Docker subs. I have tried a lot of combinations of setting static_url/dirs/and roots but so far no luck. File structure is wonky but I think it's right:
-US
--Static
---USApp
----/style.css
--USPro
---settings.py
end of my settings file currently looks like this:
STATIC_URL = '/Static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "Static/USApp"),
]
STATIC_ROOT = "/US/Static/USApp/"
any help would be greatly appreciated!
/r/django
https://redd.it/7p49sj
reddit
Having trouble with static files in a docker-django... • r/django
Posting this in both Django and Docker subs. I have tried a lot of combinations of setting static_url/dirs/and roots but so far no luck. File...
Qgrid 1.0 - An interactive grid for sorting, filtering, and editing pandas DataFrames in Jupyter Notebook
https://github.com/quantopian/qgrid#qgrid
/r/Python
https://redd.it/7p3g4t
https://github.com/quantopian/qgrid#qgrid
/r/Python
https://redd.it/7p3g4t
GitHub
GitHub - quantopian/qgrid: An interactive grid for sorting, filtering, and editing DataFrames in Jupyter notebooks
An interactive grid for sorting, filtering, and editing DataFrames in Jupyter notebooks - quantopian/qgrid
Ask Anything Monday - Weekly Thread
https://www.reddit.com/r/learnpython/comments/7oukzv/ask_anything_monday_weekly_thread/
/r/flask
https://redd.it/7p5k3l
https://www.reddit.com/r/learnpython/comments/7oukzv/ask_anything_monday_weekly_thread/
/r/flask
https://redd.it/7p5k3l
reddit
Ask Anything Monday - Weekly Thread • r/learnpython
Welcome to another /r/learnPython weekly "Ask Anything* Monday" thread Here you can ask all the questions that you wanted to ask but didn't feel...
Index page contains data only on first visit; refresh and subsequent visits are empty
Hello all and thanks for taking time to read into this issue I'm having.
I have a small web app that is passing an object to my index page, the index page loops and renders the object into a nice pretty table.
Here is my route:
@app.route('/', methods=['GET'])
def index():
return render_template('index.html', cursor=cursor, current_time=datetime.utcnow())
the "cursor" object is really a mongodb query that was created just above the route descriptor:
cursor = db.ipv4.find().sort([("prefix", 1), ("prefixLen", -1)])
This is ran through the index.html page's template, which looks like this:
{% for route in cursor %}
<tr>
<td>{{ route.prefix }}</td>
<td>{{ route.prefixLen }}</td>
<td>{{ route.aspath }}</td>
</tr>
{% endfor %}
The result is a beautiful table of my previous IPv4 unicast table, and it renders great, but only once! Any second visitor or a refresh to the page shows that there are no rows rendered for my table (looking at the page's source).
My theory is that there is something that I'm missing when passing the cursor variable into the view function, something that currently limits it to run just once. I am new to Flask so it is likely that I am mistaken and would greatly appreciate any pointers.
/r/flask
https://redd.it/7p1tma
Hello all and thanks for taking time to read into this issue I'm having.
I have a small web app that is passing an object to my index page, the index page loops and renders the object into a nice pretty table.
Here is my route:
@app.route('/', methods=['GET'])
def index():
return render_template('index.html', cursor=cursor, current_time=datetime.utcnow())
the "cursor" object is really a mongodb query that was created just above the route descriptor:
cursor = db.ipv4.find().sort([("prefix", 1), ("prefixLen", -1)])
This is ran through the index.html page's template, which looks like this:
{% for route in cursor %}
<tr>
<td>{{ route.prefix }}</td>
<td>{{ route.prefixLen }}</td>
<td>{{ route.aspath }}</td>
</tr>
{% endfor %}
The result is a beautiful table of my previous IPv4 unicast table, and it renders great, but only once! Any second visitor or a refresh to the page shows that there are no rows rendered for my table (looking at the page's source).
My theory is that there is something that I'm missing when passing the cursor variable into the view function, something that currently limits it to run just once. I am new to Flask so it is likely that I am mistaken and would greatly appreciate any pointers.
/r/flask
https://redd.it/7p1tma
reddit
Index page contains data only on first visit; refresh... • r/flask
Hello all and thanks for taking time to read into this issue I'm having. I have a small web app that is passing an object to my index page, the...
Index page contains data only on first visit; refresh and subsequent visits are empty
https://www.reddit.com/r/flask/comments/7p1tma/index_page_contains_data_only_on_first_visit/
/r/pystats
https://redd.it/7p4d6b
https://www.reddit.com/r/flask/comments/7p1tma/index_page_contains_data_only_on_first_visit/
/r/pystats
https://redd.it/7p4d6b
reddit
Index page contains data only on first visit; refresh... • r/flask
Hello all and thanks for taking time to read into this issue I'm having. I have a small web app that is passing an object to my index page, the...
A little library for making simple Electron-like HTML/JS GUI apps
https://github.com/ChrisKnott/Eel
/r/Python
https://redd.it/7p5x97
https://github.com/ChrisKnott/Eel
/r/Python
https://redd.it/7p5x97
GitHub
GitHub - python-eel/Eel: A little Python library for making simple Electron-like HTML/JS GUI apps
A little Python library for making simple Electron-like HTML/JS GUI apps - python-eel/Eel
A little library for making simple Electron-like HTML/JS GUI apps
https://github.com/ChrisKnott/Eel
/r/Python
https://redd.it/7p5x97
https://github.com/ChrisKnott/Eel
/r/Python
https://redd.it/7p5x97
GitHub
GitHub - python-eel/Eel: A little Python library for making simple Electron-like HTML/JS GUI apps
A little Python library for making simple Electron-like HTML/JS GUI apps - python-eel/Eel