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+)/$']
Mirco
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
Mirco
Oleg
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
Mirco
S.
Thank you both so much :)
S.
🤩
Its
how to check version of a django project
Mirco
Its
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
Mirco
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
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
Its
R
Mirco
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
Anonymous
Omair
Anonymous
Oh ok
Omair
Oh ok
Thanks anyway 😀
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.
Mirco
Mirco
Mirco
Ah ok , no worries
Mirco
Anonymous
Anonymous
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?
Luis
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
Luis
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'.
Luis
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.
Artyom
Hi guys!
Artyom
I face with unusual serializer error