Anonymous
HTML https://pastebin.com/r1DNddz6
If you have any image tag. Then <img src="{{datas.imageFieldName.url}}">
Anonymous
In your <p>{{datas.fieldName}}</p>
can you change in it paste bin file,so that i can have clear idea
Felix
certified = models.ForeignKey('Company', related_name='%(class)s_owner', on_delete=models.CASCADE, default=None ) authority = models.ForeignKey('Company', related_name='%(class)s_authority', on_delete=models.CASCADE, default=None )
Felix
Why do i get an error when i’m double referencing?
Felix
...
raven
it shouldn't if you have different related name specified
Felix
found one related name with the same string
raven
have you tried hard coded those name?
raven
like certified = models.ForeignKey('Company', related_name='Class_owner', on_delete=models.CASCADE, default=None ) authority = models.ForeignKey('Company', related_name='Class_authority', on_delete=models.CASCADE, default=None )
Anonymous
https://pastebin.com/Ysz4MiG1
Anonymous
https://pastebin.com/Ysz4MiG1
Do you want to retrieve all the datas from database to template?
Anonymous
yes
Anonymous
Anonymous
Use {{data.fieldName}}
logic for this?
Anonymous
simply given fieldName but thats not happening.I think i need to implement for loop.
Anonymous
in your template. {% for data in datas %} <p>{{data.name}}</p> <p>{{data.age}}</p> <p>{{data.gender}}</p> <p>{{data.merital_status}}</p> <p>{{data.Number_of_dependents}}</p> <p>{{data.capiral_income}}</p> . . . . . <p>{{data.Property_type}}</p> {% endfor %}
Anonymous
on writing logic,when i iterate over model,it is showing model objects are not iterable
Anonymous
on writing logic,when i iterate over model,it is showing model objects are not iterable
Dont iterate on model... You have to iterate the model objects... Each objects contains it's own field data
Anonymous
it works bro,but I want to make it in dynamic instead of static
Ansab
My crone job is not running.... Anybody here to help me..... Pls😒😒😒
Anonymous
You can try that, First you have to store some datas into database and then go to template or refresh that its will retrieve data
Anonymous
My crone job is not running.... Anybody here to help me..... Pls😒😒😒
What is crone bro? I don't know. Wait bro someone else may help you
Ansab
Ansab
Ok.... I did it
Adarsh
Hey how can I run my local Host on my friend's laptop?
Anonymous
Hey how can I run my local Host on my friend's laptop?
You have to load the project in that pc and install requirements like python,django
Prasanthari
Hey how can I run my local Host on my friend's laptop?
Create virtual env wrapper so u can copy the same project on another pc
Muflone
Hey how can I run my local Host on my friend's laptop?
1. In your development PC create a virtualenv 2. Add every 3rd party required python package to requirements.txt 3. Move the application inside the virtualenv 4. Activate the virtualenv 5. Install requirements.txt using pip -r 6. Test your application These steps are that you should always do while developing in Python
Adarsh
Hey how can I run my local Host on my friend's laptop?
Actually like run my server on my laptop and my friend who is on the same network can also use it
Adarsh
To add data
Muflone
Then you don't need to install it in your friend laptop, just let your friend to connect to your IP address
坂田銀時
Hey how can I run my local Host on my friend's laptop?
You can bind localhost:port on other system to yours with ssh
Adarsh
Thanks
坂田銀時
Ssh is better than allowing direct access
Muflone
How can it be better?
Anonymous
Hello people? So jumping right to my point Alot of people told me that $ virtualenv venv1 --system-site-packages is reckless to include packages in my virtual environment
Anonymous
when i create a venv with that command all the packages are accessible inside the environment but how can i download only selected packages offline from the archive? i have not internet connection, i only use mobile data!
Anonymous
@il_muflone is it possible 👆👆👆
Muflone
when i create a venv with that command all the packages are accessible inside the environment but how can i download only selected packages offline from the archive? i have not internet connection, i only use mobile data!
system-site uses your distribution packages. they're not included in your virtualenv, they're only linked into it if you know your dependencies, then pick them up from pip website (not an easy task though)
Muflone
all your installed python packages
Anonymous
all your installed python packages
yeah, but they are a lot!
Muflone
what you want to obtain from your virtualenv? a complete environment or a sane environment where you get only what you explicitly installed? choose one
Muflone
then you have to install them explicitly (and don't use --system-site-packages)
Prasanthari
Use anaconda it's really useful for these
Anonymous
then you have to install them explicitly (and don't use --system-site-packages)
so as an example, can u show me the a step by step except this $ virtualenv myenv $ source myenv/bin/activate now how can i install django to my env offline?
Anonymous
Use anaconda it's really useful for these
yeah, but the terminal becomes slow to start when i install anaconda
Muflone
so as an example, can u show me the a step by step except this $ virtualenv myenv $ source myenv/bin/activate now how can i install django to my env offline?
django has some dependencies. offline means you cannot download them from your computer running the venv, right?
Anonymous
Muflone
i already have django in my pip freeze list
if you want you can link single packages from your distribution packages into the venv
Muflone
but you'll get what your distribution offers, only
Muflone
what os are you using?
Anonymous
Muflone
ahah
Anonymous
what os are you using?
peppermint(linux)
Muflone
ok, first you must know where your system packages live. see into /usr/lib/pythonX.Y/site-packages
Muflone
or something similar
Anonymous
there are python3, python3.6, python3.7, and python 3.8 in that path
Muflone
it depends on what you use, execute python and look by yourself
Anonymous
3.6
Muflone
then find your django package from there