Re: reg: Building Django REST API to show number of matching pattern from log file

2020-01-13 Thread Derek
Some ideas (untested of course)

"I need develop an API that will read the matching pattern from the log 
file, and push it to the DB." <== this is NOT an API - but have look at how 
a different script could access your log:

https://stackoverflow.com/questions/12523044/how-can-i-tail-a-log-file-in-python

Alternately:

"The log file generation and the license file monitoring has been automated 
through Python script on the servers itself."

Why not simply extend those scripts to also write selected outputs to your 
database?


For the dashboard side, there are many existing tools that will allow you 
to create this; just one example is Grafana - https://grafana.com/ (Bonus: 
you can also use this tool to do the metrics on the server itself.)

HTH

On Monday, 13 January 2020 12:59:19 UTC+2, Amitesh Sahay wrote:
>
> Hello Users, 
>
> I have a scenario for which I need to develop a Web API through Django 
> RESTFrameWork.
>
> 1) We have a multiple linux machines on which a  log file is generated as 
> soon as there is some change in hash value of a license file . The log file 
> generation and the license file monitoring has been automated through 
> Python script on the servers itself. So far so good.
>
> 2) Now, I need develop an API that will read the matching pattern from the 
> log file, and push it to the DB.
>
> 3) I also need to develop a dashboard where we can pull data on Daily, 
> Weekly, monthly, and Yearly basis and show graph.
>
> So far, I could do some testing with the Python RegEx to catch the 
> matching pattern and its fine. But the problem is how to use DRF to pull 
> those matching pattern directly from the log file to the DB each time the 
> patter is generated in real time? I have been brainstorming for 3 days now, 
> but reached nowhere.
>
> Note:
> 1) There is a log rotation happening I believe every 24 hours, and the log 
> files are kept only for seven days. Prior to that the logs get deleted. 
>
> I am not sure even if its possible, or what would be my approach.Please 
> pour in with your suggestions.
>
> Regards,
> Amitesh 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/38de7c40-cd20-4c05-9ea2-a1dd8fad8139%40googlegroups.com.


Re: Making an OR condition in a Queryset using .filter(**mydict)

2020-01-13 Thread Sreevardhan Reddy
https://docs.djangoproject.com/en/3.0/topics/db/queries/#complex-lookups-with-q-objects


On Fri, Jan 10, 2020 at 7:54 PM Ezequias Rocha 
wrote:

> Hi everyone
>
> I am using a dynamic filter and I am building my own arguments at runtime.
>
> The problem I am focusing is when I want my filter operates as an OR
> conditional. I am using the following way to do the AND filter
>
> data = {
>   'name': 'John',
>   'age': 42,
> }
>
> model.filter(**data)
>
> It works but all conditions in data dictionary are  treated as an *AND *
> operator.
>
> Does anyone knows how to apply the *OR *(|) condition to this filter?
>
> My best regards
> Ezequias Rocha
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8f61aabe-9faf-4291-bb7e-4b403ea13e5a%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF6Fyj3QjMkx9xUfaTH9Q03zhKj1BJn0KfSctUpvp_ZkCe9qOA%40mail.gmail.com.


Re: Django tutorial part 2: "It’s important to add __str__() methods to your models"

2020-01-13 Thread Julius Lange
Okay, thank you guys! 

I figured it out. The reason was another issue and my nooby assumtion led 
you in the wrong direction.

Sorry, thanks again
Julius



Am Sonntag, 12. Januar 2020 22:56:43 UTC+1 schrieb Julius Lange:
>
> Dear people,
>
> currently doing the django tutorial! Really enjoy it so far.
>
> I am using PyCharm, Django version 3.0.2, Python version 3.7.1.
>
> In part 2  of 
> the tutorial it comes to a point i need to insert a __str__ function. I add 
> it like said in the tutorial and PyCharm says "Overrides Method in model" 
> already.
>
> If i keep going ignoring that, i keep getting errors.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f8643164-0abb-4133-87f3-8f8f5b680923%40googlegroups.com.


Django Development opportunity in Ahmedabad, India

2020-01-13 Thread Roshan Shah
We require Django Developer with 3+ years experience to work out of our
startup in Ahmedabad. We have a very small 4 person growing team. You will
lead the team in Ahmedabad and remote team across India

You will also manage client projects and grow the team in India.  You are
expected to have absolutely rock solid experience in CI/CD/Automated
Testing and managing cloud deployments/scalability issues. Django can be
learned but your ability to be a solid devops guy with excellent
Python/Django skills will set you apart.

We are looking for best of the best with 3 to 5 years experience. You will
enjoy working with us, our client projects as well as our inhouse products.

We will test your abilities to innovate and you will have freedom to
innovate with us.

Please send your resumes to techieros...@gmail.com with subject
"DJANGO-AHMEDABAD" for consideration.  Your resume must list some live
Django projects where you have also configured CI/CD and deployed in Cloud
(AWS, Google Cloud/Azure)

You should be able to communicate with Canadian/US Counterparts in American
English and be the point of contact for entire India team, own the issues
and timely delivery.

This could be perm/contract/contract to hire opportunity as we can mutually
agree upon.  We are really looking for someone who can innovate, stick
around and grow the team.

-- 
-- 

Roshan Shah / Sr. IT Consultant
techieros...@gmail.com / (519) 496-8860

This e-mail message may contain confidential or legally privileged
information and is intended only for the use of the intended recipient(s).
Any unauthorized disclosure, dissemination, distribution, copying or the
taking of any action in reliance on the information herein is prohibited.
E-mails are not secure and cannot be guaranteed to be error free as they
can be intercepted, amended, or contain viruses. Anyone who communicates
with me by e-mail is deemed to have accepted these risks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALX19Nju4XnQFz2KVeUpB%3DFp0wDCYair%2B%2BDUGG5w_yt1q8-v6A%40mail.gmail.com.


Re: How to do SEO for my django website

2020-01-13 Thread Roshan Shah
Anyone fixing django-seo to be compatible with Django 3.0?

On Fri, Jan 3, 2020 at 7:54 AM Yash Garg  wrote:

> rollyourown.seo in not compatible with latest version of django
>
>
> On Friday, January 3, 2020 at 6:18:11 PM UTC+5:30, sagar ninave wrote:
>>
>> https://django-seo.readthedocs.io/en/latest/introduction/tutorial.html
>>
>>
>> On Fri, Jan 3, 2020 at 6:11 PM Yash Garg  wrote:
>>
>>> Is there any package or module available for SEO of django website ?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/1869ef27-3269-41bc-a0e3-c79652863eec%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>>
>> 
>> sagar ninave
>> about.me/sagarninave
>> 
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6f078a37-ca3e-45e7-b155-0c61cc46775f%40googlegroups.com
> 
> .
>


-- 
-- 

Roshan Shah / Sr. IT Consultant
techieros...@gmail.com / (519) 496-8860

This e-mail message may contain confidential or legally privileged
information and is intended only for the use of the intended recipient(s).
Any unauthorized disclosure, dissemination, distribution, copying or the
taking of any action in reliance on the information herein is prohibited.
E-mails are not secure and cannot be guaranteed to be error free as they
can be intercepted, amended, or contain viruses. Anyone who communicates
with me by e-mail is deemed to have accepted these risks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALX19Ni6SEXPH75f-T_SGx2V6CcRHd6YsEcz%3DhLf2yk%2BwQWvsg%40mail.gmail.com.


Re: URL pattern for URL with query string

2020-01-13 Thread S D
Thanks Jason.



Kind regards,
- SD

On Mon, Jan 13, 2020, 16:28 Jason  wrote:

> The url resolver does not include GET query params in a URL, you need to
> add them manually after the string.
>
> for example
>
> url =
> f"{reverse('weather')}/?current_location={some_value}_location={another_value}"
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6dd43044-909b-49b2-87fc-5344508af9e8%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAH-SnCDYPmVvrt_v3jb3V3%3DiLUKCmdNuHZF%2B1GFdVhXQXydf%2Bg%40mail.gmail.com.


Re: URL pattern for URL with query string

2020-01-13 Thread Jason
The url resolver does not include GET query params in a URL, you need to 
add them manually after the string.

for example

url = 
f"{reverse('weather')}/?current_location={some_value}_location={another_value}"

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6dd43044-909b-49b2-87fc-5344508af9e8%40googlegroups.com.


URL pattern for URL with query string

2020-01-13 Thread S D
Hey guys. SOS please. How do I write a URL pattern for a URL like this?

weather/?current_location=-33.927407,18.415747_location=-32.927407,19.415747

When I do reverse(‘weather’, kwargs={‘current_location’: some_value,
'booking_ location’: another_value}) I am getting a NoReverseMatch
exception.


Kind regards,
- SD

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAH-SnCBDKO4PzcWZB-n5QqwZtd3jMx%3DDZjCZkzQ2%3D_2cf1LOCA%40mail.gmail.com.


Re: Confused about the Django admin panel!

2020-01-13 Thread Kasper Laudrup

Hi Tech Inject,

On 13/01/2020 07.33, Tech Inject wrote:

I am new at Django.

and I am creating one college project now I need to add some good 
functionality at the admin panel.


I want to add blog post type features with ajax to auto-save and all.
I want to create data visualization using charts, etc.



Why do you want to add this to the admin panel?

This sounds like something you would do by creating a "normal" django app.

now the problem arises is I am confused about is this possible in the 
Django default admin panel?




It is definitely possible, but not in the "default" admin panel without 
customizing it.



if not available then it's good to create a custom admin panel?



No, I don't think a custom admin panel is what you're looking for.

Start by implementing a simple blog. The djangofirls tutorial is often 
recommended here:


https://tutorial.djangogirls.org/en/

I would suggest you start following that tutorial and implement a simple 
blog and once you have a good understanding of the basics, you can move 
on to the more advanced features you mention.


Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f9d753a8-1dbd-8452-ea3e-6ce2a03ab7b9%40stacktrace.dk.


Confused about the Django admin panel!

2020-01-13 Thread Tech Inject
I am new at Django.

and I am creating one college project now I need to add some good 
functionality at the admin panel.

I want to add blog post type features with ajax to auto-save and all.
I want to create data visualization using charts, etc.

now the problem arises is I am confused about is this possible in the 
Django default admin panel?

if not available then it's good to create a custom admin panel?

need strong suggestions!

thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/27914002-4ced-4f5f-a1d6-e0b87c7837f5%40googlegroups.com.


Re: Django tutorial part 2: "It’s important to add __str__() methods to your models"

2020-01-13 Thread zana mhamad
Internet facebook

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/058ce4e5-9bc0-4676-9c3d-0fd9155a7acf%40googlegroups.com.


Re: Django tutorial part 2: "It’s important to add __str__() methods to your models"

2020-01-13 Thread zana mhamad
فيسبوك تثبيت شبكة انترنت علي تطبيقات  علي جهاSamsung  a7 2016

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d09e3cba-14ca-4f07-beaf-2944d0c5%40googlegroups.com.


reg: Building Django REST API to show number of matching pattern from log file

2020-01-13 Thread 'Amitesh Sahay' via Django users
Hello Users, 

I have a scenario for which I need to develop a Web API through Django 
RESTFrameWork.
1) We have a multiple linux machines on which a  log file is generated as soon 
as there is some change in hash value of a license file . The log file 
generation and the license file monitoring has been automated through Python 
script on the servers itself. So far so good.
2) Now, I need develop an API that will read the matching pattern from the log 
file, and push it to the DB.
3) I also need to develop a dashboard where we can pull data on Daily, Weekly, 
monthly, and Yearly basis and show graph.
So far, I could do some testing with the Python RegEx to catch the matching 
pattern and its fine. But the problem is how to use DRF to pull those matching 
pattern directly from the log file to the DB each time the patter is generated 
in real time? I have been brainstorming for 3 days now, but reached nowhere.
Note:1) There is a log rotation happening I believe every 24 hours, and the log 
files are kept only for seven days. Prior to that the logs get deleted. 

I am not sure even if its possible, or what would be my approach.Please pour in 
with your suggestions.


Regards,
Amitesh 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1342849622.9012128.1578913093968%40mail.yahoo.com.