I am using scrapy to scrape some data. But I want to use it with django for user interface and to save the data to database. Also I want to know how can I upload it to heroku
I think what you can look into is this django project which has scrapy embedded in it. You will have to figure out the part of deploying this to heroku.
https://github.com/bipul21/scrapy_django
http://bipuljain.com/blog/using-scrapy-with-django-14
Related
For example, when I would create a ruby and react app. I could run the ruby app on local.host:3000 and the react app on local.host:4000. With some configuration, I could fetch information from my ruby backend and send information from by react frontend.
Currently, I am working on building a bot on discord, with a django frontend/backend. I need to run the python bot at the same time as the Django website. I run the bot via "python main.py". I run the django project via "python3 manage.py runserver" runs on http://127.0.0.1:8000/. They both work fine at the same time, but I want the bot to be able to send information to the django project.
I don't believe its like ruby. I cant just fetch to http://127.0.0.1:8000/ bc that is not the backend. That is the frontend of the site(?).
So, is there anyway for me to get the URL of the django backend, so I can send information to it via my python bot. I cannot seem to find an article on this, any help would be greatly appreciated. Thanks!
So I recently changed databases on a Django-based website from SQLite to MySQL.
I did it via dumping the data from the SQLite into a json file and then migrating it to the new MySQL db then loaded it using the python manage.py loaddata command.
The site is hosted on pythonanywhere and the tranistion there went flawless, however, on the local copy of the project I have(used to test implementing new features and debug), the dynamic elements on the front page wont load.
I have a dynamic js table with information for various cryptocurrencies.
This is how the head of the table looks on the live site:
And this is how it looks on the local copy of my machine, with my own hosted MySQL server:
What I've tried:
-Collectstatic
-Running ContentType.objects.all().delete() in python manage.py shell
I also did research on stackoverflow but I could not find a similar issue.
I am also new to Django so it might be something obvious I'm missing
Try with Django fixtures.
Here is the official link for Django fixtures
Solved: I used the datadump.json from pythonanywhere rather than my local copy. Also had some issues with the json utf8 encodings so make sure your datadump file is utf8 encoded and/or matches the encoding of your db.
I have deploy a Django web application on Heroku.
How can I get the database link to that web application which is deployed on Heroku?
Once I get that database, then how can I link that database to my new Django project?
Basically, I want to do this because we need to change the URL of the web application deployed on Heroku.
If there is any other way via which we can do then please let me do.
Thanks in advance.
Is there a way to run a python script that will add data to this SQLite DB then? I mean, a completely separate .py file that I will run in the shell, doing python thefile.py in an SSH connection?
Of course, this file will be on the same server as the whole Django project.
This way, I can easily access the data from the DB from my Django project, and display it the way I want in a pretty HTML/CSS web page.
Thanks
Is there a reason for not using django? you can add a command to the manage.py the way it's described here https://docs.djangoproject.com/en/1.11/howto/custom-management-commands/
I want to update a field in my users table on my django project hosted on heroku.
Is there a way I can run a script(if so from where?) using what?
That allows me to update a field in the database? I could do this manually in the django admin but it would take way to long as there are large number of users.
Any advice is appreciated.
i suggest you update the data in your local then make a fixture, commit and push it in your heroku. then do load the data using the terminal
update data (locally)
make a fixture (manage.py dumpdata)
commit and push to heroku
login via terminal (heroku login)
load the data (heroku run python manage.py loaddata .json)