G4st0n
After data= response.json ().
u have to define a get funcition to seed data from external API
Rafael
G4st0n
After data= response.json ().
like this def get_inventory(): url = 'https://www.invetorywatch.gov/api/assets' r = requests.get(url, headers={'Content-Type': 'application/json'}) inventory = r.json() return inventory
G4st0n
So i want to know a specific issue too
dude no meta questions go take a django course at leats the basic, then come here for aspecific question or issue
Nav
u have to define a get funcition to seed data from external API
Url = #apiurl Response =requests.get(url) Data = response.json() Till this ok. My model is Class Book(models.Model) Id Bookname How to assign data to model and save to data base
G4st0n
Url = #apiurl Response =requests.get(url) Data = response.json() Till this ok. My model is Class Book(models.Model) Id Bookname How to assign data to model and save to data base
Once you have this get function working, you can use the return data to seed your database, and of course make sure the attributes you’re seeding match the respective model.
Nav
Spent 2 days. Can't figure out the seeding part
G4st0n
as the same u define a get u have to create a def seed
G4st0n
create a seed.py with content import requests from django.core.management.base import BaseCommand from ...models import Inventory
G4st0n
then u have to run the seed like standard command
G4st0n
python manage.py seed
G4st0n
Easy Peasy
G4st0n
I did projects with django But i was misguided everytime
How doing a project u can be missguided ? if a build a blog in the learning process i will know how to create a model, migrate data, create an auth system and password reset, recovery, etc email function and so on
G4st0n
basic steps that will be present in many other projects
Rafael
Give me steps
G4st0n
Give me steps
No no this is not a school. go with Django for Beginners from William S. Vincent
Rafael
No no this is not a school. go with Django for Beginners from William S. Vincent
If you are bad i am your dad ask me anything i will answer 🙂
Raj
response.writelines(lists) this command is not working how to solve this
Rafael
response.writelines(lists) this command is not working how to solve this
The error is self-explanatory: you must pass a sequence of strings, not numbers to file.writelines(). So convert the numbers to strings, and perhaps add newlines:
SR
Hi guys ....I've a doubt ...how can I echo a variable inside {% %} tag ? Something like {% {{ variable }} %}
SR
I don't think "format" works in .html files
Rafael
Echo is for php right?
SR
I was talking about printing a variable with {{}}
SR
In django
SR
Use .Format or %
Dude .format doesn't work in .html files .....it's for .py files
Rafael
Dude .format doesn't work in .html files .....it's for .py files
<html> {{ this_is_my_variable_that_is_passed_to_my_view }} </html>
Rafael
Dude .format doesn't work in .html files .....it's for .py files
the {{ allow variable access to the item which will call the items unicode function if it exists otherwise it will call its str function
Ugochukwu
Pls can anyone suggest any free SMTP provider for django aside gmail?
Ugochukwu
Twilio
Yea I tried to use this but they haven't verified me since last week
Ugochukwu
Sendgrid
Twillo and sendgrid are thesame
Saroj Kumar
Django.db.utils.programingError how can i solved this issue please guide me if any one know about that
CRINIT
My one urls.py is in django project Another is django app with url.py I mentioned app_name='django_app_name' path=[' ',include('/django _app_name_', namespace='django_app_name')] But through error app_name module not Found How to fix it
Saroj Kumar
Is there any one from marthali location
𝔸𝕟𝕕𝕣é𝕤
Hola
𝔸𝕟𝕕𝕣é𝕤
Alguien puede ayudarme con una historia de usuario para un aplicativo web?
CRINIT
You can use the ., path = (' ',include(app_name.urs) ) in your project urls.py
I am using it in urls.py not url.py Sending you code in pastebin https://pastebin.com/6HM8XPmU
CRINIT
I am using it in urls.py not url.py Sending you code in pastebin https://pastebin.com/6HM8XPmU
Error : ModulenotFound gcrudapp not Found Project Name gcrud App name gcrudapp
Dave
My one urls.py is in django project Another is django app with url.py I mentioned app_name='django_app_name' path=[' ',include('/django _app_name_', namespace='django_app_name')] But through error app_name module not Found How to fix it
It seems you are importing a wrong file. path('app_name', include('gcrudapp.url')) From your current file you are importing gcrudapp.urls with "s" Also you can your url.py to urls.py, to solve it
CRINIT
I should write path('app_name', include ('gcrudapp.url')) ?
Nav
Easy Peasy
Thanks.... Very much
Shivam
Mobile app scraping
Shivam
Possible ??? In python
Dave
I should write path('app_name', include ('gcrudapp.url')) ?
Yeah since your filename for url is url.py Or just rename your url file to urls.py
Dave
Possible ??? In python
Thru request intercepting?
Shivam
Thru request intercepting?
Sir can you explain in detail how to scrap data from mobile app
G4st0n
G4st0n
With selenium or scrappy
G4st0n
Dave
Sir can you explain in detail how to scrap data from mobile app
I don't have any experience regarding on mobile app scraping. I have read something about request intercepting. In that method you will see the api endpoint of what the mobile app is hitting.
Doragonsureiyā
Possible ??? In python
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Shivam
Shivam
Mobile application scraping through api it is possible
G4st0n
not django related question
Mihir
https://forum.djangoproject.com/t/how-to-set-same-unique-primary-key-in-each-model-of-app-according-to-user-in-django/15314
Serhii
Hello everyone! Could someone say me how I can delete escaped symbols in DetailViews when I want to open full story in my post?
Eslam
When should I use celery
Dani
Eslam
like what
cj
like what
like the cases when you need to use celery
GOJO
How to register staticfiles
GOJO
In django 4.01
Maxim
How to register staticfiles
google django static files
GOJO
I searched..and update but it doesn't work as I want
GOJO
It shows error in finder.py
GOJO
I create a staticfiles dirs in project setting
GOJO
WTF is finder.py?
Something like that finding or finder
cj
Something like that finding or finder
¯\_(ツ)_/¯ then who knows what you're doing...