007
Check better the regex
( 1 ) {% url 'panel_person_form' person_id=item.id %} ( 2 ) <a href="{% url 'myview' %}?office=foobar">
007
i have used both this ways to add url in template but none of this is working
007
by manually typing url into browser it work properly but while requesting from template it show following error :- Reverse for 'doc' with arguments '()' and keyword arguments '{}' not found. 2 pattern(s) tried: ['doc/(?P<type>\\w+)/$', 'app/doc/(?P<type>\\w+)/$']
S.
Hi friends I have a problem I have a model like this, —————————————————— class Mymodel(models.Model): modelName=models.CharField(verbosename="Name") modelDate=models.CharField(verbose_name="Date") ——————————————————- *I need a 3rd field for my model as howManyDays. *I need keep how many days since from the modelDate *for this case howManyDays must be update day by day *How can I solve this problem
Oleg
If you want number of days in your python code - write a property to calculate it
Oleg
If you want to filter by number of days - you can use modelDate__lt and modalDate__gt queries
S.
Thank you both so much :)
S.
🤩
Its
how to check version of a django project
Mirco
thanks admin
Even when you run runserver, you can see its version or into requirements.txt/*.lock etc.
Its
when we download a project from github is there no db available in that file i am facing a error about tcp/ip connections on port 8000
Its
https://github.com/rohammosalli/real-estate _____ i am trying to run this project and facing error about connection refused this project also have not db.sqlite file in it
Mirco
Install PostgresSQL and requirements.txt into a venv Change credentials if u need and run migrations So you should have all you need about models
R
i am not working in virtual env.
So work on it 🤦‍♂️
Omair
Hi i want to upload images in my user profile model using imageField and in views i am using django rest generics for createApiview
Omair
Hi i want to upload images in my user profile model using imageField and in views i am using django rest generics for createApiview
And to list user profiles I am using list api view but when i upload the image by filling out the api view create form i can't find the image in the list view with error saying couldn't match the current path
Anonymous
Oh ok
Omair
Oh ok
Thanks anyway 😀
Anonymous
Thanks anyway 😀
Had a similar issue and it solved mine..😊 welcome
Xyz
plzzz help
Xyz
i need a major project on django for my placement perpose.. plzz helo
Xyz
help me
Anonymous
Whenever i create a user the profile is not creating, i have created signals.py also.
Anonymous
Share your code
https://github.com/django-webapp/
Mirco
Ah ok , no worries
Mirco
https://github.com/django-webapp/
Use pastebin or similar pls
Anonymous
Use pastebin or similar pls
#signals.py https://hastebin.com/gapohayaqi.py
Mirco
#signals.py https://hastebin.com/gapohayaqi.py
https://simpleisbetterthancomplex.com/tutorial/2016/11/23/how-to-add-user-profile-to-django-admin.html Follow this one to fix your signal
Sebuhi
hello,is there anyone has used crontab in django? like i want to delete record in db after one day it is inserted. @periodic_task(run_every=crontab(minute="*/1")) def delete_food_storage_status(): storage = Food_Storage.objects.all() print("bu funkisyani icra olunur") for store in storage: if store.created_at < timezone.now() +datetime.timedelta(days=1): store.delete() print("working") return "Deleted fields {}".format(timezone.now()) my code is here but it does not work
Sebuhi
here is my model, juts need to delete each record after one day it is inserted class Food_Storage(models.Model): device_imei = models.PositiveIntegerField("device imei") food_storage_status= models.PositiveIntegerField("Cihazdan gələn Qida çəni statusu") created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True)
Kevin David
http://www.axistechnolabs.com/detail-blog/Guideline-for-Odoo-integration-in-django-python
Mayck
Hey guys and girls! I'm having this issue with Django models when I create a reference and run makemigrations. I get this following error: String model references must be of the form 'app_label.ModelName'.
Mayck
Does anybody already have this error?
Mayck
Upload your models to pastebin and share it with us
https://gist.github.com/mayckxavier/881486eef18ca0de1c1d0812ae61210a
Luis
I think you should call the models file just "models.py"
Alexander
looks good for Django developers
Alexander
Cloud Code – A new set of plug-ins for IntelliJ and VS Code (Score: 101+ in 3 hours) Link: https://readhacker.news/s/3ZLB6 Comments: https://readhacker.news/c/3ZLB6
Mayck
I think you should call the models file just "models.py"
So I need to put all models in only one file? I wanted to separete them as different contexts
Luis
So I need to put all models in only one file? I wanted to separete them as different contexts
Try to write all together and call the file "models.py"
Mayck
Ok. Thanks!
Luis
If it works, then you can find a way to write them in separated files
Mayck
I didnt sent the error Im getting in makemigration. Sorry
Mayck
ValueError: Invalid model reference 'portaldolivro.admin.companies.BookStore'. String model references must be of the form 'app_label.ModelName'.
Mayck
Not yet
Luis
Ok
Mayck
Ok
Got another error related to this app_label
Mayck
RuntimeError: Model class portaldolivro.admin.models.Company doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
Mayck
I think that the error is related to the package I created named "admin"
Mayck
I'll try another name
Luis
Oooh! Django use a file called admin.py
Luis
If you use names used by Django it will fail
Mayck
Oooh! Django use a file called admin.py
Well.. It was not the error. Dont know why, but the migrations was corrupted. I needed to reset the database and erase the migration files. No problem, since I'm in the middle of the development. Thank you Luiz!
№r sairi
just direct your question
Xyz
i need a project for placement perpose
Anonymous
hello, everybody, I have one django job.
Anonymous
who will do this?
Anonymous
I will pay you.
Tags
Can you share the details of that job?
Anonymous
hello, everybody, plz help me.
Mirco
still same error
What kind of error ?
Artyom
Hi guys!
Artyom
I face with unusual serializer error