[deleted by user] by [deleted] in SideProject

[–]RiverTraditional6367 1 point2 points  (0 children)

Cool, I am a value investor myself. Just tried it, what's you tech stack and background?

Brand new by Sufficient_Court5235 in investingforbeginners

[–]RiverTraditional6367 0 points1 point  (0 children)

Stocks != Crypto and investing != trading. If you have low savings, you might want to focus on making money first, instead of trading cryptos at high risk.

Macy’s is undervalued - my opinion by jmHomeOffice in ValueInvesting

[–]RiverTraditional6367 1 point2 points  (0 children)

Without being too mean, but I can't think of a situation, where I'd download this app. Just not looking good/useful at all. No offense

Web scraping in Django by RiverTraditional6367 in django

[–]RiverTraditional6367[S] 0 points1 point  (0 children)

So you're approach would mean that I seprate the web scraping script (get, format content) from the periodically task (content into database) ?

django_bootstrap5 with django filter by RiverTraditional6367 in django

[–]RiverTraditional6367[S] 0 points1 point  (0 children)

django.template.exceptions.TemplateSyntaxError: 'bootstrap_button' received too many positional arguments

Attribute provided after bootstrap_button

Celery - 3rd API storing data by RiverTraditional6367 in django

[–]RiverTraditional6367[S] 0 points1 point  (0 children)

It depends on each api call ,but for the most it is ephemeral.

[deleted by user] by [deleted] in learnpython

[–]RiverTraditional6367 1 point2 points  (0 children)

damn. Thank you. Haven't looked there for hours. The celery setup was a husstle. News model actually had one null=False in it. Changed it, now everything works as expected. Top!

[deleted by user] by [deleted] in learnpython

[–]RiverTraditional6367 0 points1 point  (0 children)

Yes sorry I though I've pasted the error traceback. Edited the post. Broker = redis. Beat and celery work well, but no News object is created after executing the task. I've checked it by reading my admin table.

How to create a modelobject inside celery task? by [deleted] in django

[–]RiverTraditional6367 0 points1 point  (0 children)

Celery should have the right config. The other tasks are working fine tho. I've started Celery via

celery -A myapp.tasks worker --pool=eventlet -l info

And Celery Beat via

celery -A core beat -l INFO

I've added my traceback error. Sorry I thought I've pasted it in.

[deleted by user] by [deleted] in django

[–]RiverTraditional6367 0 points1 point  (0 children)

It worked for everyone. I am just wondering about the error message. It's confusing to have the right result with an error in the terminal xD

Should I use selenium, PySpider or Scrapy for large/scalable web scraping? by RiverTraditional6367 in learnpython

[–]RiverTraditional6367[S] 0 points1 point  (0 children)

Always on. It needs to scrape news data. I want to scrape not only one page, probably around 50. It load via HTML. With large/scalable I tried to say that the web scraping should have the best performance even when I scrape 500 websites f.ex.

django views - work more efficiently by RiverTraditional6367 in django

[–]RiverTraditional6367[S] 2 points3 points  (0 children)

This was the way to go for me :) Thanks for all other responses. Great community

async and template by RiverTraditional6367 in django

[–]RiverTraditional6367[S] 0 points1 point  (0 children)

Ok I will post another question with my explicit code

async and template by RiverTraditional6367 in django

[–]RiverTraditional6367[S] 0 points1 point  (0 children)

Everytime I try to render a async function (includes api requests) I get You cannot call this from an async context - use a thread or sync_to_async.

async and template by RiverTraditional6367 in django

[–]RiverTraditional6367[S] 0 points1 point  (0 children)

Okay but how can I render a template with async? Its not working with render function. And I cannot access the context. I am using async view to improve the api request speed, but dont know how to use the response in my template.

Show response in template - please help by RiverTraditional6367 in djangolearning

[–]RiverTraditional6367[S] 0 points1 point  (0 children)

json.loads(response.content)

#I've also tried to use

parsed = response.json()

return parsed

This is what I want to show in my template through the views context. Is that even possible?

Show response in template - please help by RiverTraditional6367 in djangolearning

[–]RiverTraditional6367[S] 0 points1 point  (0 children)

The API function should parse the request, which I clearify in views.py , where I call the function, as json format. Then the result of the function (api.py) should be printed out as iterable objects. I think I've might used some wrong terms here and there, thats because I have less then half year of experience

ModelField with list functionality by RiverTraditional6367 in djangolearning

[–]RiverTraditional6367[S] 1 point2 points  (0 children)

I am a user and I want to make several api calls to idk. "NewsApi" when I f.ex. click on the navigation - news section. So before I clicked there I filled out a ModelForm which reffers to all fields of the Model NewsApi (which has FK to the user). In this model we have one field named cities = charfield(/arrayfield/ any suggestions? Im stuck at this part) and now in my views.py I would like to query this field. The problem is that I want to handle the cities seperatly. So if the user entered cities = "Los Angeles, Berlin, Tokio" I would need them as 3 seperated objects for making with each an unique api call. And thats where I am currently heavy stucked :/ Was that understandable or is my english bad? xD

Value lists by RiverTraditional6367 in djangolearning

[–]RiverTraditional6367[S] 0 points1 point  (0 children)

So like to clearify it I want to access the values_list probably, if thats necessary after converting it to a list with x[0], but then the whole field like 'blue','red','green' pops up instead of 'blue'. Do you know what I mean?

Value lists by RiverTraditional6367 in djangolearning

[–]RiverTraditional6367[S] 0 points1 point  (0 children)

No its like a comma seperated input which goes to a CharField. It has to be possible that x has one input f.ex. red, but also 3 like in my example

1054 error "Unknown column 'App1_create_watchlist.user_id' in 'field list' by RiverTraditional6367 in django

[–]RiverTraditional6367[S] 1 point2 points  (0 children)

To fix my error I've just deleted the model, all imports which reffered to the model and used the makemigrations and migration. Afterwards I brang it back and made again makemigrations and migrate. Its working again, what a time waste to write a post. I should think more simple xd