Re: makemigrations

2022-09-19 Thread Joel Wembo
Django can't add a new field by itself without null values being allowed 
here, especially when you have unique=True set on this field. To solve that 
issue, you have to perform it in steps:

   1. Add a column with null=True or without unique=True and with some 
   default value
   2. Make sure that all records in database will have a unique value.
   3. Change the field to the final state.


On Friday, September 16, 2022 at 3:38:56 AM UTC+8 shivas...@gmail.com wrote:

> Hello I am new in Django users group. I am using Django and faching a 
> problem when i do any changes in existing models after run  makemigrations.
>
>
> This is problem :-It is impossible to add a non-nullable field 'logo' to 
> jobdetails without specifying a default. This is because the database needs 
> something to populate existing rows.
> Please select a fix:
>  1) Provide a one-off default now (will be set on all existing rows with a 
> null value for this column)
>  2) Quit and manually define a default value in models.py.
> Select an option: 2
>
>
> please help how can i solve this problem .
>
> 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/9d93089a-c6ee-47a2-a925-93bb51a836fbn%40googlegroups.com.


Re: Digest for django-users@googlegroups.com - 22 updates in 10 topics

2022-09-18 Thread Joel Wembo
Where do you want to deploy it ? aws,  gcp or azure ? are you using docker 
and kubernetes ?

On Sunday, September 18, 2022 at 3:54:50 AM UTC+8 kouamou@gmail.com 
wrote:

> hello how to deploy django project
>
> 2022-09-17 14:01 UTC+01:00, django...@googlegroups.com
> :
> > 
> =
> > Today's topic summary
> > 
> =
> >
> > Group: django...@googlegroups.com
> > Url:
> >
> > 
> https://groups.google.com/forum/?utm_source=digest_medium=email#!forum/django-users/topics
> >
> >
> > - Migrate to mongodb is failing [1 Update]
> > http://groups.google.com/group/django-users/t/54ccb6fb6c74b510
> > - Looking for a Django firm [5 Updates]
> > http://groups.google.com/group/django-users/t/6a99520d73a30f4f
> > - DoesNotExist at /admin/blog/blog/add/: blog matching query does not
> > exist [1 Update]
> > http://groups.google.com/group/django-users/t/faf749bbc6ef6579
> > - how to make https work in django REST framework [1 Update]
> > http://groups.google.com/group/django-users/t/2995d1d8aa336917
> > - CAn we use Django framework in company industry ? [8 Updates]
> > http://groups.google.com/group/django-users/t/1a2827cf05095c3b
> > - Portainer weird situation [1 Update]
> > http://groups.google.com/group/django-users/t/f91e49a1a751d1ad
> > - save_model doesn't run on Django version 4 [2 Updates]
> > http://groups.google.com/group/django-users/t/5fa2fc1441f494d2
> > - Restricting items to a specific user [1 Update]
> > http://groups.google.com/group/django-users/t/271658daf557c517
> > - django.forms.DecimalField can not validate scientific notation [1
> > Update]
> > http://groups.google.com/group/django-users/t/dc2c5d8c1bd32afb
> > - Help needed in setting up User Auth JWT system [1 Update]
> > http://groups.google.com/group/django-users/t/bc02ba31efdb1ba8
> >
> >
> > 
> =
> > Topic: Migrate to mongodb is failing
> > Url: http://groups.google.com/group/django-users/t/54ccb6fb6c74b510
> > 
> =
> >
> > -- 1 of 1 --
> > From: subin 
> > Date: Sep 16 09:58PM +0100
> > Url: http://groups.google.com/group/django-users/msg/37f4cfba43904
> >
> > Sorry to write again so quickly.
> >
> >
> >
> >
> > 
> =
> > Topic: Looking for a Django firm
> > Url: http://groups.google.com/group/django-users/t/6a99520d73a30f4f
> > 
> =
> >
> > -- 1 of 5 --
> > From: subin 
> > Date: Sep 16 06:59PM +0100
> > Url: http://groups.google.com/group/django-users/msg/375806237098d
> >
> > Thanks for contacting XYZ Company! One of our sales reps will reach out 
> to
> > you shortly. Tap to browse our summer sale while you wait
> >
> > On Wed, Sep 14, 2022 at 6:26 PM DJANGO DEVELOPER 
> > wrote:
> >
> >
> >
> > -- 2 of 5 --
> > From: subin 
> > Date: Sep 16 06:59PM +0100
> > Url: http://groups.google.com/group/django-users/msg/3758cc6fbdf66
> >
> > I will continue learning more about .
> >
> > On Wed, Sep 14, 2022 at 6:16 PM Chelsea Fan 
> > wrote:
> >
> >
> >
> > -- 3 of 5 --
> > From: subin 
> > Date: Sep 16 08:57PM +0100
> > Url: http://groups.google.com/group/django-users/msg/37bf04f2a52e4
> >
> > Is it okay if I follow up again in 1810336066 months?.
> >
> > On Wed, Sep 14, 2022 at 5:49 PM Damanjeet Singh 
> > wrote:
> >
> >
> >
> > -- 4 of 5 --
> > From: subin 
> > Date: Sep 16 09:48PM +0100
> > Url: http://groups.google.com/group/django-users/msg/37ebc5ebefb11
> >
> > Hello there
> >
> > On Tue, Sep 13, 2022 at 2:40 PM Osinaike Gbemileke <
> >
> >
> > -- 5 of 5 --
> > From: subin 
> > Date: Sep 16 09:58PM +0100
> > Url: http://groups.google.com/group/django-users/msg/37f4649aa043e
> >
> > We’ve got your back! A member of our support team will respond to your
> > message within 2-3 hours. Thank you for your patience.
> >
> >
> >
> >
> > 
> =
> > Topic: DoesNotExist at /admin/blog/blog/add/: blog matching query does 
> not
> > exist
> > Url: http://groups.google.com/group/django-users/t/faf749bbc6ef6579
> > 
> =
> >
> > -- 1 of 1 --
> > From: subin 
> > Date: Sep 16 09:50PM +0100
> > Url: http://groups.google.com/group/django-users/msg/37ede41f83c3f
> >
> > Ready for your next order of [product name]? Order now so you don’t run
> > out!
> >
> > On Tue, Sep 13, 2022 at 12:51 PM Jaap van Wingerde <
> le...@vanwingerde.net>
> > wrote:
> >
> >
> >
> >
> > 
> =
> > Topic: 

Re: Django app deployment on Heroku

2022-09-18 Thread Joel Wembo
Seem like to get to have root certificate from your computer

On Friday, September 16, 2022 at 5:29:55 PM UTC+8 shodza...@gmail.com wrote:

> Good day.
>
> l need help on how to deploy my django project on Heroku
>
> l am getting the below error when l push heroku master
>
> Processing 
> /C:/Windows/TEMP/abs_e9b7158a-aa56-4a5b-87b6-c00d295b01fanefpc8_o/croots/recipe/certifi_1655968940823/work/certifi
> remote:ERROR: Could not install packages due to an OSError: [Errno 
> 2] No such file or directory: 
> '/C:/Windows/TEMP/abs_e9b7158a-aa56-4a5b-87b6-c00d295b01fanefpc8_o/croots/recipe/certifi_1655968940823/work/certifi'
> remote:
> remote:  ! Push rejected, failed to compile Python app.
>

-- 
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/9c41ad8c-b54f-4a40-a320-482079398f3cn%40googlegroups.com.


Re: Erro em uma consulta Sqlite3

2022-08-04 Thread Joel Goldstick
On Thu, Aug 4, 2022 at 6:21 AM Luciano Martins  wrote:
>
> É  annotate
> Publisher.objects.annotate(below_5=below_5).annotate(above_5=above_5)
> Em quarta-feira, 3 de agosto de 2022 às 19:31:18 UTC-3, 
> alvaroteixe...@gmail.com escreveu:
>>
>> Bom dia amigos, estou desenvolvendo um blog e me deparei com um erro em uma 
>> consulta, vou mandar o trecho do codigo onde esta o erro:
>>
>> def get_queryset(self):
>> qs = super().get_queryset()
>> qs = qs.order_by('-id')
>> qs = qs.annotade(
>> numero_comentarios=Count(
>> Case(
>> When(Comentario__publicado_comentario=True, then=1)
>> )
>> )
>> )
>>
>> return qs
>>
>> Esse e o erro no terminal:
>>
>> AttributeError: 'QuerySet' object has no attribute 'annotade'
>
annotade is not the same as annotate
> --
> 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/bb9c8102-c7d8-4ec3-9fed-5e78aa84b13en%40googlegroups.com.



-- 
Joel Goldstick

-- 
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/CAPM-O%2ByXpNc5cB7VYQsTKPsN3RrUXHzzwhFoKBm9tJ2sRCDKBQ%40mail.gmail.com.


Re: upgrading from 1.11 and ran into builtin permission clash

2022-07-01 Thread Joel Goldstick
On Fri, Jul 1, 2022 at 8:22 AM Sheila Miguez  wrote:
>
> Hi all,
>
> I'm upgrading from Django 1.11 step by step and am at the stage where I'm 
> upgrading to 2.2. I've run into a problem. I have a custom permission called 
> view_[modelname] that I created in 1.11, and that permission clashes with the 
> default view permission that was added in 2.1.
>
> hardware.InventoryChangeLog: (auth.E005) The permission codenamed 
> 'view_inventorychangelog' clashes with a builtin permission for model 
> 'hardware.InventoryChangeLog'.
>
> What do I do about this? Clearly I should remove the permission I created. 
> How do I deal with the migration? Should I remove the permission while I run 
> the app as Django 1.11 before moving on to a 2.2 environment?
>
> --
> Sheila Miguez
> she...@pobox.com
>

Sorry, I can't answer your question.  But, I am wondering why you are
upgrading to a very out of date version of Django that is no longer
supported.  I think 3.2 is the oldest supported version.  Why not
upgrade to 4?

-- 
Joel Goldstick

-- 
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/CAPM-O%2BySWQKtgNNvJ%3DdCzA4ONLTAwrMDsAwwpqMimcYLYW2%3DJg%40mail.gmail.com.


Re: how to convert xlsx file into jpg

2022-06-10 Thread Joel Goldstick
On Thu, Jun 9, 2022 at 10:47 PM Gabriel Araya Garcia
 wrote:
>
> Why do  you want to do that? I ask you about that for have one idea to give 
> you. Perhaps there is an easy solution.
> We need more information
>
> Gabriel Araya Garcia
> GMI - Desarrollo de Sistemas Informáticos
>
>
>
>
> El jue, 9 jun 2022 a las 5:25, Abhinandan K () 
> escribió:
>>
>> IS anybody know how to convert xlsx file into jpg format in python on mac ?
>>
>> --
>> 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/CAA6_Mp6Ve%3D1jdvYbt3qRVVub1%2BhsbHf%3Dd0VYR6WWCk%3DDC_-5wg%40mail.gmail.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/CAKVvSDCVVXhsagbGdmant-0-BONrXp8zu0jh5303O1%2BVOMu9Sw%40mail.gmail.com.

Just print it to a pdf file.  There are lots of free apps to convert
to jpg.  Google that

-- 
Joel Goldstick

-- 
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/CAPM-O%2ByE7t-EV3aw%2Baz9rkLhy33oo_hsdHabq%3D1%2B4s4LUqhhgQ%40mail.gmail.com.


Re: How to add object to users unique list?

2022-03-14 Thread Joel Tanko
What do you mean by click of a button? Are you using Ajax or a frontend
framework?

You most likely aren't handling the post request on the view that's
supposed to add the anime to the user's list


On Tue, Mar 1, 2022, 10:20 AM raf sandwich  Hi Antonis,
>
> Yes I saw that stackoverflow post also, but I was not able to resolve my
> issue with it. I do not need to update a model specific to the user when
> the user clicks a button, but I can't do it :(
>
> On Tuesday, March 1, 2022 at 6:52:04 AM UTC Antonis Christofides wrote:
>
>> Hello!
>>
>> Are you using class-based views? Does your view have a post() method?
>>
>> I searched the web for `django "method not allowed (POST)"` and this is
>> the first result that came up:
>>
>>
>> https://stackoverflow.com/questions/52244156/method-not-allowed-post-in-django
>>
>> Regards,
>>
>> Antonis
>>
>> Antonis Christofides+30-6979924665 <+30%20697%20992%204665> (mobile)
>>
>>
>>
>> On 28/02/2022 19.49, raf sandwich wrote:
>>
>> Hi there. I have a system whereby users are recommended anime, and I want
>> it so when they see anime on the website they can press a button on any
>> anime shown, which will then add it to their 'UserList' which is a saved
>> list that they can go back to and see whenever they want.
>>
>> I figure the button just needs to associate the anime.id with the POST
>> request, and then add it to the user that is logged ins
>> user.userlist.anime_in_list but I can't get it to work.
>>
>> Currently my terminal is displaying the error
>>
>> Method Not Allowed (POST): /anime/
>>
>> Method not allowed: /anime/
>>
>> when the button is pressed
>>
>>
>> A code break down for my models.py, views.py etc. is available on this
>> reddit post:
>>
>>
>> https://www.reddit.com/r/djangolearning/comments/t3jwo0/how_to_add_an_object_to_a_users_list_without/
>>
>> Thanks for any help I'm so stuck and I think it's probably simple!
>>
>> --
>> 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...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/68c00521-21f5-4e15-a737-41edc42c11dfn%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/a53f8fbc-5e4e-480c-9218-775831e04527n%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/CAJ4Kmg6v4vNJPBzc7%2B2%2B7RNYaqwowTkZ2FjZayytmOn%2BLH_SKg%40mail.gmail.com.


Re: Django, Docker & SaaS Multi-Tenant Architecture

2022-03-14 Thread Joel Tanko
This is a micro service issue, you should use webhooks to notify your main
Django app with the one you're building, that way you'll know when
something happens and can handle that event.

On Sun, Mar 6, 2022, 4:24 PM 炉边史话  great job!
>
> 在2022年1月15日星期六 UTC+8 00:56:12 写道:
>
>>
>> A official discord channel has been released recently follow Django
>> newsletter for such updates :
>>
>> https://discord.com/invite/TP9yQBwyxF?utm_campaign=Django%2BNewsletter_medium=email_source=Django_Newsletter_110
>> On Friday, 14 January 2022 at 02:12:38 UTC+5:30 ber...@autofyle.com
>> wrote:
>>
>>> I second the suggestion to have a discord channel versus async/email
>>>
>>> On Thursday, January 13, 2022 at 1:41:14 PM UTC-7 Bernard Mallala wrote:
>>>
 I will paraphrase and feel free to correct.
 You have an image that when deployed results in a django application
 that can be accessed but without a specific app that is built to work
 within this image.

1. Let' presume that you working on a Tutorial App and you complete
this to taste
2. Now you only want to configure everything including nginx such
that when this is deployed then a user will be able to access the django
instance without issue
3. Thereafter, you want to be able to add the isolated Tutorial app
so that it works without issue on this Django instance. I do not know 
 that
you can point django to an app or the Tutorial app if it existed 
 somewhere
else within the cloud, I have not seen this.
But, to simply add the Tutorial app within this Django instance.I
would perhaps have run a script to apply all required to get the 
 Tutorial
App running. E.g add to settings file, run migrations etc

 On Thursday, January 13, 2022 at 7:47:26 AM UTC-7 in...@lyntree.io
 wrote:

> Hello,
>
> I'm looking at building and deploying either a SaaS / PaaS or CaaS but
> what I'm struggling to figure out is how I can deploy an image of django
> (without its app server)  into a container probably using nginx and docker
> to work between them.
>
> e.g Django you have the ability to create additional apps within
> Django but app I'm building inside at the moment, Ideally I want to 
> isolate
> that app and deploy that app but ensure its connected to the main django
> app within the cloud and i'm not sure if its possible like this?
>
> Anyone have any advice on this? p.s also is there a django instant
> chat channel we can speak on as could not connect on the irc one? Discord 
> &
> Slack is becoming more popular these days for devs for open questions.
>
> Kindest Regards,
>
> Bridget
>
 --
> 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/fd908e33-73c1-4385-a8bf-8cba5e9e3c39n%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/CAJ4Kmg6gERAkWT9Sj7HUu%2BfWnRGWTCsMdECwwUsZZ7qm7V1OHg%40mail.gmail.com.


Re: How to create dynamic models in django??

2022-03-14 Thread Joel Tanko
If I understand correctly you're trying to give the user the power to
create tables from the front end by saving his params to the database and
using that data to create a table in another or the same  database, I tried
doing the same with forms here's a tweak, hope it's what you're looking for
or at least a step in the right direction.

#models.py


Model = models.Model

class DynamicModel(Model):
name = models.CharField(max_length=100)
fields = models.ManyToManyField("Field", blank=True)

def get_data(self, **kwargs) :
# you'd probably want to do some
   kind of db query here to postgres
using a Python wrapper.
   #... cursor.execute("select * from %s" % self.name)
  # assuming that you've instantiated a postgres db cursor

class Field(Model):
 name = models.CharField(max_length=100)
 field_type = models.CharField(max_length=100,
choices=(("integer", "Integer"), ("char", "char" ) )






On Fri, Mar 11, 2022, 6:51 AM Derek  I'm not quite sure how these requirements have arisen as you have not
> provided any context as to the actual user or business needs.  In my
> experience,  most businesses and science organisations  understand very
> clearly what kinds of data they need to store and what they need to do with
> that data.   This makes it possible for the developers to design and
>  implement well-structured SQL  databases.
>
> If,  for some reason, this is really not your use case then, as the other
> commenters have suggested,  it's likely that Django is not a good fit for
> your needs.  Perhaps you should consider a NoSQL  solution (
> https://www.mongodb.com/nosql-explained/when-to-use-nosql) instead;  and
> explore the use of  its associated technologies which can meet your stated
> requirements.
>
> On Thursday, 10 March 2022 at 01:55:18 UTC+2 Ryan Nowakowski wrote:
>
>> On Sun, Feb 27, 2022 at 09:10:05AM +0530, Prashanth Patelc wrote:
>> > How to create dynamic models in django rest framework?
>> > Is there any chance to create dynamic models with APIs
>> >
>> > Any examples please send me thanks in advance..
>> >
>> > 1) Requirement is need create table name and fields in frontend
>> > 2) we are getting the data and store in to the db create db structure
>> > 3) get the table name and fields create table in backend 
>> store
>> > to
>> > 4)this code don't update or add into the models
>> > 5)store the data into the tables
>> > 4)get the data into the tables using orm or any raw queries
>>
>> The WQ project uses the Entity-Attribute-Value data model:
>>
>> https://v1.wq.io/1.2/docs/eav-vs-relational
>>
> --
> 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/a02e1d2a-b640-4b5e-ba65-bebcba8de66an%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/CAJ4Kmg49Ei2CubpQjHzEkOXa4uHJnJN1VPUved1MOvk50XzXTw%40mail.gmail.com.


Re: hcaptcha module implementation with django.

2022-02-26 Thread Joel Goldstick
quite a signature

On Sat, Feb 26, 2022 at 5:41 PM Amor Zamora  wrote:
>
> Guys.
> Im trying to implement the hCaptcha module in my application. But I want the 
> invisible option to be implemented and it doesn't work for me. The question 
> is if anyone has an example that with the hcaptcha module the images don't 
> appear and only the user can press the "I am human" option. Send code 
> examples.
>
> --
> Amor Zamora
> Behind the distance,
> your mouth and mine hide,
> complices of a kiss, caresses, fantasies,
> distance as close as the sky and the sea,
> my piece is in your bed, in mine, is your love.
> Behind the distance hide love, memories,
> encounters, experiences, circumstances, pain and good times,
> it is after her, the distant ones,
> that we leave feelings,
> but if we really miss,
> distance,
> it is only your time.
>
> --
> 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/CAKMTbHVZZwBX8BvCm8B_OZUKUh%2Br8yS%3DGfM5t-M016M1HjQ%3DTg%40mail.gmail.com.



-- 
Joel Goldstick

-- 
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/CAPM-O%2BxOoqGNqxkRDGwsMX1SdmtxsjhXy_1C5Bds8T2y5EfjAA%40mail.gmail.com.


Re: Allow scroll on jQuery fancy Table

2021-12-30 Thread Joel Tanko
A simple tweak I would use is to find the elements id using DEV tools and
set the
element{
 overflow: auto
} using css

On Wed, Dec 8, 2021, 1:10 PM Eugene TUYIZERE 
wrote:

> Dear Team,
>
> I am using jquery fancyTable in the django app but I searched everywhere
> and I did not find how to allow the scroll bar when fancyTable is used in
> django. Does anyone know how to do that? This is the code I have and I what
> to allow scroll bar:
>
>
> 
> const itemsPerPage = 12;
> if (100 > itemsPerPage) {
> $(".items").fancyTable({
> sortColumn: 0,
> sortable: true,
> pagination: true,
> searchable: true,
> globalSearch: true,
> paginationClass: "btn btn-secondary btn-sm",
> paginationClassActive: "active",
> pagClosest: 3,
> perPage: itemsPerPage,
> });
> }
> 
>
> * Eugene*
>
>
> --
> 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/CABxpZHvNNkny_N89-VBFP4nR57Yd%2Barfxvo74CdDCWzhz%3DqgTg%40mail.gmail.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/CAJ4Kmg4UjK5aTw8N9jZBeZfTvc%2BbJDY_fRHhjHN0FY%2BV9ffHSw%40mail.gmail.com.


Re: Not sure if I am doing django-paypal correctly

2021-12-30 Thread Joel Tanko
The code is really simple to implement, but I don't think the explanation
was intuitive enough.

You would need to create a signal like so

#hooks.py
from django.dispatch import Signal

success_signal = Signal(providing_args=[])

#views.py
from .hooks import success_signal
... # after payment

success_signal.connect(handler_function)
success_signal.send(sender=None, **kwargs)

This assumes that you already have a listener waiting for the signal
broadcast,
Also replace None with your sender (optional), and replace **kwargs with
any kwargs you're sending to your listeners.

Cheers


On Wed, Dec 29, 2021, 9:23 PM lone...@gmail.com  wrote:

> Hello all,
>
>   I decided to try and accept payments on my web application.  I have
> chosen the django-paypal application to help me out with this task.  I
> found a decent walkthrough at:
> how-to-accept-paypal-payments-on-your-django-application
> .
> I was able to follow everything until the last step of: "6. Setup a
> listener to detect successful Paypal payments"  I have never really setup
> any listeners before so I did not know what to do.  I decided to read the 
> Django-PayPal
> ReadTheDocs
>  and I
> found a file that looked structurally similar to what I found on the
> original walkthrough I had found.  It looks like I needed to make a
> hooks.py file in my project directory.  I have accomplished that, and the
> ReadTheDocs says: "Remember to ensure that import the hooks file is
> imported i.e. that you are connecting the signals when your project
> initializes. The standard way to do this is to create an AppConfig class
> 
>  and
> add a ready()
> 
>  method,
> in which you can register your signal handlers or import a module that does
> this."  This is where I am getting lost.  I am not quite sure what to
> do.  Does anyone have a better walkthrough or know what I need to do?
>
> 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/d9567663-20fb-4f43-a6c5-131f23497a7bn%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/CAJ4Kmg7mQXtRCh3MCTS-jKVdfoK0ZW5BTc2PLFWTO5142hcyRQ%40mail.gmail.com.


Re: Automatic subdomain for each user

2021-12-30 Thread Joel Tanko
Check out the django-hosts package, the docs are pretty explanatory and
easy to use.
You'd also want to add '.yourdomain' to the allowed_hosts list and it
doesn't work with '127.0.0.1' as its harder for if to figure out the
sub-domain, if you want to use it on your development server use localhost,
e.g mrj.localhost:8000

On Thu, Dec 30, 2021, 12:02 AM Sherif Adigun  wrote:

> I am faced with a requirement where each user is required to use the
> application under his own subdomain. Whenever a user registers, he gets
> username.domain.com and he can add staff, manage reports, etc under his
> subdomain.
>
> What is the best approach to you can suggest please?
>
> --
> 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/f330ad74-75c1-4244-ae27-aa6b97717940n%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/CAJ4Kmg7P12reF-DN_uuLg%3DvAn6sb0yu%3DScWUHZ1%2BxeZyHdoJKw%40mail.gmail.com.


Re: Authentication with Multiple User

2021-07-06 Thread Joel Tanko
If what you're trying to do is have two types of user accounts, then you'd
have to create a base user model and have personal and business inherit
from it - and it being a subclass of AbstractBaseUser

class BaseAccount(AbstractBaseUser):
…
# all public fields

class PersonalAccount(BaseAccount):
…
# personal account only fields

class BusinessAccount(BaseAccount):
...
# business account only fields

# settings.py

AUTH_USER_MODEL = 'app_name.BaseAccount'

you should avoid use of the BaseAccount directly
On Jun 29, 2021 6:05 PM, "Ridwan Adeyemo" 
wrote:

Hello,
How do I implement a multiple users registration/signup form. For example
the user needs to have (username, name password,  and confirm password )
while the seller is going to have (Business Name, Business Email, address,
tax id,  phone number and password,  and confirm password)
Best Regards.

-- 
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/30ae9b3c-6b0d-42eb-9804-92a2fb29b26bn%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/CAJ4Kmg4TWcEMptdOinqjyqhu%2B-tiVQdwXCg2_9N5%3DG0z_%3DRgvg%40mail.gmail.com.


Multiprocessing using python shows error “I/O operation on closed file”

2021-06-01 Thread Joel Tanko
For someone new to programming, that's a bit complicated for you don't you
think?

Your problem lies in your "with" block

  with open('CONFIG.csv') as f:
reader = csv.reader(f)
return [col for row in reader for col in row]

1. You can only return once and then the function is exited, even if
your code worked you'd get a generator object in a list

2. reader isn't accessible outside the with context, same as every
context variable


You can rewrite it as


1.

ls = []

with open('CONFIG.csv') as f:

reader = csv.reader(f)

ls.append(col for row in reader for col in row)

return ls


2.

file = open('CONFIG.csv')
reader = csv.reader(file)
return [col for row in reader for col in row]


On Tuesday, 1 June 2021, Aurora Eugene  wrote:

> Hi All,
>
> I Am new to concepts of programming, just started learning with Python.
> Started writing a program for multiprocessing using Python . The program is
> to print contents of CSV file parallel.
>
> CSV file contains :
>
> folder path, EXTENSION
>
> for example
>
> C:\users , .CSV
> C:\Windows, .PDF
>
> etc
>
> so, the CSV file will contain more than 200 folder paths and their
> extensions. What I have to do in code is I should loop through the CSV file
> and print the contents of the CSV file parallelly by assigning it to
> workers in a POOL
>
> So below is my Code, but it throws "I/O operation on closed file", Can
> anyone help me to figure out this issue?
>
> Thanks in Advance.
>
> Code :
>
>
> def folderStatistic(t):
> j, dir_name = t
> print(t) # just need to print contents of CSV file here . Dynamically
> #have furthur operation to be performed using extension and filename
>
> def get_directories():
> with open('CONFIG.csv') as f:
> reader = csv.reader(f)
> return [col for row in reader for col in row]
>
> def folderstatsMain():
> freeze_support()
> start = time.time()
> pool = Pool()
> worker = partial(folderStatistic)
> pool.map(worker, enumerate(get_directories()))
>
> def datatobechecked():
> try:
> folderstatsMain()
> except Exception as e:
> # pass
> print(e)
>
> if __name__ == '__main__':
> datatobechecked()
>
> --
> 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/ms
> gid/django-users/CAFPSiMbseEq02W4S3F613H%3Denuk1TJ4Lac7CFodW
> uaO6iGE3hA%40mail.gmail.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/CAJ4Kmg7fy7ZS7dCaUpHLeDF8pvxOpAks2YQrpNPqinWuA89T%2BA%40mail.gmail.com.


In immediate help of a long time pending request, kindly help.

2021-06-01 Thread Joel Tanko
If you want to show the items relative to the currently logged in user, try
adding this option => limit_choices_to={'user' : 'user'}, to your items
field in models.py



On Tuesday, 1 June 2021, Aritra Ray  wrote:

> Right, thank you so much.
>
> Regards.
>
> On Tue, 1 Jun, 2021, 8:27 pm oba stephen,  wrote:
>
>> You should return this if you want to redirect to cart;
>>
>> return redirect(reverse("store:cart-page", kwargs={"id": > cart>}))
>>
>> Best regards
>>
>> Stephen Oba
>>
>> On Tue, Jun 1, 2021, 3:27 PM Aritra Ray  wrote:
>>
>>> Sure, here's the file.
>>>
>>> [image: 2021-06-01 (6).png]
>>>
>>> Regards,
>>> Aritra.
>>>
>>> On Tue, 1 Jun 2021 at 19:45, oba stephen  wrote:
>>>
 Can I see your urls.py?

 Best regards

 Stephen Oba

 On Tue, Jun 1, 2021, 3:05 PM Aritra Ray  wrote:

> Oh, okay. I was unaware of that. Although, my cart page is getting
> redirected back to home page. Can you spot any mistake in the provided
> screenshots?
> Also, can you please guide on how to redirect a function to the
> previously visited page? Like add-to-cart should redirect to either
> products page or cart page itself depending on which page the user called
> it from.
>
> On Tue, 1 Jun, 2021, 6:37 pm oba stephen, 
> wrote:
>
>> Hi,
>>
>> I don't think you have an error here. Although I haven't looked at
>> the code, but from your django admin page I can see that none of those
>> items are selected.
>>
>> If you run a query from your terminal, you would notice that the
>> items would return as empty.
>>
>> When you create a many to many relationship in django, all objects on
>> that related model would display this way.
>>
>> What is the difference between different carts?  The difference is,
>> the items would be selected or highlighted in a cart they belong to.
>>
>> Regards
>>
>> Best regards
>>
>> Stephen Oba
>>
>> On Tue, Jun 1, 2021, 1:52 PM Aritra Ray  wrote:
>>
>>>
>>> Hello,
>>> This is Aritra reposting the same error. I have a problem regarding
>>> an E-commerce Django website where the cart model on the admin page is
>>> showing the items added to cart by one user to all other users as well.
>>> I have a Profile model and a Cart model attached below. The views.py
>>> has been attached too. Kindly comment back if anything else is needed.
>>> Thanks in advance.
>>>
>>>
>>> Regards,
>>> Aritra
>>>
>>> Error:
>>>
>>> [image: 2021-06-01 (4).png]
>>>
>>> Views.py
>>>
>>> [image: 2021-06-01 (1).png][image: 2021-06-01 (5).png]
>>>
>>> Models.py
>>>
>>> [image: 2021-06-01 (2).png][image: 2021-06-01 (3).png]
>>>
>>> --
>>> 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/CAFecadtNZeLb
>>> atpdnuC_RUDdjLjbrvZTO%2BMVD7hPuHNkN%2Bv%2BBA%40mail.gmail.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/CAAJsLnpYBVfa
>> cxd3NJ7sqnC6dD2b6nBQw%3DFqfQe9Od1%2BpwTHww%40mail.gmail.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/CAFecadvZ11v-
> bvZzCXUVUTpr0WBa6eVmF7M6qpoVRFNF5dS%2Bcg%40mail.gmail.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 

Re: How Choose Random User from database ?

2021-04-19 Thread Joel Tanko
if you already have a table with some rows in it, writing a random function
would work just fine.

# as an example
from random import randint
def select_random_user():
all_users = User.objects.all()
selected = list(all_users)[randint(0, all_users.count())]
return selected

On Tue, 20 Apr 2021 at 01:45, Mustafa Burhani 
wrote:

> I want to Choose random user from databse is possible with django shell or
> need to create model ? for random function ?
>
>
> Thanks !
>
> --
> 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/055d5a55-ad28-4a97-b1ec-1d16369cc2a2n%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/CAJ4Kmg6nF1%2B027oUJ-L6jWbM_XGy_3vj9n%2BvkZM42P3BBbLREA%40mail.gmail.com.


Extending with plugins remotely -at least from a frontend

2021-04-07 Thread Joel Tanko
Hi guys I have a question just one, but it houses a myriad of smaller
questions for clarity.

So I'm building a django app that creates virtual organizations, I'm
planning on hosting with digitalocean for reasons. My app just creates a
droplet and host a site ( already done that)

Now I want my users ( mainly people with zero coding knowledge or ability)
to be able to install plugins to their django site using the frontend.

 How do I get this working without users tampering with the settings.py file

> is it possible?
> what packages would I need?
> how would I setup the installation process?

PS: a example would be how shopify handles its plugins and installation
from the frontend remotely - if shopify were built on django.

Cheers!

-- 
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/CAJ4Kmg57YQTUYYwdewFeK%2Bnvijc%2ByhO4-DQ3cCwc%3DMRmB5SL8Q%40mail.gmail.com.


Re: Django Tutorial Part 3 Error for Django 3.1

2021-03-16 Thread Joel Goldstick
On Tue, Mar 16, 2021 at 9:11 AM Ronnie Atuhaire  wrote:

> Hello everyone, I joined this platform like a week ago not because I am
> experienced but because I am new to Django and would like to connect with
> like  minded people.
>
> I have experienced an HTTP404 Error while following this tutorial at 
> *https://docs.djangoproject.com/en/3.1/intro/tutorial03/
> <https://docs.djangoproject.com/en/3.1/intro/tutorial03/> *
>
> Writing Views --I am stuck here, I can't see this page.
>
> """Take a look in your browser, at “/polls/34/”. It’ll run the detail() method
> and display whatever ID you provide in the URL. Try “/polls/34/results/”
> and “/polls/34/vote/” too – these will display the placeholder results and
> voting pages""".
>
> I have been trying to figure it out but seems I have failed so far, tried
> stack overflow but no help so far. Any one who is interested in helping me
> out please let me know.
> [image: image.png]
>
> I will be so grateful.
>
> Ronnie A
>
> --
> 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/CAOPBWLc8Af0TtufUiV08m9djKhaodzWW35Kig%2BdrHMuHQfUNng%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAOPBWLc8Af0TtufUiV08m9djKhaodzWW35Kig%2BdrHMuHQfUNng%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

You haven't entered any url patterns in urls.py
-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays

-- 
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/CAPM-O%2BwqTTCk1gf7469Xnun0NMfahLFepOBXcMD6yeCRavnqyA%40mail.gmail.com.


Using django cms in a model instance scenario rather than the whole site

2021-01-15 Thread Joel Tanko
Hey guys,
So I have this django project that works similar to shopify(only on a
smaller scale) that allows local businesses to open and manage their online
stores - made possible by the django app.
I decided it would be a good idea to let the store owners (or merchants)
send emails from their admin dashboard using django's send_mail and
django_cms to create a html template of the email.
My real issue is that i've no clue whatsoever as to integrating the
django_cms editor(and all editing tools) into the view without  django_cms
taking over the whole site ( also leaking django's admin panel to logged in
user, which is a big security issue). Any help on this? Is it even feasible?
Thanks for the help.

-JT

-- 
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/CAJ4Kmg4YhRdHg2Ez42YRBeA_2Ovd3gkMDzMSgBVEmVyAxMgryQ%40mail.gmail.com.


Re:REQUEST FOR GUIDES IN MY DJANGO CRYPTO EXCHANGE PROJECT

2021-01-15 Thread Joel Tanko
Still need help? Email me @ 7thog...@gmail.com

On 13 Jan 2021 3:03 pm, "yingi keme"  wrote:

> Send a mail to yingik...@gmail.com. From your name I know you are Ijaw. I
> am too.
>
> I can address all or most of your issues.
>
>
>  Original Message 
> Subject: REQUEST FOR GUIDES IN MY DJANGO CRYPTO EXCHANGE PROJECT
> From: Emiedonmukumo Dick Boro
> To: Django users
> CC:
>
> Hello Guys,
> This is my First Conversation in this Group. I want to create my Crypto
> Project using django, But I am having challenges with some areas in django.
> I need guides on :
> Login/Logout area,
> Signup,
> authentication,
> accepting and sending payments,
> also buy, that is the payment processor.
>
> Thanks.
>
> --
> 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/c1a17f64-ff78-48da-93b3-3e77c8e11b20n%
> 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/t4bcik6m5aitpo8k64ycldtzu0w3ii
> t5nmkn-vbj5oy-g8r38pfdwiov-3x0mv9-yd7hj0-20xung-rjr6xkleltim-fdmqcu-
> g1mbkk8p2jaerizduy-pyngxo-8kll6p850ygr-7qv1au-xt5fut-
> de3yr8.1610546533285%40email.android.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/CAJ4Kmg7agAYvJ7KpOxfP0yHGncAm95DFJgSYpuWEgnhuEY4F-A%40mail.gmail.com.


Stack Overflow Question

2021-01-09 Thread Joel Tanko
Hey, guys any ideas on how to get about this?

Django CMS in Django
https://stackoverflow.com/q/65645573/12957767?sem=2

-- 
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/CAJ4Kmg6U%2BTxJ3ffmgAXA1EYduYcbQ5tGi6Ui4Fhef921faF%2Bag%40mail.gmail.com.


Re: Redirect one page to another on Django tremplate

2021-01-09 Thread Joel Tanko
You can try using the javascript window.locqtion.href('redirect-url')

On 7 Jan 2021 10:07 pm, "pankaj palmate" 
wrote:

> can you elaborate it more means are you taking about Response?
>
>
> On Thursday, January 7, 2021 at 10:48:33 PM UTC+5:30 amanmo...@gmail.com
> wrote:
>
>> Hello Django Lover,
>>
>> I have a doubt how can we redirect one page to another on API response /
>> fetch response on Django template .
>>
> --
> 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/b96bed14-da97-4f0e-a9d5-a1b044f45dc7n%
> 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/CAJ4Kmg4uf6hYuudHm6f8vYWou9jw4JTCGgjx1fXPMY2c5je_hg%40mail.gmail.com.


Re: Ongoing project

2020-12-20 Thread Joel Tanko
I am interested. I'm Joel from Nigeria

On 20 Dec 2020 12:53 am, "Oyedele Yusuff"  wrote:

> I'm interested
>
> On Thu, 17 Dec 2020 12:42 pm Peter Kirieny, 
> wrote:
>
>> Hello team
>> I have a project in django
>> (developing an ecommerce website with some innovations)
>>
>> Using pycharm and python, am looking for a partner here
>>
>> Am a Kenyan, in Nairobi
>>
>> If interested please inbox for more information
>>
>> --
>> 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/CAL8t8eovVqpPJGfTAE9Q_%3DuPdazu3xxF-
>> 79CQxmcf7MNNAL6YA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAL8t8eovVqpPJGfTAE9Q_%3DuPdazu3xxF-79CQxmcf7MNNAL6YA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAAmMZ-kJ2nbo70sKopeoRiX1g1xdHqNba7EC
> t8gX75dc%2BNEAOA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAAmMZ-kJ2nbo70sKopeoRiX1g1xdHqNba7ECt8gX75dc%2BNEAOA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAJ4Kmg6YVyhhTT-F%2BVnuWpAcR9J8U%2B1JnkzM7tqwBH7LJtmuew%40mail.gmail.com.


Re: files static error

2020-12-06 Thread Joel T
My spanish is at a zero, but unless django started accepting lists for the 
STATIC_ROOT settings, thats where the errror lies

could somebody tell the author to remove the square braces from the 
STATIC_ROOT argument and also to rename the path to something else since 
django doesn't accept for the STATIC_ROOT path to be included in the 
STATICFILES_DIRS setting.

On Sunday, 6 December 2020 at 18:25:39 UTC+1 febr...@gmail.com wrote:

> Hola,
>
> tengo un error en el enrutamiento y no logro definir por que, la version 
> de django es 3.1.* es como que si la ruta declarada no existiera, 
> agradeceria mucho su ayuda
>
> *ARCHIVO SETTINGS.PY*
>
> from pathlib import Path
>
> # Build paths inside the project like this: BASE_DIR / 'subdir'.
> BASE_DIR = Path(__file__).resolve().parent.parent
>
> INSTALLED_APPS = [
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'apps.adopcion',
> 'apps.mascota',
> ]
>
> -
> .
> .
> .
>
> -
>
> # STATIC_ROOT = [Path(BASE_DIR, 'static')]
> STATIC_URL = '/static/'
> STATICFILES_DIR = [Path(BASE_DIR, 'static'),]
> *FIN ARCHIVO*
>
> -
>
>
> * ARCHIVO HTML*
>
> {% load static%}
>
> 
> 
> 
> 
> {% block extrastatic %}
>
> {%endblock%}
> 
> 
>
> {%block title %} documento {%endblock%}
> 
>
>
>
> -
> diagrama de carpetas
> -refugio
> ---apps
> -mascota
> -adopcion
> ---refugio
> --settings.py
> --+
> ---static
> ---css
> base.css
> bootstrap.min.css
> ---template
>
>

-- 
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/b1208a92-de11-4013-9cff-32f64578348dn%40googlegroups.com.


is a custom model even possible

2020-12-06 Thread Joel T
Hi everyone,
I'm new here and have zero clues as to how to create a model with methods 
that can be overridden by each instance . i.e Each instance will provide 
its own methods that will be called when a certain event is triggered.

-- 
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/c4bb1357-1d33-4ccb-b6a5-68d2d231a68en%40googlegroups.com.


Re: django adding element to list

2020-11-12 Thread Joel Goldstick
On Wed, Nov 11, 2020 at 7:48 PM rssail  wrote:
>
>
> I'm confused with how django adds elements to a list. consider the following:
>
> def add(request):
> if request.method == "POST":
> form = NewTaskForm(request.POST)
should the above line be indented?
> if form.is_valid():
> task = form.cleaned_data["task"]
>
>  request.session['tasks'].append(task)
> # request.session['tasks'] += [task]
>
> return HttpResponseRedirect(reverse("tasks:index"))
>  else:
> return render(request, "tasks/add.html",{
>   "form": form
>  })
> return render(request, "tasks/add.html",{
> "form": NewTaskForm()
>})
>
> if we add a print statement after request.session['tasks'].append(task) we 
> get a list:
>
> ['check email']
>
> we also get the same list if we comment the append line and use the correct 
> way with +=
>
> However, on the redirect to task/index the first way shows an empty list and 
> the second way shows the list that's expected. Why? Whats going on?
>
> --
> 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/a603090f-676e-4608-83f5-ed3f85995dd0n%40googlegroups.com.



-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays

-- 
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/CAPM-O%2Bwp4UtJOeFMkvnugpnymUJJap_Twi8qd%2Be5JmduM0W6Gw%40mail.gmail.com.


Need Help : Custom User Model

2020-07-22 Thread Joel T
I'm a newbie to web development and more so with the use of django. How do I 
create a custom user model that has additional fields for other users of my web 
app while keeping the default django user model for myself - mid-project. I 
appreciate the help.
Thanks.

-- 
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/91f849a9-f7e8-4254-9088-a0c22b5b96e0o%40googlegroups.com.


Stuck trying to add an image display to admin

2019-12-11 Thread Joel Ricker
In my admin I have a section for editing products and for each product has 
a one to many of sample images. I wanted to display the image for convience 
in my StackedInline for the sample images. However after setting everything 
up to display the sample image, I am still getting an internal error when 
it tries to render the view. Can someone look at it and give me an idea of 
whats going on?

Here is my code so far:


admin.py: 

class SampleInline(admin.StackedInline):
model = SampleImage
extra = 3

 

verbose_name = "Sample Page"
verbose_name_plural = "Sample Pages"

 

fieldsets = (
(None, {
'fields' : ("sample_type", "sample_image", "order", 
"display_sample_image",)
}),
)
readonly_fields = ("display_sample_image",)

 

def display_sample_image(self, obj):
return obj.display_sample_image()
return "testing"


 models.py

class SampleImage(models.Model):
sheet = models.ForeignKey(Sheet, related_name = "samples", 
on_delete=models.CASCADE, null=True)
sample_type = models.IntegerField(choices=IMAGE_CHOICES, 
default=IMAGE_CHOICES[-1][0])
sample_image = models.ImageField(upload_to=sample_image_upload_to)
order = models.IntegerField(blank=True,  null=True)


def display_sample_image(self):
width = 200
height = width * self.sample_image.height / self.sample_image.width
return format_html('http://127.0.0.1:8000/admin/browse/sheet/3868/change/

Django Version: 2.2.7
Python Version: 3.7.0
Installed Applications:
['browse.apps.BrowseConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']


Template error:
In template 
E:\Python\Python37\lib\site-packages\django\contrib\admin\templates\admin\includes\fieldset.html,
 
error at line 17
   2
   7 : 
   8 : {% if line.fields|length_is:'1' %}{{ line.errors }}{% 
endif %}
   9 : {% for field in line %}
   10 : 
   11 : {% if not line.fields|length_is:'1' and not 
field.is_readonly %}{{ field.errors }}{% endif %}
   12 : {% if field.is_checkbox %}
   13 : {{ field.field }}{{ field.label_tag }}
   14 : {% else %}
   15 : {{ field.label_tag }}
   16 : {% if field.is_readonly %}
   17 :  {{ 
field.contents }} 
   18 : {% else %}
   19 : {{ field.field }}
   20 : {% endif %}
   21 : {% endif %}
   22 : {% if field.field.help_text %}
   23 : {{ 
field.field.help_text|safe }}
   24 : {% endif %}
   25 : 
   26 : {% endfor %}
   27 : 


Traceback:

File "E:\Python\Python37\lib\site-packages\django\db\models\options.py" in 
get_field
  565. return self.fields_map[field_name]

During handling of the above exception ('display_sample_image'), another 
exception occurred:

File "E:\Python\Python37\lib\site-packages\django\contrib\admin\utils.py" 
in lookup_field
  262. f = _get_non_gfk_field(opts, name)

File "E:\Python\Python37\lib\site-packages\django\contrib\admin\utils.py" 
in _get_non_gfk_field
  293. field = opts.get_field(name)

File "E:\Python\Python37\lib\site-packages\django\db\models\options.py" in 
get_field
  567. raise FieldDoesNotExist("%s has no field named '%s'" % 
(self.object_name, field_name))

During handling of the above exception (SampleImage has no field named 
'display_sample_image'), another exception occurred:

File 
"E:\Python\Python37\lib\site-packages\django\core\handlers\exception.py" in 
inner
  34. response = get_response(request)

File "E:\Python\Python37\lib\site-packages\django\core\handlers\base.py" in 
_get_response
  145. response = self.process_exception_by_middleware(e, 
request)

File "E:\Python\Python37\lib\site-packages\django\core\handlers\base.py" in 
_get_response
  143. response = response.render()

File "E:\Python\Python37\lib\site-packages\django\template\response.py" in 
render
  106. self.content = self.rendered_content

File "E:\Python\Python37\lib\site-packages\django\template\response.py" in 
rendered_content
  83. content = template.render(context, self._request)

File 

New project Django.....any one willing to assist in doing a project...

2019-07-10 Thread Joel Rotich
Share your emailNeed someone really quickI have some basics but I 
need to work with an expert to speed up. I will pay for Hrs used.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d0a6e833-0933-4014-bbfd-8651f593c513%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Who can help setup Bazzite scripts for Knowldge base

2019-07-10 Thread Joel Rotich
https://github.com/bazzite/scritsplease assist

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9ce92a36-d99e-4b56-9764-56d6198f6620%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to create Different Graphs and PDF Reports

2019-06-24 Thread Joel Mathew
You can use reportlab for pdf generation

On Mon, 24 Jun, 2019, 9:18 PM Balaji Shetty,  wrote:

> HI
> can anyone suggest How to create Different Graphs and PDF Reports in
> Django Admin Panel itself which work on Models with relation.
> It there any library.
>
>
>
> --
>
>
> *Mr. Shetty Balaji S.Asst. ProfessorDepartment of Information Technology,*
> *SGGS Institute of Engineering & Technology, Vishnupuri, Nanded.MH.India*
> *Official: bsshe...@sggs.ac.in  *
> *  Mobile: +91-9270696267*
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAECSbOvi0sAta%3Do%2BmBf%2BVTBbTcAU6ZmZZBvWKoaU1T4-TFf2jw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__%3DM6XKNwu40og2wtrUDtk87K4%3DdXFet8ytas4Sa1rybA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: mod_wsgi problem

2019-06-06 Thread Joel Mathew
Always read installation README and github README before installing
anything. It seems you dont even have a basic compiler installed.

For Debian based systems, install:

`sudo apt install build-essential`
Sincerely yours,

 Joel G Mathew



On Thu, 6 Jun 2019 at 17:09, Davin Pore  wrote:

> how able to resolve this issue. I tried to install the mod_wsgi on manual
> procedure.
>
> [image: mod_wsgi.jpg]
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d56ff442-ac07-4328-a6b0-b4bee64095d5%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d56ff442-ac07-4328-a6b0-b4bee64095d5%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9ngHcA-d1Me9uNfEiohxBcZLhWf6txj4%3Dm13QrOq8tKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Anyone kind enough to help me understand these few concepts

2019-05-16 Thread Joel Mathew
I would suggest you go through the official tutorial. Your questions don't
have relation to django. It seems you're still at the concept/algorithm
level of your app.

In django, you put all your logic in your views, retrieve data from models
into views, and then pass the data from views to templates which display
the data.
Sincerely yours,

 Joel G Mathew



On Thu, 16 May 2019 at 22:02, DumbaClassics  wrote:

> I am still new on Django Web Framework and I want to understand the MVC
> concept based on this Project structure. Say I am trying to come up with an
> Online Gambling platform. Where exaclty do put the following;
>
> 1. say I want the player to randomly shuffle cards, is this whole business
> called on views.py or models or in models I just put a class related to
> creating my database?
> 2. say I want a player to have a ticket which is a receipt that can be
> picked randomly from those who have signed up for a draw. how exaclty do i
> have my clients get randomly generated receipts numbers using the
> random.randint module
> 3. Is there a possibility to generate a coin that is a local currency
> which enables players to buy them and then use the tokens for buying
> tickets into the game? If so how do i go about it in django python
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6658851f-f32c-42d4-bb04-7e00c0715a97%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/6658851f-f32c-42d4-bb04-7e00c0715a97%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8P8wApcV57A5mkQNt0DADfdRMa-90vj%3DeYCwA2bjXXng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: WYSIWYG/Rich Text Editor recommendations

2019-04-30 Thread Joel Mathew
Currently I'm using quill. It's easy to implement, and has all basic
features.
Sincerely yours,

 Joel G Mathew



On Wed, 1 May 2019 at 05:47, Tim Johnson  wrote:

> Using python 3.7.2 and django 2.1.5
>
> Production is in Ubuntu 16.04 and prospective deployment is likely
> to be CentOS with same python/django.
>
> I'm a retired python developer.
>
> I'd welcome recommendations and/or caveats regarding  a stable
> WYSIWIG "plugin".
>
> Much is available on google, but it is always edifying to hear
> individual comments.
>
> I currently publish on drupal using its ckeditor plugin. My common
> method is to compose articles in LibreOffice, then copy and paste
> into the editor. Works well, except that it IS drupal.
>
> I'd like to recreate the same functionality with django. I will need
> to be able to include embedded images.
>
> TIA
> --
> Tim
> http://www.tj49.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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/20190501001716.GD2404%40mail.akwebsoft.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9GFDrj4DT%3DrZg8UMZeXLj7iG%2Bcz8moe_RNZNfNHkTE%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simplifying code with multiple loops and logic, into queryset aggregates

2019-04-30 Thread Joel Mathew
Thank you Matthew. Excellent advise as always. When I started off with this
project 5 months ago, I was a beginner to both django and python. I've come
a bit along the journey. That customer model is the first model I created,
and I was unaware of these conventions. By the time I realized that, the
project has branched into several apps, and the code now runs into
thousands of lines of code. I didnt change the naming due to fear of
breaking other code. :)

Nowadays I do it more "pythonically". Still, it's great to have people like
you offer excellent general advise to help budding enthusiasts!

Sincerely yours,

 Joel G Mathew



On Tue, 30 Apr 2019 at 20:33, Matthew Pava  wrote:

> It was a little difficult to follow your message because the formatting is
> non-standard, but I think this might be what you’re looking for.
>
> Also, you should try to follow more Python coding conventions: models
> start with an upper case letter. Variables start with a lower case letter.
>
>
>
> And you probably want to use a QuerySet Manager on Customer. Maybe a query
> like this:
>
> Customer.objects.annotate(is_admitted=Case(When(admission_set__discharged=False,
> then=True), default=False).distinct()
>
>
>
>
>
> *From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *Joel Mathew
> *Sent:* Tuesday, April 30, 2019 9:22 AM
> *To:* django-users@googlegroups.com
> *Subject:* Simplifying code with multiple loops and logic, into queryset
> aggregates
>
>
>
> My models:
>
>
>
> class customer(models.Model):
>
> cstid = models.AutoField(primary_key=True, unique=True)
>
> insurance_number = models.CharField(max_length=100, blank=True,
> null=True)
>
> name = models.CharField(max_length=35)
>
> ageyrs = models.IntegerField(blank=True)
>
>
>
> class Admission(models.Model):
>
> id = models.AutoField(primary_key=True, unique=True)
>
> clinic = models.ForeignKey(Clinic, on_delete=models.CASCADE)
>
> customer = models.ForeignKey(customer, on_delete=models.CASCADE)
>
> diagnosis = models.CharField(max_length=2000, default='', blank=
> True)
>
> date_admission = models.DateTimeField(default=timezone.now)
>
> ward = models.ForeignKey(Ward, on_delete=models.CASCADE)
>
> bed = models.ForeignKey(Bed, on_delete=models.CASCADE)
>
> discharged = models.BooleanField(default=False)
>
> ip_number = models.IntegerField(blank=True)
>
> ip_prefix = models.CharField(max_length=20, default='', blank=True
> )
>
>
>
> My objective: Set a variable to a query filter, adding a property,
> 'is_admitted' to the queryset, so that I can pass this query set to the
> template and use the property while displaying data.
>
>
>
> Code:
>
>
>
> def is_admitted(cust):
>
> admission = Admission.objects.filter(customer=cust, discharged=
> False)
>
> admission_results = len(admission)
>
> if admission_results > 0:
>
> return True
>
> return False
>
>
>
> my_q = or_q_if_truthfull(
>
> cstid=HospitalID,
>
> name__lower__contains=name.lower() if name else None,
>
> ageyrs=ageyrs if ageyrs.isdigit() else None,
>
> agemnths=agemnths if agemnths.isdigit() else None,
>
> mobile__contains=mobile if mobile else None,
>
> alternate__contains=alternate if alternate else None,
>
> email__lower__contains=email.lower() if email else None,
>
> address__lower__contains=address.lower() if address else None,
>
> city__lower__contains=city.lower() if city else None
>
> )
>
> ORSearchResult = customer.objects.filter(my_q, linkedclinic=clinicobj)
>
> cust_set = []
>
> cust_admission_status = []
>
> for cust in ORSearchResult:
>
> cust_set.append(cust)
>
> cust_admission_status.append(is_admitted(cust))
>
> print(f"Customer name: {cust.name} Admission status: {
> is_admitted(cust)}")
>
> cust_templ_set = zip(cust_set, cust_admission_status)
>
>
>
> And in template, I will do:
>
>
>
> {% for cust, status in cust_templ_set %}
>
> {{ cust.name }} {{ status }}
>
> {% endfor %}
>
>
>
> I want to understand how I can convert my above code by generating an
> aggregate over the queryset, so that I can use a property of the query,
> and change the template code to the following, and avoid the loop in the
> view, and the zip. So that the template code becomes:
>
>
>
> {% 

Re: More controls on createsuperuser

2019-04-30 Thread Joel Mathew
It's not the command that you should be worried about, but shell access to
your system. If your database server is secure, shell access is restricted,
and the server is also hardened reasonably, you should be relatively safe.
Sincerely yours,

 Joel G Mathew



On Tue, 30 Apr 2019 at 21:07, Mario R. Osorio  wrote:

> You'd only need editing the already existing management command and remove
> the possibility of using createsuperuser, but that is as useless as a
> ceiling fan on a motor bike.as anyone that already has access to the
> management code could just revert those changes. even continuing this
> thread is a waste of time.
>
> Dtb/Gby
> ===
> Mario R. Osorio
> B.A.S. of Information Technology
> Web page: *http;//mario.osorio.solutions
> <http://http%3B//mario.osorio.solutions>*
> Email: *mario@osorio.solutions* 
> *Just Choose Python!* <http://www.gentoogeek.org/files/choose_python.pdf>
>
> *SQL programmers don't die, they just ROLLBACK the TRANSACTION.*
>
>
>
> On Tue, Apr 30, 2019 at 11:12 AM Chetan Ganji 
> wrote:
>
>> RE :"*someone could still run createsuperuser *"
>>
>> How do you suppose this is going to happen unless they have access to
>> your system?
>>
>> If you are really concerned about that?? django is basically a package.
>> Just find the source code for the creatsuperuser admin command and delete
>> that file if its the only command in that file ;-)
>> if not just delete that function only :) Its that simple.
>>
>> But How will you create a superuser after deleting the command from the
>> django package??
>>
>> One way to solve is write your own custom management command, create
>> superuser at the time of deployment and delete that custom command also.
>>
>> I hope this solves your problemo :)
>> Cheers!
>>
>>
>> Regards,
>> Chetan Ganji
>> +91-900-483-4183
>> ganji.che...@gmail.com
>> http://ryucoder.in
>>
>>
>> On Tue, Apr 30, 2019 at 6:09 PM Lipika Chandel 
>> wrote:
>>
>>> Hey,
>>> I am using Django 2.2 and I am stuck with the image upload functionality
>>> from admin site. I am not able to get the image on my template.
>>> Please help.
>>>
>>> Thanks & Regards
>>> LIPIKA CHANDEL
>>>
>>> On Tue, Apr 30, 2019 at 11:57 AM Jani Tiainen  wrote:
>>>
>>>> I've have to agree that any attempt to limit superuser creation through
>>>> manage.py is wrong solution to wrong problem.
>>>>
>>>> Even it's possible to attempt it it is as easy to circumvent.
>>>>
>>>> So do not give an access to manage.py to users that are not supposed
>>>> to. Problem solved for good.
>>>>
>>>> ma 29. huhtik. 2019 klo 21.04  kirjoitti:
>>>>
>>>>> Anyone capable of running the createsuperuser command on your project
>>>>> most probably has access to all and any of the project's files, specially
>>>>> your config file.
>>>>>
>>>>> Actually this user is either a valid su or you are in serious trouble
>>>>> because the security of your server sucks or you gave access to your
>>>>> project to the wrong person.
>>>>>
>>>>> So, no I don't think there is any point in doing so. Not because it
>>>>> can't be done but because it is both trivially useless.and uselessly
>>>>> trivial.
>>>>>
>>>>>
>>>>>
>>>>> On Sunday, April 28, 2019 at 11:24:57 PM UTC-4, JJ Zolper wrote:
>>>>>>
>>>>>> All,
>>>>>>
>>>>>> Curious what people think about more thought and control going into
>>>>>> who can run the createsuperuser method?
>>>>>>
>>>>>> For example say there's models that I don't want anyone to touch
>>>>>> except myself as a superuser. Is it not plausible that even if I make a
>>>>>> Django Group around that model that someone could still run 
>>>>>> createsuperuser
>>>>>> and give themselves the ability to have full control?
>>>>>>
>>>>>> Wouldn't it make sense if some random developer were to run
>>>>>> createsuperuser using django settings with any of the databases (as an
>>>>>> example) that it prevent them if say that email isn't on say an internal
>>>>>> list in the django admin of approved potential users?
>>>>>>
>>&g

Re: Button Event

2019-04-30 Thread Joel Mathew
Templates expand into html. So you just write javascript like you normally
do. You call javascript from within your templates by using something like:



Here, I am using {% load static %}
Sincerely yours,

 Joel G Mathew



On Tue, 30 Apr 2019 at 12:05, Mayur Bagul  wrote:

> Thanks Ahmed,
>
> can you please provide me resource to learn  how to use java script and
> events in django Templates?
> Because im not getting proper resource how to use java script in django.
>
> Actually on one web page there will be one button after clicking on that
> button i want to merge another web page inside  current one.
> can you help me with that?
>
> Thanking you
>
>
>
>
>
>
> On Monday, April 29, 2019 at 11:03:35 PM UTC+5:30, Ahmed Ishtiaque wrote:
>>
>> Hi Mayur,
>>
>> I'm not sure what you mean by "there is no javascript in django" because
>> I use it all the time. JS is not tied to Django in any way since its
>> operations are usually client-side and so it can be used inside your Django
>> templates.
>>
>> In any case, you can have JS code in your template inside 

Simplifying code with multiple loops and logic, into queryset aggregates

2019-04-30 Thread Joel Mathew
My models:


class customer(models.Model):
cstid = models.AutoField(primary_key=True, unique=True)
insurance_number = models.CharField(max_length=100, blank=True, null=True)
name = models.CharField(max_length=35)
ageyrs = models.IntegerField(blank=True)

class Admission(models.Model):
id = models.AutoField(primary_key=True, unique=True)
clinic = models.ForeignKey(Clinic, on_delete=models.CASCADE)
customer = models.ForeignKey(customer, on_delete=models.CASCADE)
diagnosis = models.CharField(max_length=2000, default='', blank=True)
date_admission = models.DateTimeField(default=timezone.now)
ward = models.ForeignKey(Ward, on_delete=models.CASCADE)
bed = models.ForeignKey(Bed, on_delete=models.CASCADE)
discharged = models.BooleanField(default=False)
ip_number = models.IntegerField(blank=True)
ip_prefix = models.CharField(max_length=20, default='', blank=True)

My objective: Set a variable to a query filter, adding a property,
'is_admitted' to the queryset, so that I can pass this query set to the
template and use the property while displaying data.

Code:


def is_admitted(cust):
admission = Admission.objects.filter(customer=cust, discharged=False)
admission_results = len(admission)
if admission_results > 0:
return True
return False


my_q = or_q_if_truthfull(
cstid=HospitalID,
name__lower__contains=name.lower() if name else None,
ageyrs=ageyrs if ageyrs.isdigit() else None,
agemnths=agemnths if agemnths.isdigit() else None,
mobile__contains=mobile if mobile else None,
alternate__contains=alternate if alternate else None,
email__lower__contains=email.lower() if email else None,
address__lower__contains=address.lower() if address else None,
city__lower__contains=city.lower() if city else None
)
ORSearchResult = customer.objects.filter(my_q, linkedclinic=clinicobj)
cust_set = []
cust_admission_status = []
for cust in ORSearchResult:
cust_set.append(cust)
cust_admission_status.append(is_admitted(cust))
print(f"Customer name: {cust.name} Admission status: {is_admitted(cust)}")
cust_templ_set = zip(cust_set, cust_admission_status)

And in template, I will do:

{% for cust, status in cust_templ_set %}
{{ cust.name }} {{ status }}
{% endfor %}

I want to understand how I can convert my above code by generating an
aggregate over the queryset, so that I can use a property of the query, and
change the template code to the following, and avoid the loop in the view,
and the zip. So that the template code becomes:

{% for cust in customers %}
{{ cust.name }} {{ cust.status }}
{% endfor %}

I am not sure whether I am making complete sense, and can explain further.
Sincerely yours,

 Joel G Mathew

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-8OUE5cd%3DZBahkLMTSTD%3DOXJbYenHjiB3ORGfkY9mSrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to create the django_migrations table (ORA-00907: missing right parenthesis)

2019-04-27 Thread Joel Mathew
What's the error?
Sincerely yours,

 Joel G Mathew



On Sun, 28 Apr 2019 at 01:26, tossouwisdom  wrote:

> Django 2.2.2
> Cx_oracle 7.2
> base Oracle 11g
>
> When I run the django migrate commande, i have error 
> django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the 
> django_migrations table (ORA-00907: missing right parenthesis)
>
>   Operations to perform:
>   Apply all migrations: admin, auth, contenttypes, sessions
> Running migrations:
> Traceback (most recent call last):
>   File "C:\Python37-32\lib\site-packages\django\db\backends\utils.py", line 
> 82, in _execute
> return self.cursor.execute(sql)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\oracle\base.py", 
> line 510, in execute
> return self.cursor.execute(query, self._param_generator(params))
> cx_Oracle.DatabaseError: ORA-00907: missing right parenthesis
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
>   File "C:\Python37-32\lib\site-packages\django\db\migrations\recorder.py", 
> line 67, in ensure_schema
> editor.create_model(self.Migration)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\base\schema.py", 
> line 307, in create_model
> self.execute(sql, params or None)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\base\schema.py", 
> line 137, in execute
> cursor.execute(sql, params)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\utils.py", line 
> 99, in execute
> return super().execute(sql, params)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\utils.py", line 
> 67, in execute
> return self._execute_with_wrappers(sql, params, many=False, 
> executor=self._execute)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\utils.py", line 
> 76, in _execute_with_wrappers
> return executor(sql, params, many, context)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\utils.py", line 
> 84, in _execute
> return self.cursor.execute(sql, params)
>   File "C:\Python37-32\lib\site-packages\django\db\utils.py", line 89, in 
> __exit__
> raise dj_exc_value.with_traceback(traceback) from exc_value
>   File "C:\Python37-32\lib\site-packages\django\db\backends\utils.py", line 
> 82, in _execute
> return self.cursor.execute(sql)
>   File "C:\Python37-32\lib\site-packages\django\db\backends\oracle\base.py", 
> line 510, in execute
> return self.cursor.execute(query, self._param_generator(params))
> django.db.utils.DatabaseError: ORA-00907: missing right parenthesis
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "manage.py", line 21, in 
> main()
>   File "manage.py", line 17, in main
> execute_from_command_line(sys.argv)
>   File "C:\Python37-32\lib\site-packages\django\core\management\__init__.py", 
> line 381, in execute_from_command_line
> utility.execute()
>   File "C:\Python37-32\lib\site-packages\django\core\management\__init__.py", 
> line 375, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "C:\Python37-32\lib\site-packages\django\core\management\base.py", 
> line 323, in run_from_argv
> self.execute(*args, **cmd_options)
>   File "C:\Python37-32\lib\site-packages\django\core\management\base.py", 
> line 364, in execute
> output = self.handle(*args, **options)
>   File "C:\Python37-32\lib\site-packages\django\core\management\base.py", 
> line 83, in wrapped
> res = handle_func(*args, **kwargs)
>   File 
> "C:\Python37-32\lib\site-packages\django\core\management\commands\migrate.py",
>  line 234, in handle
> fake_initial=fake_initial,
>   File "C:\Python37-32\lib\site-packages\django\db\migrations\executor.py", 
> line 91, in migrate
> self.recorder.ensure_schema()
>   File "C:\Python37-32\lib\site-packages\django\db\migrations\recorder.py", 
> line 69, in ensure_schema
> raise MigrationSchemaMissing("Unable to create the django_migrations 
> table (%s)" % exc)
> django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the 
> django_migrations table (ORA-00907: missing right parenthesis)
>
> --
> 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 post to th

Re: Like button for user pictures.

2019-04-25 Thread Joel Mathew
I tried and could not is not a valid developer question. We're left
imagining how you tried, and how it failed. Post code with any question and
explain in words.
Sincerely yours,

 Joel G Mathew



On Fri, 26 Apr 2019 at 00:13, Nitesh Saini 
wrote:

> Hello,
> I'm working on a project similar to Instagram and I want to create a like
> button for user pictures.
> I try it with BooleanField but unable to do it. So please help
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/413143b9-b11c-4315-ad10-3cf440ad341f%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_87ZPPnAWSa%2BNb-uiAxqcY6Jv5kqRqumoPxLbgaTEQRaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrating Google calendar API in TODO list

2019-04-24 Thread Joel Mathew
I fail to see what's your difficulty in integrating this. You just insert
the code in your views, and display your processed result in your template.
Try writing code and post your error. There's no specific code needed just
for django.

If it failed, post your code with the error stream.

On Wed, 24 Apr, 2019, 10:59 PM Sipum Mishra,  wrote:

> Joel, i know there is python code for yhat API but how to integrate it.. I
> want to know that.. I tried to do but failed.
>
> On Wed, 24 Apr, 2019, 6:55 PM Joel Mathew,  wrote:
>
>> Just do it. The API has python sample code.
>> Sincerely yours,
>>
>>  Joel G Mathew
>>
>>
>>
>> On Tue, 23 Apr 2019 at 09:58, Sipum  wrote:
>>
>>> Hello friends.
>>>
>>> I am going to integrate google calendar API in to my TODO List.
>>> can anyone suggest how to integrate so that when I will add any event in
>>> my TODO List app it will directly show in my google calendar.
>>>
>>> Thanks.
>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/ebbfbf68-4445-4146-9e49-c18041796343%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/ebbfbf68-4445-4146-9e49-c18041796343%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAA%3Diw_9UTM0izFDbwcGMDxGPZaUHSy9r9L90cEkYA0Vc0JDAmQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAA%3Diw_9UTM0izFDbwcGMDxGPZaUHSy9r9L90cEkYA0Vc0JDAmQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGHZBzxv28c%3Db8MQEnXiGVY9pM6rj-u%3DwEr1VOVYMNYcZSbCVw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAGHZBzxv28c%3Db8MQEnXiGVY9pM6rj-u%3DwEr1VOVYMNYcZSbCVw%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8adPwu6_OoeCieERW9eNzcvzbP6D_2B7ntvghE7TxQLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrating Google calendar API in TODO list

2019-04-24 Thread Joel Mathew
Just do it. The API has python sample code.
Sincerely yours,

 Joel G Mathew



On Tue, 23 Apr 2019 at 09:58, Sipum  wrote:

> Hello friends.
>
> I am going to integrate google calendar API in to my TODO List.
> can anyone suggest how to integrate so that when I will add any event in
> my TODO List app it will directly show in my google calendar.
>
> Thanks.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ebbfbf68-4445-4146-9e49-c18041796343%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ebbfbf68-4445-4146-9e49-c18041796343%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9UTM0izFDbwcGMDxGPZaUHSy9r9L90cEkYA0Vc0JDAmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Storing HTML in DB using DJANGO

2019-04-21 Thread Joel Mathew
I fail to see the purpose of that. Serialisation is sufficient. Big
projects like wordpress store even big blog posts, which is html like this.
Sincerely yours,

 Joel G Mathew



On Sun, 21 Apr 2019 at 20:20, Brian M  wrote:

> What if you convert the html to an array of bytes before storing?
>
> Then you’d convert from bytes array back to string when you retrieve. This
> way you’d store raw data.
>
>
> On Apr 21, 2019, at 8:41 AM, Jani Tiainen  wrote:
>
> Well after all, HTML is just plain text... Though you probably want to
> think to do some sanitization so you won't get nasty injections via html.
>
> On Sat, Apr 20, 2019 at 9:09 PM Sipum Mishra  wrote:
>
>> Hi friends,
>>
>> I want to store a html in database using python and need to retrieve that
>> html and convert that in to PDF.
>> can u plz suggest me how to store that HTML in DB ?
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/f301b675-6587-434e-b25d-87de9d9fef10%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/f301b675-6587-434e-b25d-87de9d9fef10%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Jani Tiainen
> Software wizard
>
> https://blog.jani.tiainen.cc/
>
> Always open for short term jobs or contracts to work with Django.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHn91oe6hUWZtEYCx%3D8uNe%3DFEphZ4C_VRPv74oK2E-x9gvJjGw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHn91oe6hUWZtEYCx%3D8uNe%3DFEphZ4C_VRPv74oK2E-x9gvJjGw%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/47B36FA2-099C-4AAB-B5DA-1D9662513398%40gmail.com
> <https://groups.google.com/d/msgid/django-users/47B36FA2-099C-4AAB-B5DA-1D9662513398%40gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-pMCYKd4_7CHbcU7jz7YFZmNw3BXd6Grgwa99x6WGALg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Advanced permissions and role creation

2019-04-21 Thread Joel Mathew
Thanks a lot, guys.

On Sun, 21 Apr, 2019, 3:58 PM Jani Tiainen,  wrote:

> Hi,
>
> We do in our applications pretty much same approach as Mike proposed in
> his post. It's relatively efficient and works for both, UI and application
> side pretty well and doesn't require building anything complex and pretty
> much everything you need is already built-in in Django.
>
>
>
> On Sun, Apr 21, 2019 at 5:12 AM Joel Mathew  wrote:
>
>> I have an application for a hospital. There, I should be able to assign
>> different roles like Doctor, Nurse, Attender, Auxillary Nurse, Pharmacist,
>> Store Manager etc, each of would be having specific access to seperate
>> areas (views), with some having restricted access. In addition, there are
>> other hospitals who would be having no access to another hospital's
>> records. All of these permissions should be customisable, and I should be
>> able to create additional roles and permission groups for specific areas
>> later (from within the application itself, in production). What would be
>> the best solution to use? Is there a middleware which works well. I don't
>> want to roll my own if I will be reinventing the wheel.
>>
>> Currently my application has no use permissions. But access to specific
>> hospitals is being restricted by a model whoch stores hospital name, and
>> user name.
>> Sincerely yours,
>>
>>  Joel G Mathew
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAA%3Diw_9BrOEh4Ss3X0g_EnaFyp1XTXij5DoZvva_XxwKVzXsGQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAA%3Diw_9BrOEh4Ss3X0g_EnaFyp1XTXij5DoZvva_XxwKVzXsGQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Jani Tiainen
> Software wizard
>
> https://blog.jani.tiainen.cc/
>
> Always open for short term jobs or contracts to work with Django.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHn91od2vbV7F0WwAVp6Eppqmmd5-NgZciO_04Tm%3D9x9FSJyvQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHn91od2vbV7F0WwAVp6Eppqmmd5-NgZciO_04Tm%3D9x9FSJyvQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-6cLiAfN1NHovdY4-Y_Wtz1KToMWW6zErNKAdXNOpm1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Advanced permissions and role creation

2019-04-20 Thread Joel Mathew
I have an application for a hospital. There, I should be able to assign
different roles like Doctor, Nurse, Attender, Auxillary Nurse, Pharmacist,
Store Manager etc, each of would be having specific access to seperate
areas (views), with some having restricted access. In addition, there are
other hospitals who would be having no access to another hospital's
records. All of these permissions should be customisable, and I should be
able to create additional roles and permission groups for specific areas
later (from within the application itself, in production). What would be
the best solution to use? Is there a middleware which works well. I don't
want to roll my own if I will be reinventing the wheel.

Currently my application has no use permissions. But access to specific
hospitals is being restricted by a model whoch stores hospital name, and
user name.
Sincerely yours,

 Joel G Mathew

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9BrOEh4Ss3X0g_EnaFyp1XTXij5DoZvva_XxwKVzXsGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need assistance! I want to create a list box that displays records that can be selected (single or multiple) from a PGSQL table.

2019-04-17 Thread Joel Mathew
Great to know

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__%3DUFXqRjf2k%2BzAGS9HfonORYntxFHtsLEOvXEcv0Lp-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I need help on adding a search button to an input field

2019-04-10 Thread Joel Mathew
Use bootstrap's input-group-append
Sincerely yours,

 Joel G Mathew



On Wed, 10 Apr 2019 at 23:14, Nanjuki Saidat 
wrote:

> Please any one to help me out.thanks
>
> On Wed, 10 Apr 2019 at 20:40, Nanjuki Saidat 
> wrote:
>
>> this one still did the same thing which i didnt mean me i meant an search
>> button in an input field
>>
>> On Wed, 3 Apr 2019 at 22:04, Anirudh Jain 
>> wrote:
>>
>>> You can include the following code in the end
>>>
>>> ButtonHolder(
>>> Submit('submit', 'Update', css_class='btn btn-theme small')
>>> )
>>>
>>> Take care of proper indentation.
>>>
>>> On Wed, 3 Apr 2019, 23:48 Nanjuki Saidat, 
>>> wrote:
>>>
>>>> Hi everyone,
>>>> I want to add a search button to an input search field , if there is
>>>> anyone who knows
>>>> how to add a button to the field in crispy form's input field. Please
>>>> help me out
>>>>
>>>>
>>>> https://pagure.io/fedora-commops/fedora-happiness-packets/issue/raw/files/a8846b7d72aced5bdc0a2470dc97a495fb7558d6a0908a04b369260e862d-Screenshot_2019-03-20_Open-source_Happiness_Packets.png
>>>>
>>>> --
>>>> 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 post to this group, send email to django-users@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/CAHrBrjDW%2Bn-oHwdiYRpw%3DdS8HA%2BAH%2Bne3_kjmxz-UHYqPhX9ow%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAHrBrjDW%2Bn-oHwdiYRpw%3DdS8HA%2BAH%2Bne3_kjmxz-UHYqPhX9ow%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAC3mK7fBWiFTXEqeDHPfiExZ39DexHK90OBQ6mmsrSpfD2CCVA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAC3mK7fBWiFTXEqeDHPfiExZ39DexHK90OBQ6mmsrSpfD2CCVA%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHrBrjAhx4wY-eouLXr3LWYR9hsD_18bULS-p_6qku1cfDPKHA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHrBrjAhx4wY-eouLXr3LWYR9hsD_18bULS-p_6qku1cfDPKHA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-x-jotqifY8DdpA-xHxF9XFMCcbACVOhkEJDd_fmgRzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django module view has no attribute?

2019-04-02 Thread Joel Mathew
Is there a function named posts in views.py?

On Tue, 2 Apr, 2019, 7:29 AM drone4four,  wrote:

> I’m taking a Udemy course by Nick Walter and rather than copying line by
> line, I’m trying to branch out and experiment on my own.
>
> The purpose of the website I am creating is for a small blog, with the
> ability to redact string input (in an HTML form) from the user. There is
> also a word counter for the body content of the blog.
>
> I got Django running but as soon as I started adding the code I wrote,
> Django stopped running properly.
>
> Here is the traceback in full: https://pastebin.com/8HtdNwPP
>
> The main issue shows at the bottom:
>
> File
>> "/home//dev/projects/python/2018-and-2019/CC_Redact_Iter2/CC_Redact_Iter2/urls.py",
>> line 28, in 
>>* path('^james/', views.posts, name='james'),*
>> *AttributeError: module 'counters.views' has no attribute 'posts’*
>
>
>
> Based on this traceback, I gather I have probably misnamed a function or a
> file name or template but I can’t for the life of me figure which one or
> where.
>
> My entire source code repo can be found here:
> https://github.com/Angeles4four/CC_Redact_Iter2
>
> Here are some of the relevant files involved.
>
> urls.py:
>
> from django.contrib import admin
>> from django.urls import path
>> # from . import views
>> from posts import views
>> from redactors import views
>> from counters import views
>> urlpatterns = [
>>   path('admin/', admin.site.urls),
>>   path('^$', views.home, name='home'),
>>   path('^result/', views.result, name='result'),
>>   path('^seth/', views.counters, name='seth'),
>>   path('^james/', views.posts, name='james'),
>>   path('^james/', views.redactors, name='simon'),
>> ]
>
>
>
> counters/views.py:
>
> from django.http import HttpResponse
>> from django.shortcuts import render
>> def home(request):
>>   if 'ccEntry' in request.GET:
>>   number = request.GET['ccEntry']
>>   redacted_num = '   {}'.format(number[-4:])
>>   return render(request, 'result.html', {'number':number,
>> 'redacted_num':redacted_num})
>>   else:
>>   return render(request, 'home.html')
>> def result(request):
>>return render(request, 'result.html')
>> def counters(request):
>>   return render(request, 'counters/james.html')
>
>
> Here is my file tree: https://imgur.com/a/BUTKKEH
>
> Contents of requirements.txt:
>
>> Django==2.0.13
>> Pillow==5.4.1
>> psycopg2==2.7.7
>> psycopg2-binary==2.7.7
>> pytz==2018.9
>
>
>
> If there are other files in my project that you wish to view, you can
> click through the file tree as it appears on GitHub (linked to above).
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/353c83b5-1f37-4e23-b6c7-f488cb05805e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__0D%2BEHdxgkCLOGFHJDza9Q5EmdGRS3vo9RrFKybRTKGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hosting recommendations please

2019-04-02 Thread Joel Mathew
I'm running mine off a Digitalocean 1GB droplet, and one hobby site off
Heroku. Heroku has some latency noticeable occasionally, but the
digitalocean droplet is perfect. I will scale to better specs once I go
into active production. It's working fine for upto 10 users now.
Sincerely yours,

 Joel G Mathew



On Tue, 2 Apr 2019 at 12:39, Mike Dewhirst  wrote:

> I have to move three Django websites away from my current VM service
> provider by the end of April because he is going out of the VM business.
>
> One is a plain Mezzanine CMS on one VM running Nginx/Gunicorn and the
> other two are on the second VM running Apache and mod_wsgi.
>
> I'm most familiar with Ubuntu 16.04 and hope to go to 18.04.
>
> I think the RAM requirements are around 4GB for the Apache sites and
> half that for Nginx. Haven't done any profiling.
>
> I'm in Australia. I'm after stability and reliability and if I'm lucky,
> scalability.
>
> If you have any negative comments about providers please send them
> off-list.
>
> Many thanks
>
> Mike
>
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b7e16385-0ea9-6d02-e175-ba4594208bcc%40dewhirst.com.au
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9My8quXSDKr4BBCSSSnPnuH%3DYp6mQezG4%3DBFrcgHHBjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I need help please

2019-04-01 Thread Joel Mathew
It's supposed to be an example.
Sincerely yours,

 Joel G Mathew



On Mon, 1 Apr 2019 at 19:12, dvij parekh  wrote:

> link is not working
>
>
> On Mon, Apr 1, 2019 at 6:32 PM Nanjuki Saidat 
> wrote:
>
>> Hi all,
>> I am Saidat a new django developer, i need help on how to go about this
>> " Change admin portal URL to more obvious path and add link in side menu
>> to admin settings for admin users". In summary:
>>
>>
>>1.  i want to change URL string to more intuitive URL (i.e.
>>fhp.example.com/drunken-octo-lama/ to fhp.example.com/admin/)
>>2. If a user is an admin user, show a link in the side menu to access
>>admin settings page.
>>
>>Thanks.
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHrBrjC-j-2Z%2Bkn-U2gKBaV24Mu3W4QFGgochC1s6906VE5Tuw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAHrBrjC-j-2Z%2Bkn-U2gKBaV24Mu3W4QFGgochC1s6906VE5Tuw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAF-XeXapTQ5jdOUOtkV5USYhyje9sWtU8hvShEY1yC6pBQ51zw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAF-XeXapTQ5jdOUOtkV5USYhyje9sWtU8hvShEY1yC6pBQ51zw%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9pa3ZyW9%2Ba4VWSYMFSY-3wsZ%2BBFvppJvwZrR0kTdQrXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how can i get current username in model field ??

2019-04-01 Thread Joel Mathew
This does not make sense to me. A model is not a dynamic entity. It is
something that's created beforehand. Getting the current username into
model should be done in your logic (views), or the template
Sincerely yours,

 Joel G Mathew



On Mon, 1 Apr 2019 at 19:01, omar ahmed  wrote:

> i want to put value of logged in user.username in author field
> class Comment(models.Model):
> leaguenews = models.ForeignKey(LeagueNews, on_delete= models.CASCADE,
> related_name='comments')
> author = models.CharField(max_length=200)
> text = models.TextField()
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8a24a020-af3a-4a5f-ac25-5da3aa1fa8db%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/8a24a020-af3a-4a5f-ac25-5da3aa1fa8db%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9E9szHxpGUwXB1UFgcEkJDOCaSK8-an%2BxFyV0jt4sR2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is there any inline editing the data and delete data in table in Django?

2019-03-22 Thread Joel Mathew
This is simple to achieve with django formset plus jquery. You just need to
have a little imagination

On Fri, 22 Mar, 2019, 12:15 PM VeeraNagaRaja Sankar, 
wrote:

> hi Derek,
>
> Thank you but I saw this one not working for my methodology.
>
> Best Regards,
> Inti VeeraNagaRaja Sankar,M.Tech(IT)
> M: 9985864383
> intisank...@gmail.com 
> https://about.me/veeranagarajasankar
>
>
> On Thu, Mar 21, 2019 at 11:08 AM Derek  wrote:
>
>> If I had to do something like this right now I would probably look at:
>> *
>> https://bossanova.uk/jexcel/examples/tracking-changes-on-the-spreadsheet
>> ,
>> * plus the javascript needed to handle the front-end GET/POST requests
>> (MANY examples on the web) when data changes,
>> * along with Django DRF on the back-end to handle the server side data
>> generation and database updates.
>>
>> Please don't keep asking "how" and rather start with your own
>> development.
>>
>> On Wednesday, 20 March 2019 21:57:21 UTC+2, Chetan Ganji wrote:
>>>
>>> Hi Sankar,
>>>
>>> Derek is right, we can only give you suggestions as we are far away from
>>> you. How is really upto YOU.
>>> What you are trying to achieve is basically a front end task. You only
>>> have knowledge of django which is a backend technology.
>>>
>>> You have many options to make choice from -
>>> 1. You have to learn to use jquery to do it the way you want it.
>>> 2. Use the default UpdateView from django where EDIT/UPDATE view will be
>>> shown separately. i.e. let go of inline editing feature.
>>> 3. Find someone who will code it for you.
>>> 4. Any other that you can think of.
>>>
>>> Happy Coding :)
>>>
>>>
>>> Regards,
>>> Chetan Ganji
>>> +91-900-483-4183
>>> ganji@gmail.com
>>> http://ryucoder.in
>>>
>>>
>>> On Wed, Mar 20, 2019 at 11:58 AM VeeraNagaRaja Sankar <
>>> intis...@gmail.com> wrote:
>>>
 hi,

 means, i am only aware of Django so i need any code reference to do that
  thank you,

 Best Regards,
 Inti VeeraNagaRaja Sankar,M.Tech(IT)
 M: 9985864383
 intis...@gmail.com
 https://about.me/veeranagarajasankar


 On Wed, Mar 20, 2019 at 11:55 AM Derek  wrote:

> That is not an answerable question.  We have given you suggestions -
> the "how" is up to you.
>
> On Tuesday, 19 March 2019 09:36:27 UTC+2, veera nagaraja sankar Inti
> wrote:
>>
>>
>> how ?
>>
>> On Monday, March 4, 2019 at 12:40:03 PM UTC+5:30, Derek wrote:
>>>
>>> Grid / tabular editing outside of the admin is tricky; I have not
>>> been able to manage it and have not found a good app for it.
>>>
>>> Here are some suggested reading:
>>>
>>> * https://www.ibm.com/developerworks/library/wa-django/index.html
>>> * https://bossanova.uk/jexcel
>>> *
>>> https://medium.com/ag-grid/building-a-crud-application-with-ag-grid-part-4-3189034df922
>>>
>>> You'd also need an app like Django REST Framework to handle GET/POST
>>> of JSON data to populate your grid.
>>>
>>> On Wednesday, 27 February 2019 20:39:04 UTC+2, veera nagaraja sankar
>>> Inti wrote:

 need help friends ?..

 thq..

>>> --
> 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...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/562202e8-53a3-44d2-b0aa-ba710e180787%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
 --
 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...@googlegroups.com.
 To post to this group, send email to django...@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAJFTHQa_6OGseZ8TwrniWrUNDM%2BkN8a%3DChBFrF7j4XRysARaLw%40mail.gmail.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>> 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 

Re: Font Awesome does not work locally

2019-03-11 Thread Joel Mathew
It's related to your static address. You're probably not setting the
correct relative path. Check the tutorials on how the settings for STATIC
files work
Sincerely yours,

 Joel G Mathew



On Mon, 11 Mar 2019 at 20:42, Mujab Nasraldeen 
wrote:

>  font awesome does not work locally .. without using: https://use.fontawesome.com/releases/v5.7.2/css/all.css;
> integrity="
> sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
> crossorigin="anonymous">
>
>  I replaced it with: 
>
> but when but when i type:  .. but
> the page displays as a square
>
> How to solve this problem???
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/57773dd9-1a60-4c58-a706-a39959e9e28e%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/57773dd9-1a60-4c58-a706-a39959e9e28e%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-_zEBrvdsfK79K-0dOQ2aPpc%3DnP-2uNQQF7mdX637UDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How does WSGI work?

2019-03-07 Thread Joel Mathew
There's a mod_wsgi_express thread that Graham monitors, so he's sure to get
feedback from there

Understanding this better could help me solve static file blues. Most of
the time I don't understand why my static files fine aren't served when I
move to production.

On Fri, 8 Mar, 2019, 5:29 AM Mike Dewhirst,  wrote:

> On 8/03/2019 10:11 am, Tal wrote:
> > The word "simple" appears 13 times in PEP, but no one knows how
> > this magical specification works?
> > Can anyone confirm I'm not crazy please?
>
> You could try writing to Grahame Dumpleton for confirmation. I'm
> reasonably sure he wrote mod_wsgi and ought to be able to correct you if
> you've misunderstood anything.He used to give presentations on wsgi at
> PyCons so you might be able to find something on YouTube from a few
> years ago.
>
> Last I heard of him he is fairly focused on Kubernetes so he probably
> doesn't monitor the Django list any more.
>
> >
> > On Tuesday, February 26, 2019 at 3:13:00 PM UTC-7, Tal wrote:
> >
> > Is it right though?
> >
> > On Tuesday, February 26, 2019 at 2:49:03 PM UTC-7, mike wrote:
> >
> > Great write up!
> >
> > On Tue, Feb 26, 2019 at 2:39 PM Tal  wrote:
> >
> > Did I get something wrong?
> > Do you mean the devs working on the Django project know
> > nothing about this, or the devs using Django to build web
> > apps?
> > From what I've read, devs using Django don't need to be
> > too familiar with WSGI, but it seems like it helps at
> > least having a conceptual understanding of what it is.
> >
> > On Tuesday, February 26, 2019 at 12:28:26 PM UTC-7, Motaz
> > Hejaze wrote:
> >
> > You are very close to what realy happens , most of
> > devs know nothing aboutbthis stuff
> >
> > On Tue, 26 Feb 2019, 20:26 Tal, 
> wrote:
> >
> > I've been developing web applications using Flask
> > and Django for about a year now, and although I've
> > come across the term WSGI a bunch of times in both
> > frameworks, I never really understood what it did.
> > I'm sure I'm not the only one. The quick
> > explanations I read never made sense to me. Even
> > PEP didn't really give me a clear picture of
> > how WSGI fits in with Nginx, and Django. There are
> > a bunch of articles online that quickly show how
> > to setup nginx, gunicorn/uwsgi and django to work
> > in production, and once I figured that out, I
> > never really had a reason to figure out WSGI
> > again. But it's been a year now, and I probably
> > should understand at least the basics.
> >
> > I did a bit more reading recently, and I think I
> > get it. Just looking for someone to confirm that
> > I'm on the right track.
> > This is how I think it works:
> >
> > My example uses the most common setup I use:
> > Nginx, Gunicorn and Django
> >
> >   * When an HTTP request comes in, it hits Nginx
> first
> >   o Nginx runs multiple processes, and makes
> > sure that browsers/clients that have a
> > slow connection don't effect other clients
> >   o If it's a request for a static file, like
> > a CSS file, JS, image, or anything like
> > that, Nginx returns it directly
> >   o If it's a request for anything else, it
> > uses *HTTP* to send the request over a
> > Unix socket to Gunicorn
> >   + Doesn't have to be a Unix socket, but
> > if both Nginx and Gunicorn are running
> > on the same host, it makes sense to
> > use Unix sockets
> >   + The main point is that Nginx uses HTTP
> > to communicate with Gunicorn
> >   * Gunicorn
> >   o Starts up x worker processes on startup
> > (as many as you tell it)
> >   o Each worker process imports your
> > application's code
> > (django.core.wsgi.get_wsgi_application()
> > in Django's case)
> >   + The application's code is a callable
> > function
> >  

Re: Installing pdftotext library on heroku

2019-03-05 Thread Joel Mathew
This was solved after a user helped me out on StackOverflow. The solution
is to use build packs.

https://help.heroku.com/IYRYW6VB/how-do-i-install-additional-software-packages-that-my-application-requires

Sincerely yours,

 Joel G Mathew



On Tue, 5 Mar 2019 at 21:02, joelryan2k  wrote:

> I'm curious about this, too. I've been using docker containers on heroku
> to avoid potential issues like this.
>
> On Wednesday, January 23, 2019 at 7:20:03 AM UTC-5, Joel Mathew wrote:
>>
>> pdftotext library is a requirement in requirements.txt. While trying to
>> push to heroku, I get the following error:
>>
>> remote:  Running setup.py install for pdftotext: started
>> remote:Running setup.py install for pdftotext: finished with 
>> status 'error'
>> remote:Complete output from command 
>> /app/.heroku/python/bin/python -u -c "import setuptools, 
>> tokenize;__file__='/tmp/pip-build-rnbekz45/pdftotext/setup.py';f=getattr(tokenize,
>>  'open', open)(__file__);code=f.read().replace('\r\n', 
>> '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record 
>> /tmp/pip-o0if2tl3-record/install-record.txt 
>> --single-version-externally-managed --compile:
>> remote:/app/.heroku/python/lib/python3.6/distutils/dist.py:261: 
>> UserWarning: Unknown distribution option: 'long_description_content_type'
>> remote:  warnings.warn(msg)
>> remote:running install
>> remote:running build
>> remote:running build_ext
>> remote:building 'pdftotext' extension
>> remote:creating build
>> remote:creating build/temp.linux-x86_64-3.6
>> remote:gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG 
>> -g -fwrapv -O3 -Wall -fPIC -DPOPPLER_CPP_AT_LEAST_0_30_0=0 
>> -I/app/.heroku/python/include/python3.6m -c pdftotext.cpp -o 
>> build/temp.linux-x86_64-3.6/pdftotext.o -Wall
>> remote:pdftotext.cpp:3:10: fatal error: 
>> poppler/cpp/poppler-document.h: No such file or directory
>> remote: #include 
>> remote:  ^~~~
>> remote:compilation terminated.
>> remote:error: command 'gcc' failed with exit status 1
>> remote:
>> remote:
>> remote:Command "/app/.heroku/python/bin/python -u -c "import 
>> setuptools, 
>> tokenize;__file__='/tmp/pip-build-rnbekz45/pdftotext/setup.py';f=getattr(tokenize,
>>  'open', open)(__file__);code=f.read().replace('\r\n', 
>> '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record 
>> /tmp/pip-o0if2tl3-record/install-record.txt 
>> --single-version-externally-managed --compile" failed with error code 1 in 
>> /tmp/pip-build-rnbekz45/pdftotext/
>> remote:  ! Push rejected, failed to compile Python app.
>> remote:
>> remote:  ! Push failed
>>
>> Normally I'd solve this by installing libpoppler-cpp-dev with apt. But
>> on heroku, I don't have root access to do that. Is there a solution for
>> this?
>> Sincerely yours,
>>
>>  Joel G Mathew
>>
>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a6177122-63d0-4162-8be4-ab05d9d094d4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a6177122-63d0-4162-8be4-ab05d9d094d4%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-rro5%2B%3DeY%2B9avCqVyPjCvQxmDPZFm5i1Khc4iGBmL8Qg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Webinterface for python script

2019-02-05 Thread Joel Mathew
Exactly. I to use file upload and rendering in a medical report.

@OP Did your research and post your code. Can help with any errors you're
getting.

Research about request.POST, request.FILES. Read this.
https://docs.djangoproject.com/en/2.1/topics/files/

On Tue, 5 Feb, 2019, 1:25 PM Scot Hacker  Make a basic Django view. Place your script in a python module that lives
> inside your app. Call that module/ function from the Django view. See
> Django docs and tutorials on how to handle uploaded files. Pass the
> uploaded file to your module, and handle the return value(s) however you
> want. Hard to get more specific than that without seeing your code, but
> this should come together pretty quickly with some experimentation.
>
> I never know what people mean by "Django is overkill for...". Django is
> lightweight and starts up very quickly, even with large/complex projects.
> Django saves you mountains of time compared to Flask, which makes you go
> shopping for every little piece of framework you need. Every time I've
> experimented with Flask, I've come running back to Django after realizing
> my time is too valuable to waste it on creating my own framework when a
> perfectly great one already exists.
>
> ./s
>
>
> On Sunday, February 3, 2019 at 7:53:20 AM UTC-8, Asad Hasan wrote:
>>
>> Hi All ,
>>
>>   I have created certain python scripts to analyze log files and
>> suggest solution based on logic which I invoke on the command line . I need
>> some information on how to execute these through browser . I am using :
>>
>> python test.py file1 file2
>>
>> How do I use the browser to upload the files file1 and file2 and it
>> process the files .
>>
>> Please advice ,
>>
>> Thanks,
>>
>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/88c2337b-7e8a-4e11-968f-30299b6229d4%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-a-x4dOWwvqckq1E%2B8Bv%2B5n1DHxikEsEBVxDq9pHKV1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Where is the data set of the Django documents demo models

2019-02-03 Thread Joel Mathew
Yes, it is not supposed to be a copy paste demo. You're supposed to work
along the tutorial, use the shell, and not throw in a bunch of files and
opening the browser to see if it works

On Sun, 3 Feb, 2019, 7:20 PM Jason  I feel I have to disagree, and the reason is the point of the tutorial is
> to show you the basics with the various parts of django, and you're
> creating a data set as you go along.
>
>
> https://docs.djangoproject.com/en/2.1/intro/tutorial02/#playing-with-the-api
> shows you how to use the ORM to create a new question
>
> https://docs.djangoproject.com/en/2.1/intro/tutorial02/#explore-the-free-admin-functionality
>  shows
> you how to use the admin to create and edit questions
>
> https://docs.djangoproject.com/en/2.1/intro/tutorial03/#writing-your-first-django-app-part-3
>  shows
> you how to make templates to list questions and show a specific question
>
> That's all from data you're creating in the second step.
>
> What do you feel you would get from having a data set provided as an
> example over the process above?
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b749246d-1ce0-40ba-9b8f-31ce222c8ef7%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8gr%2Brom14SojLJT4_cUDXg3%3DfdE3QNy%3DPBYZNfh0heyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Time tracker sytem

2019-02-03 Thread Joel Mathew
Go through the django tutorials, and kindly start a thread when you have a
problem.

On Sun, 3 Feb, 2019, 7:56 PM Rupam Hazra  I want to create a time tracker system to track the employee work time and
> data save to mysql database.please tell me how to start.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6e4c36c8-10ea-403d-9afa-8c9b40c1f1e6%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9X7ypVtXCAQXLjrT0iGwXnk%3D4zb6-p%2Bj1t5R6LwR%3DGTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Installing pdftotext library on heroku

2019-01-23 Thread Joel Mathew
pdftotext library is a requirement in requirements.txt. While trying to
push to heroku, I get the following error:

remote:  Running setup.py install for pdftotext: started
remote:Running setup.py install for pdftotext: finished
with status 'error'
remote:Complete output from command
/app/.heroku/python/bin/python -u -c "import setuptools,
tokenize;__file__='/tmp/pip-build-rnbekz45/pdftotext/setup.py';f=getattr(tokenize,
'open', open)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install
--record /tmp/pip-o0if2tl3-record/install-record.txt
--single-version-externally-managed --compile:
remote:
/app/.heroku/python/lib/python3.6/distutils/dist.py:261: UserWarning:
Unknown distribution option: 'long_description_content_type'
remote:  warnings.warn(msg)
remote:running install
remote:running build
remote:running build_ext
remote:building 'pdftotext' extension
remote:creating build
remote:creating build/temp.linux-x86_64-3.6
remote:gcc -pthread -Wno-unused-result -Wsign-compare
-DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPOPPLER_CPP_AT_LEAST_0_30_0=0
-I/app/.heroku/python/include/python3.6m -c pdftotext.cpp -o
build/temp.linux-x86_64-3.6/pdftotext.o -Wall
remote:pdftotext.cpp:3:10: fatal error:
poppler/cpp/poppler-document.h: No such file or directory
remote: #include 
remote:  ^~~~
remote:compilation terminated.
remote:error: command 'gcc' failed with exit status 1
remote:
remote:
remote:Command "/app/.heroku/python/bin/python -u -c "import
setuptools, 
tokenize;__file__='/tmp/pip-build-rnbekz45/pdftotext/setup.py';f=getattr(tokenize,
'open', open)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install
--record /tmp/pip-o0if2tl3-record/install-record.txt
--single-version-externally-managed --compile" failed with error code
1 in /tmp/pip-build-rnbekz45/pdftotext/
remote:  ! Push rejected, failed to compile Python app.
remote:
remote:  ! Push failed

Normally I'd solve this by installing libpoppler-cpp-dev with apt. But on
heroku, I don't have root access to do that. Is there a solution for this?
Sincerely yours,

 Joel G Mathew

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__jf69Dcd4QZAGQrSjbL51biA3kZq_LuV%3D6Vu6kHkYj1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: SPAM sent via this list?

2019-01-10 Thread Joel Mathew
I've got multiple emails of similiar sort from aphiso...@gmail.com and
blocked this account. Didnt find any other option.
Sincerely yours,

 Joel G Mathew



On Thu, 10 Jan 2019 at 13:56, Markus Holtermann 
wrote:

> Hi, if the response you got is related to https://bitbounce.com/ , we're
> in touch with them so that they can fix their system. Unfortunately, Google
> Groups makes it really hard to find individual members and kick them, for
> lists of the size of django-developers and django-users.
>
> Cheers,
>
> Markus
>
> On Thursday, January 10, 2019 at 5:22:07 AM UTC+1, Lachlan Musicman wrote:
>>
>> I just got a spam email from the account
>>
>> aphi...@gmail.com
>>
>> That is threaded to my previous response to Alejandro Reyes's email
>>
>> Here's the raw header
>>
>>
>> Delivered-To: dat...@gmail.com
>> Received: by 2002:ab0:59f2:0:0:0:0:0 with SMTP id k47csp1496731uad;
>> Wed, 9 Jan 2019 20:15:11 -0800 (PST)
>> X-Received: by 2002:a17:906:e2c9:: with SMTP id 
>> gr9-v6mr7444893ejb.108.1547093711410;
>> Wed, 09 Jan 2019 20:15:11 -0800 (PST)
>> ARC-Seal: i=1; a=rsa-sha256; t=1547093711; cv=none;
>> d=google.com; s=arc-20160816;
>> b=Uk1KEWZpXj57NrLSw/NrkYofbu7/WAxFBbuzEY7jMIpScKUGzLMh6hxFd89RhPMo7/
>>  7eMRsfWxvPeVAknN7Ghc+A+jK+ZidGjRsv/DsKiCJYWLE4m/B2w2i5PpL0jPCTD/cJ7Q
>>  /A3FbBDkoaegCbDZzBHwy1RF2lejE8joiT7VaIUKxINQ1Tq4Z0IGyCPdPjI/ThKWU+FU
>>  xn+laGAltdoUG3WbvIueNXA8jChxUagFoMlns0yDr1FETv1ymUgcLefeqi7F5F65r9vo
>>  9Rz6kyp33FSo5tqGRf1ZBmcSd4cXiIUwcEPTFMisEPxBLUTpspNcedop625YpWljG8sb
>>  PRvw==
>> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; 
>> s=arc-20160816;
>> h=to:subject:message-id:date:references:in-reply-to:mime-version:from
>>  :dkim-signature;
>> bh=Azuv04E2o8dshX5o1BJ8WGQr6D9cswM1D1HqW5tXEoo=;
>> b=UCngM/tm+Rg242qMf/EbLYW8Cw+DpPvskZ1KVvBfqS7xDOqGg6vNHwKh+eJ/BZAjvS
>>  gaLZFT2Z4uCt5BSeuQTclwi5Uw0NkZ3OrEwXSbm9dAe7k5dJ5vGv9XQFNncxd3BAx5AS
>>  SE26fuct4nn3chaXCKmzZlaIYIlO0jfZ5uBgnpQFEGWAyAVYo6sUnhswLw5dPpKuckh/
>>  dCGq1TIvd0hRrcqNw4jAIh4L6qyB96TlKbJSO/7nTbb7dN5/a5VxKXM/tT4/qkqfNW/D
>>  bnmXoa7nHxKFFe9/WlY4ktFRo1ovndNqE2D/xZtptOEEneY46CaFvzI6ODFYbjMR5io/
>>  SS8w==
>> ARC-Authentication-Results: i=1; mx.google.com;
>>dkim=pass header.i=@gmail.com header.s=20161025 header.b=dd8veXeU;
>>spf=pass (google.com: domain of aphi...@gmail.com designates 
>> 209.85.220.41 as permitted sender) smtp.mailfrom=aphi...@gmail.com;
>>dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
>> Return-Path: 
>> Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. 
>> [209.85.220.41])
>> by mx.google.com with SMTPS id 
>> e44sor3343283ede.13.2019.01.09.20.15.11
>> for 
>> (Google Transport Security);
>> Wed, 09 Jan 2019 20:15:11 -0800 (PST)
>> Received-SPF: pass (google.com: domain of aphi...@gmail.com designates 
>> 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
>> Authentication-Results: mx.google.com;
>>dkim=pass header.i=@gmail.com header.s=20161025 header.b=dd8veXeU;
>>spf=pass (google.com: domain of aphi...@gmail.com designates 
>> 209.85.220.41 as permitted sender) smtp.mailfrom=aphi...@gmail.com;
>>dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
>> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
>> d=gmail.com; s=20161025;
>> 
>> h=from:mime-version:in-reply-to:references:date:message-id:subject:to;
>> bh=Azuv04E2o8dshX5o1BJ8WGQr6D9cswM1D1HqW5tXEoo=;
>> b=dd8veXeUlee7ACSL3xnZk1RzWT44ZXlifjzUuqnUVlxZu5S0dkUgoVSsT8MaevKOGe
>>  WorIqWc4/K6XFuz6caxwn+U+sWrYiESrusvkXsNAZAXzQ1G0e4tAc8uvh77AnoYUPstk
>>  K2ZQyTRB42EuREJN94GArD6E0D+3cYk86eYF2BdXD1s59r7z97+LHNUJLE/EErHTiQ9B
>>  TE3+AzAKpSgJF5a49sSIeFDGzF5O64qFqIr2wHL3ZuYYk0+LDP3mLIOtCEU1kmcpfRxS
>>  mxyFqQ5t1XjkcZRuMVc0jvxsMTBeTSMs73i5PVmmWkmeXykc9YOPNFSXEg9+QeCduOEC
>>  /yIA==
>> X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
>> d=1e100.net; s=20161025;
>> h=x-gm-message-state:from:mime-version:in-reply-to:references:date
>>  :message-id:subject:to;
>> bh=Azuv04E2o8dshX5o1BJ8WGQr6D9cswM1D1HqW5tXEoo=;
>> b=cFU5b8+MRXUtvTznVlGZLohfDDKdWCWXLdsPcP8TSYKGINSy+80JnJI5GL9Ogh6vQk
>>  VDJyuuXsarPxBhew98u5kpThsAAQ6L92S2vA6b5I08S9KR4xIL6W+CsTa4bS3RZo17Ev
>>  C4fP8w

Re: simple boy start learn python

2019-01-06 Thread Joel Mathew
python is learnt best by doing. As a lesson familiar with other languages,
I found it easy to go through the steps in the python official
documentation: https://docs.python.org/3/tutorial/

On Sun, 6 Jan, 2019, 11:25 PM Gilbeesh Kosma  Prefer the ebook of "django for beginners" by William S vincent.
> His lessons are easy to grasp for any beginner wanting to learn django.
> On Jan 6, 2019 2:16 AM,  wrote:
>
>> I know that you are exp in django, so I need you tell me the best way to
>> learn django is what ?
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/ee9279fe-979a-4db4-a9b3-753ea7c3cc2c%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABV4%2BX7FR8%3DDkezff8xKeBNwCUFpxZ7QubTp_Jv8eowtSfiADg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8R65XnA7U2T6oauMsECDqKjzC60hmW9JAc7uCi6vuaUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to deploy Django Python Webapp with Windows10?

2019-01-02 Thread Joel Mathew
Also why are you attempting to deploy it online from your laptop. An online
application needs to be.. well, online, all the time. That's the function
of a server. You dont normally deploy from a laptop, unless you have a
specific need to do so. If it's for a client, definitely a big no-no. Use a
lightweight Linux distro like Debian, and install a server on it
(apache/nginx), and run django with mod_wsgi_express.

If you dont know or dont care on installing your own server, just go with a
built in solution like heroku.

Sincerely yours,

 Joel G Mathew



On Tue, 1 Jan 2019 at 02:14, gian castillo  wrote:

> Hi,
> I built a webapp with django python and It's done. Now I want to deploy It
> online, It's just a portfolio website for my first client, nothing too
> heavy.
>
> I looked into Digital Ocean but It deploys It with ubuntu and I'm having
> troubles in turning my laptop into a deul boot(working on WIndows10).
> Can I deploy my webapp with just Windows10? I downloaded VirtualBox for
> Ubuntu 16.04.
> I really am new to this so I know very little.
>
> Thank You and kind regards.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a66e6618-8adc-4788-b320-e488e73b0831%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a66e6618-8adc-4788-b320-e488e73b0831%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8t4D1Sdm0L6BBH7v_TfJ4trCu_w6XMoxBZSXXUkwEQOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to deploy Django Python Webapp with Windows10?

2019-01-02 Thread Joel Mathew
Windows 10 is not designed to be a server. What is your issue in deploying
in Ubuntu or Debian?

Sincerely yours,

 Joel G Mathew



On Tue, 1 Jan 2019 at 02:14, gian castillo  wrote:

> Hi,
> I built a webapp with django python and It's done. Now I want to deploy It
> online, It's just a portfolio website for my first client, nothing too
> heavy.
>
> I looked into Digital Ocean but It deploys It with ubuntu and I'm having
> troubles in turning my laptop into a deul boot(working on WIndows10).
> Can I deploy my webapp with just Windows10? I downloaded VirtualBox for
> Ubuntu 16.04.
> I really am new to this so I know very little.
>
> Thank You and kind regards.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a66e6618-8adc-4788-b320-e488e73b0831%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a66e6618-8adc-4788-b320-e488e73b0831%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8t7b82%2B_LZtcvSUFDysORFNdbH%2BApAcx1XwyQPSez5Rw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Zip file upload

2019-01-01 Thread Joel Mathew
No ready made solution. You have to come up with your own solution. Use
form to upload file

On Wed, 2 Jan, 2019, 9:57 AM Suresh  hi guys,
> How to upload zip file and save unzip file in django?
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b1643e14-b517-43f1-b8f5-b471ee3dadef%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-5uxLEfzkbYpyN-6Tn52ass6RxJTWw8oP_L_wsZ7F-rQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: STATIC FILES not working for admin site, projects and apps on DJANGO

2018-12-30 Thread Joel Mathew
Your site has more wrong with it than just static css. Your html is
appearing as html. You need to unescape them in template or check your tags

On Mon, 31 Dec, 2018, 1:10 AM abel otugeme  I have done all that i used the docs first and it did not work. Then i
> tired this video https://www.youtube.com/watch?v=YH-ipgxlJzs
>
> On Sun, Dec 30, 2018 at 5:09 PM Lunga Baliwe  wrote:
>
>> Please have a look at this link
>> https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/modwsgi/ on
>> how to setup static files.
>> You may also want to run python manage.py collectstatic
>>
>> On Sun, Dec 30, 2018 at 4:31 AM abel otugeme  wrote:
>>
>>> This is how a site looks when i open it up in my browser No CSS! i
>>> have done the necessary settings for Django to find the static files
>>>
>>> On Sat, Dec 29, 2018 at 5:14 PM Kasper Laudrup 
>>> wrote:
>>>
 Hi Abel,

 On 29/12/2018 08.07, abel otugeme wrote:
 > I really need help i have combed through stackover flow and this
 group
 > but the solutions provided don't work for me.  i use a 32bit windows
 7
 > OS and the latest version of django
 >

 It would probably be easier for someone to help you if you tried to
 describe what your actual problem is.

 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 post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/c8273be3-bc53-2103-f503-ae7668f01622%40stacktrace.dk
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAMrS0S91GG0A%3D3Z263Q9nxLccStat-URs3NsW_pfqES_J5uU2Q%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CANDnEWfqpqyk-nesQcAKT-4i9tzAw8aJne2VjXFkgxqFWKJXiA%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMrS0S_3dqSeH6osEsganiWJHk%3Dd%2B0Di0j2V9iqhDr0uD4qvag%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9oqRts%3DjYUj%3DXkQBFXkfK-gU27vGTBfzxsTUpyichF3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: issue in hosting https://www.pythonanywhere.com

2018-12-24 Thread Joel Mathew
Did you activate it?
Sincerely yours,

 Joel G Mathew



On Tue, 25 Dec 2018 at 12:27, Atul Anand  wrote:

> Hi Brad,
>
> Thanks for helping, but I am using a venv.
> please find the below snapshot of the venv detail.
>
> Please guide me if I am doing something wrong.
>
> Virtualenv:
>
> Use a virtualenv to get different versions of flask, django etc from our
> default system ones. More info here
> <https://help.pythonanywhere.com/pages/Virtualenvs>. You need to *Reload
> your web app* to activate it; NB - will do nothing if the virtualenv does
> not exist.
>
> /home/crackjeeonline/.virtualenvs/djangoVenv
> <https://www.pythonanywhere.com/user/crackjeeonline/webapps/#>
>
>
>
>
>
> On Tue, Dec 25, 2018 at 11:05 AM Brad Pitcher 
> wrote:
>
>> The paths in your logs indicate you aren't using a virtualenv. Find the
>> virtualenv section in the web tab and make sure you specify the path to
>> your virtualenv there. Should be something like
>> /home/[username]/.virtualenvs/djangoVenv
>>
>> On Mon, Dec 24, 2018 at 8:09 AM Atul Anand 
>> wrote:
>>
>>> I am using virtual env: * djangoVenv*
>>>
>>>
>>> On Mon, Dec 24, 2018 at 7:45 PM Joel Mathew  wrote:
>>>
>>>> Use virtualenv
>>>> Sincerely yours,
>>>>
>>>>  Joel G Mathew
>>>>
>>>>
>>>>
>>>> On Mon, 24 Dec 2018 at 19:34, Atul Anand 
>>>> wrote:
>>>>
>>>>> y code is working in local. But the same code when I am uploading into
>>>>> https://www.pythonanywhere.com. Its throwing error.
>>>>>
>>>>> Note: I have updated few things to make it compatible for
>>>>> django2,which is working for me in my local windows box.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> https://www.pythonanywhere.com/user/crackjeeonline/webapps/#tab_id_crackjeeonline_pythonanywhere_com
>>>>>
>>>>> https://github.com/atulanandnitt/simplesocial
>>>>>
>>>>>
>>>>>
>>>>> result of pip freeze
>>>>>
>>>>>
>>>>>1. (djangoVenv) 07:50 ~/simplesocial (master)$ pip freeze
>>>>>2. -f /usr/share/pip-wheels
>>>>>3. argon2-cffi==18.3.0
>>>>>4. bcrypt==3.1.5
>>>>>5. certifi==2018.10.15
>>>>>6. cffi==1.11.5
>>>>>7. chardet==3.0.4
>>>>>8. coreapi==2.3.3
>>>>>9. coreschema==0.0.4
>>>>>10. Django==2.0.9
>>>>>11. django-bootstrap3==11.0.0
>>>>>12. django-braces==1.13.0
>>>>>13. django-cors-headers==2.4.0
>>>>>14. django-debug-toolbar==1.10.1
>>>>>15. django-filter==2.0.0
>>>>>16. django-tables2==2.0.3
>>>>>17. djangorestframework==3.9.0
>>>>>18. Faker==1.0.1
>>>>>19. idna==2.7
>>>>>20. itypes==1.1.0
>>>>>21. Jinja2==2.10
>>>>>22. Markdown==3.0.1
>>>>>23. MarkupSafe==1.1.0
>>>>>24. misaka==2.1.1
>>>>>25. Pillow==5.3.0
>>>>>26. pycparser==2.19
>>>>>27. python-dateutil==2.7.5
>>>>>28. pytz==2018.7
>>>>>29. requests==2.20.1
>>>>>30. six==1.12.0
>>>>>31. sqlparse==0.2.4
>>>>>32. text-unidecode==1.2
>>>>>33. uritemplate==3.0.0
>>>>>
>>>>>
>>>>>
>>>>> Snippet from
>>>>> https://www.pythonanywhere.com/user/crackjeeonline/files/var/log/crackjeeonline.pythonanywhere.com.error.log
>>>>>
>>>>>
>>>>>1. 2018-12-23 06:53:44,347: Error running WSGI application
>>>>>2. 2018-12-23 06:53:44,355: ModuleNotFoundError: No module named 
>>>>> 'debug_toolbar'
>>>>>3. 2018-12-23 06:53:44,356:   File 
>>>>> "/var/www/crackjeeonline_pythonanywhere_com_wsgi.py", line 54, in 
>>>>>4. 2018-12-23 06:53:44,356: django.setup()
>>>>>5. 2018-12-23 06:53:44,356:
>>>>>6. 2018-12-23 06:53:44,356:   File 
>>>>> "/usr/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
>>>>>7. 2018-12-23 06:53:44,357: apps.populate(settings.INSTALLED_APPS)
>>>&g

Re: issue in hosting https://www.pythonanywhere.com

2018-12-24 Thread Joel Mathew
Use virtualenv
Sincerely yours,

 Joel G Mathew



On Mon, 24 Dec 2018 at 19:34, Atul Anand  wrote:

> y code is working in local. But the same code when I am uploading into
> https://www.pythonanywhere.com. Its throwing error.
>
> Note: I have updated few things to make it compatible for django2,which is
> working for me in my local windows box.
>
>
>
>
>
> https://www.pythonanywhere.com/user/crackjeeonline/webapps/#tab_id_crackjeeonline_pythonanywhere_com
>
> https://github.com/atulanandnitt/simplesocial
>
>
>
> result of pip freeze
>
>
>1. (djangoVenv) 07:50 ~/simplesocial (master)$ pip freeze
>2. -f /usr/share/pip-wheels
>3. argon2-cffi==18.3.0
>4. bcrypt==3.1.5
>5. certifi==2018.10.15
>6. cffi==1.11.5
>7. chardet==3.0.4
>8. coreapi==2.3.3
>9. coreschema==0.0.4
>10. Django==2.0.9
>11. django-bootstrap3==11.0.0
>12. django-braces==1.13.0
>13. django-cors-headers==2.4.0
>14. django-debug-toolbar==1.10.1
>15. django-filter==2.0.0
>16. django-tables2==2.0.3
>17. djangorestframework==3.9.0
>18. Faker==1.0.1
>19. idna==2.7
>20. itypes==1.1.0
>21. Jinja2==2.10
>22. Markdown==3.0.1
>23. MarkupSafe==1.1.0
>24. misaka==2.1.1
>25. Pillow==5.3.0
>26. pycparser==2.19
>27. python-dateutil==2.7.5
>28. pytz==2018.7
>29. requests==2.20.1
>30. six==1.12.0
>31. sqlparse==0.2.4
>32. text-unidecode==1.2
>33. uritemplate==3.0.0
>
>
>
> Snippet from
> https://www.pythonanywhere.com/user/crackjeeonline/files/var/log/crackjeeonline.pythonanywhere.com.error.log
>
>
>1. 2018-12-23 06:53:44,347: Error running WSGI application
>2. 2018-12-23 06:53:44,355: ModuleNotFoundError: No module named 
> 'debug_toolbar'
>3. 2018-12-23 06:53:44,356:   File 
> "/var/www/crackjeeonline_pythonanywhere_com_wsgi.py", line 54, in 
>4. 2018-12-23 06:53:44,356: django.setup()
>5. 2018-12-23 06:53:44,356:
>6. 2018-12-23 06:53:44,356:   File 
> "/usr/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
>7. 2018-12-23 06:53:44,357: apps.populate(settings.INSTALLED_APPS)
>8. 2018-12-23 06:53:44,357:
>9. 2018-12-23 06:53:44,357:   File 
> "/usr/lib/python3.6/site-packages/django/apps/registry.py", line 89, in 
> populate
>10. 2018-12-23 06:53:44,357: app_config = AppConfig.create(entry)
>11. 2018-12-23 06:53:44,358:
>12. 2018-12-23 06:53:44,358:   File 
> "/usr/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
>13. 2018-12-23 06:53:44,358: module = import_module(entry)
>14. 2018-12-23 06:53:44,358: 
> ***
>15. 2018-12-23 06:53:44,359: If you're seeing an import error and don't 
> know why,
>16. 2018-12-23 06:53:44,359: we have a dedicated help page to help you 
> debug:
>17. 2018-12-23 06:53:44,359: 
> https://help.pythonanywhere.com/pages/DebuggingImportError/
>
>
> Regards,
> Atul
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKHpVdTdwqMXje4KzTOSX1QF9FNR89oOQAB%2BkDncKQ7ZP93pyg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKHpVdTdwqMXje4KzTOSX1QF9FNR89oOQAB%2BkDncKQ7ZP93pyg%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8KJ0rwiy1CF8MQGBBCxufQHBcjFRxvrpctJsi9TJeUOQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Saving data fails because of null constraint when data is not null

2018-12-22 Thread Joel Mathew
I havent defined more than one primary key. If primary key is defined, the
automatic field wouldnt be generated, right?
Sincerely yours,

 Joel G Mathew



On Sat, 22 Dec 2018 at 16:13, Glen D souza  wrote:

> if you check the error message
>
> DETAIL: Failing row contains (3, 1, Consultation OPD, 135, 135, null, 1).
>
> There are total of 7 values
>
> Check your model
>
> class CGHSRates(models.Model):
> rid = models.AutoField(primary_key=True)
> serial = models.IntegerField(default=0)
> name = models.CharField(max_length=100)
> NonNrate = models.FloatField(blank=True)
> NABHrate = models.FloatField(blank=True)
> section = models.ForeignKey('CGHSSection', on_delete=models.SET_NULL, null
> =True, blank=True)
>
> There are total of 6 fields
>
> There can be only one Primary Key
>
> Somewhere due to rid field its going wrong
>
> On Sat, 22 Dec 2018 at 14:48, Joel Mathew  wrote:
>
>> Django - constraint error
>>
>> I have the following python code in django which is deployed on heroku:
>>
>> def newimportdb(request):
>> import xlrd
>> loc = ("./CGHS Rates 2014- Trivandrum.xlsx")
>> wb = xlrd.open_workbook(loc)
>> sheet = wb.sheet_by_index(0)
>> for i in range(sheet.nrows):
>> try:
>> sl = int(sheet.cell_value(i, 0))
>> except:
>> title = sheet.cell_value(i, 1)
>> hd = CGHSSection(title = title)
>> try:
>> hd.save()
>> heading = CGHSSection.objects.get(title = title)
>> print(f"Saved new heading: {title}")
>> continue
>> except:
>> print(f"Could not save new section: {title}. Maybe it existing. Reading
>> it.")
>> heading = CGHSSection.objects.get(title = title)
>> continue
>>
>> test = sheet.cell_value(i, 1)
>> nonnabh = int(sheet.cell_value(i, 2))
>> nabh = int(sheet.cell_value(i, 3))
>> print(f'{i} Test:{test} NonNABH:{nonnabh} NABH:{nabh} Under:{heading}')
>>
>> it = CGHSRates(serial = sl, name =test, NABHrate = nabh, NonNrate=nonnabh,
>> section=heading)
>> print(f"Value of section heading is {heading.title}")
>> print(f'it = CGHSRates(serial = {sl}, name ={test}, NABHrate = {nabh},
>> NonNrate={nonnabh}, section={heading}')
>> it.save()
>> print("Saved")
>>
>> In my models, I have:
>>
>> from django.db import models
>> class CGHSRates(models.Model):
>> rid = models.AutoField(primary_key=True)
>> serial = models.IntegerField(default=0)
>> name = models.CharField(max_length=100)
>> NonNrate = models.FloatField(blank=True)
>> NABHrate = models.FloatField(blank=True)
>> section = models.ForeignKey('CGHSSection', on_delete=models.SET_NULL,
>> null=True, blank=True)
>>
>> class Meta:
>> unique_together = ('name', 'NonNrate', 'NABHrate')
>>
>> class CGHSSection(models.Model):
>> num = models.AutoField(primary_key=True)
>> title = models.CharField(max_length=150, unique=True)
>>
>> On running the above, I get:
>>
>> [22/Dec/2018 09:07:55] "GET /favicon.ico/ HTTP/1.1" 404 3346
>> Could not save new section: UNCLASSIFIED. Maybe it existing. Reading it.
>> 1 Test:Consultation OPD NonNABH:135 NABH:135 Under:CGHSSection object (1)
>> Value of section heading is UNCLASSIFIED
>> it = CGHSRates(serial = 1, name =Consultation OPD, NABHrate = 135,
>> NonNrate=135, section=CGHSSection object (1)
>> Internal Server Error: /app/import
>> Traceback (most recent call last):
>> File
>> "/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/db/backends/utils.py",
>> line 85, in _execute
>> return self.cursor.execute(sql, params)
>> psycopg2.IntegrityError: null value in column "section" violates not-null
>> constraint
>> DETAIL: Failing row contains (3, 1, Consultation OPD, 135, 135, null, 1).
>>
>>
>> The above exception was the direct cause of the following exception:
>>
>> Traceback (most recent call last):
>> File
>> "/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/core/handlers/exception.py",
>> line 34, in inner
>> response = get_response(request)
>> File
>> "/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/core/handlers/base.py",
>> line 126, in _get_response
>> response = self.process_exception_by_middleware(e, request)
>> File
>> "/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/core/handlers/base.py",
>> line 124, in _get_response
>> response = wrapped_callback(request, *callback_args, **callback_kwargs)
>> File "/home/joel/peroo

Saving data fails because of null constraint when data is not null

2018-12-22 Thread Joel Mathew
Django - constraint error

I have the following python code in django which is deployed on heroku:

def newimportdb(request):
import xlrd
loc = ("./CGHS Rates 2014- Trivandrum.xlsx")
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
for i in range(sheet.nrows):
try:
sl = int(sheet.cell_value(i, 0))
except:
title = sheet.cell_value(i, 1)
hd = CGHSSection(title = title)
try:
hd.save()
heading = CGHSSection.objects.get(title = title)
print(f"Saved new heading: {title}")
continue
except:
print(f"Could not save new section: {title}. Maybe it existing. Reading it."
)
heading = CGHSSection.objects.get(title = title)
continue

test = sheet.cell_value(i, 1)
nonnabh = int(sheet.cell_value(i, 2))
nabh = int(sheet.cell_value(i, 3))
print(f'{i} Test:{test} NonNABH:{nonnabh} NABH:{nabh} Under:{heading}')

it = CGHSRates(serial = sl, name =test, NABHrate = nabh, NonNrate=nonnabh,
section=heading)
print(f"Value of section heading is {heading.title}")
print(f'it = CGHSRates(serial = {sl}, name ={test}, NABHrate = {nabh},
NonNrate={nonnabh}, section={heading}')
it.save()
print("Saved")

In my models, I have:

from django.db import models
class CGHSRates(models.Model):
rid = models.AutoField(primary_key=True)
serial = models.IntegerField(default=0)
name = models.CharField(max_length=100)
NonNrate = models.FloatField(blank=True)
NABHrate = models.FloatField(blank=True)
section = models.ForeignKey('CGHSSection', on_delete=models.SET_NULL, null=
True, blank=True)

class Meta:
unique_together = ('name', 'NonNrate', 'NABHrate')

class CGHSSection(models.Model):
num = models.AutoField(primary_key=True)
title = models.CharField(max_length=150, unique=True)

On running the above, I get:

[22/Dec/2018 09:07:55] "GET /favicon.ico/ HTTP/1.1" 404 3346
Could not save new section: UNCLASSIFIED. Maybe it existing. Reading it.
1 Test:Consultation OPD NonNABH:135 NABH:135 Under:CGHSSection object (1)
Value of section heading is UNCLASSIFIED
it = CGHSRates(serial = 1, name =Consultation OPD, NABHrate = 135, NonNrate=
135, section=CGHSSection object (1)
Internal Server Error: /app/import
Traceback (most recent call last):
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/db/backends/utils.py",
line 85, in _execute
return self.cursor.execute(sql, params)
psycopg2.IntegrityError: null value in column "section" violates not-null
constraint
DETAIL: Failing row contains (3, 1, Consultation OPD, 135, 135, null, 1).


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 34, in inner
response = get_response(request)
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/core/handlers/base.py",
line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/core/handlers/base.py",
line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/joel/peroorkada/app/views.py", line 134, in newimportdb
it.save()
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/db/models/base.py",
line 718, in save
force_update=force_update, update_fields=update_fields)
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/db/models/base.py",
line 748, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using,
update_fields)
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/db/models/base.py",
line 831, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/db/models/base.py",
line 869, in _do_insert
using=using, raw=raw)
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/db/models/manager.py",
line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/db/models/query.py",
line 1136, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/db/models/sql/compiler.py",
line 1289, in execute_sql
cursor.execute(sql, params)
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/db/backends/utils.py",
line 100, in execute
return super().execute(sql, params)
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/db/backends/utils.py",
line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self
._execute)
File
"/home/joel/sampledjango/venv/lib/python3.6/site-packages/django/db/back

Re: No query results on heroku, but working on local development server

2018-12-18 Thread Joel Mathew
Hi, thank you for responding. My issue was because there was an
autogenerated database, and another that I had created. When I ran the
local dev server, for some reason, it used the one I created. However on
Heroku, ir was using the autogenerated database. Once I deleted the auto
generated database, the problem went away.

Sincerely yours,

 Joel G Mathew



On Tue, 18 Dec 2018 at 01:06, Ketan Varia  wrote:

> Hi Mathew,
>
> I am still learner of django but I had faced similar issue while deploying
> my code to heroku.  I followed below steps.
>
> - local server installed postgres database and updated settings.py
> - taken local backup of database
>  pg_dump -U postgres  --no-owner --no-acl -f   * path.sql>*
> - Deploy your code to heroku
> - heroku run python manage.py migrate
> - heroku run python manage.py createsuperuser
> - restore data
>  heroku pg:psql --app **  <  * path.sql>*
>
> Regards,
> Ketan
>
> On Mon, Dec 17, 2018 at 12:48 AM Joel Mathew  wrote:
>
>>
>> 0down votefavorite
>> <https://stackoverflow.com/questions/53801636/empty-query-result-on-running-django-app-on-heroku-but-normal-results-on-develo#>
>>
>> I just started using heroku today. I was testing a web application, and
>> got different results on using django app from local development server and
>> heroku. I had imported to the database by running the django development
>> webserver. Since the postgredb uses the amazonaws url, I assumed that this
>> data would be available to the production server on heroku.
>>
>> From my local django webserver, the following search yields correct
>> results:
>>
>> from django.db.models import CharFieldfrom django.db.models.functions import 
>> LowerCharField.register_lookup(Lower, "lower")import logging
>> logger = logging.getLogger('testlogger')
>> logger.info('This is a simple log message')
>> items_set = []if request.method == 'POST':
>> print(request.POST.get)
>> form = CGHSMetaForm(request.POST)
>> name = request.POST.get('name').lower()
>> items_set = CGHSRates.objects.filter(
>> name__lower__contains=name).order_by('name')
>> print(items_set)
>> logger.info(items_set)else:
>> form = CGHSMetaForm()
>> return render(
>> request, 'app/cghs_search.html', {
>> 'rnd_num': randomnumber(),
>> 'form': form,
>> 'items': items_set,
>> })
>>
>> I get the following results:
>>
>> CodeNameRate1098After Mastectomy (Reconstruction)MammoplastyRs 
>> 13800.0364Local mastectomy-simpleRs 14548.0251MastoidectomyRs 17193.0
>>
>> On heroku, however, I receive an empty result.
>>
>> The database is the default heroku database, a postgre db, defined by the
>> following settings in settings.py:
>>
>> import dj_database_url
>> DATABASES = {'default': 
>> dj_database_url.config(default='postgres://kpnbcpyqtxxjqu:2c86exffsdff0d789e7f3b29d70sfsfsffs7be197sffsfsffb...@ec2-53-22-46-10.compute-1.amazonaws.com:5432/dful1l3ra7nknn')}
>>
>> Why does the same database when accessed on different servers yield
>> different results? What should I be checking?
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAA%3Diw__mSiZvrTZTrraLB4jq-kiFvm7Qkr0B6D%2Bffa2w4J-rkg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAA%3Diw__mSiZvrTZTrraLB4jq-kiFvm7Qkr0B6D%2Bffa2w4J-rkg%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAOyh6%3DLOgkE14V6Ey1P41P_B5mG9qi%2BF%2Bf%3DCnxa1q-8eXtsO%2Bg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAOyh6%3DLOgkE14V6Ey1P41P_B5mG

No query results on heroku, but working on local development server

2018-12-16 Thread Joel Mathew
0down votefavorite


I just started using heroku today. I was testing a web application, and got
different results on using django app from local development server and
heroku. I had imported to the database by running the django development
webserver. Since the postgredb uses the amazonaws url, I assumed that this
data would be available to the production server on heroku.

>From my local django webserver, the following search yields correct results:

from django.db.models import CharFieldfrom django.db.models.functions
import LowerCharField.register_lookup(Lower, "lower")import logging
logger = logging.getLogger('testlogger')
logger.info('This is a simple log message')
items_set = []if request.method == 'POST':
print(request.POST.get)
form = CGHSMetaForm(request.POST)
name = request.POST.get('name').lower()
items_set = CGHSRates.objects.filter(
name__lower__contains=name).order_by('name')
print(items_set)
logger.info(items_set)else:
form = CGHSMetaForm()
return render(
request, 'app/cghs_search.html', {
'rnd_num': randomnumber(),
'form': form,
'items': items_set,
})

I get the following results:

CodeNameRate1098After Mastectomy (Reconstruction)MammoplastyRs
13800.0364Local mastectomy-simpleRs 14548.0251MastoidectomyRs 17193.0

On heroku, however, I receive an empty result.

The database is the default heroku database, a postgre db, defined by the
following settings in settings.py:

import dj_database_url
DATABASES = {'default':
dj_database_url.config(default='postgres://kpnbcpyqtxxjqu:2c86exffsdff0d789e7f3b29d70sfsfsffs7be197sffsfsffb...@ec2-53-22-46-10.compute-1.amazonaws.com:5432/dful1l3ra7nknn')}

Why does the same database when accessed on different servers yield
different results? What should I be checking?

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__mSiZvrTZTrraLB4jq-kiFvm7Qkr0B6D%2Bffa2w4J-rkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Easiest front end JavaScript framework to integrate with a Django backend?

2018-11-29 Thread Joel Mathew
>From the point of view of someone who hasnt been using frameworks but wants
to, this is all very maddening. Guess I just have to pick one randomly
between Vue and Angular!

Sincerely yours,

 Joel G Mathew



On Fri, 30 Nov 2018 at 01:51, Benjamin SOULAS 
wrote:

> Hello,
>
> Currently I integrate VueJS, it works like a charm, the documentation is
> awesome
>
> Le jeu. 29 nov. 2018 21:17, Jani Tiainen  a écrit :
>
>> Also there exist ExtJS, Dojo Toolkit and at least Svelte which I've
>> tried...
>>
>> kennedy kay  kirjoitti to 29. marrask. 2018 klo
>> 21.25:
>>
>>> For me personally I would recommend AngularJS. Not just because it easy
>>> to integrate with Django but because you can also create mobile
>>> applications on the fly.
>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/53e1bfd4-ef11-4fa6-afbb-9a172337d2e4%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHn91ofO3d7wXu9z6w1h8fvoG0fiUsaT-QJcye%3DiT7J7ZWH9wA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAHn91ofO3d7wXu9z6w1h8fvoG0fiUsaT-QJcye%3DiT7J7ZWH9wA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABG7fFXdStQmKji%3DK4wRhdGhbZBQ2SdkatJzN9td_QNrmkB6bQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CABG7fFXdStQmKji%3DK4wRhdGhbZBQ2SdkatJzN9td_QNrmkB6bQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-FPTdtyTB7ZBN_n1bOZndZS6Z0BW6s8XNqMUfJX6Q1ZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Easiest front end JavaScript framework to integrate with a Django backend?

2018-11-29 Thread Joel Mathew
I didnt see anyone recommending React. Is there any aspect that makes it
difficult to use with django?

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__ikjuJ3rYoyfCfvKk2Z_2XO7KzgvmUxt_bPh9QQA-V4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Easiest front end JavaScript framework to integrate with a Django backend?

2018-11-28 Thread Joel Mathew
I've been thinking a lot about the most painless way of learning a
javascript framework. My project is almost complete, and so far everything
has been written in javascript using jquery. But for what I have planned
next, a framework would be immensely helpful. I just wish it was as easy as
learning python and django!
Sincerely yours,

 Joel G Mathew



On Wed, 28 Nov 2018 at 19:37, Jason  wrote:

> Its really personal preference at times, especially for personal
> projects.  That said, when it comes to frameworks like angular, react, vue,
> picking one is like picking a version control solution.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c3112a43-a617-492d-b79c-2223ea3b201b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c3112a43-a617-492d-b79c-2223ea3b201b%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_86fyGaehzSn1s3uqAmv%2BqkNuo5nqewN9yGZXRr1Ui5YQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Easiest front end JavaScript framework to integrate with a Django backend?

2018-11-28 Thread Joel Mathew
Please provide more useful information that merely suggesting the name of a
framework. Please say why you feel this framework is better for working
with django.
Sincerely yours,

 Joel G Mathew



On Wed, 28 Nov 2018 at 18:36, Thanh Tuyền Huỳnh <
huynhthanhtuyen...@gmail.com> wrote:

> Hi guys,
>
> You could refer Vuejs.
>
> Vào 03:20 T.4, 28 Th11 2018 Simon Connah  đã viết:
>
>> I'm in the process of building a website in Django and need to make a
>> specific part of my application dynamic. Because of that I'd like to use
>> a JavaScript frontend framework to build this portion of the site.
>>
>> I was wondering if anyone had any recommendations for which JavaScript
>> framework I should use that integrates well with a Django backend?
>>
>> If anyone is curious I am working on an auction style website.
>>
>> Thank you for any help.
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/ee666748-f8c9-37c9-5c12-491ef61ab70d%40gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADUa9Eb1vjJ5W61O5ghn8euR3%3D-FU0gWt%2B3D5vdfQadEPpAr1w%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CADUa9Eb1vjJ5W61O5ghn8euR3%3D-FU0gWt%2B3D5vdfQadEPpAr1w%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__eLGX9J5bD_eZCBG8pHa9bRXXYtfPPe8wYr77Q0L7AXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unexpected behavior on delete of model

2018-11-27 Thread Joel Mathew
Yes, thank you, Todor.
Yesterday night, I ended up doing exactly this.
Sincerely yours,

 Joel G Mathew



On Wed, 28 Nov 2018 at 12:46, Todor Velichkov 
wrote:

> Right now, your doctor will be deleted if its ProfilePicture gets deleted.
> I'm pretty sure you don't want to do that.
> I believe this is what you are looking for:
>
> class Doctor(models.Model):
> # When the profile picture gets delete, clear doctors profile
> picture (set to NULL)
> profilepic = models.ForeignKey(DoctorProfilePic, blank=True, null=
> True, on_delete=models.SET_NULL)
>
>
> class DoctorProfilePic (models.Model):
> # When the doctor gets deleted, delete its picture too (CASCADE)
> # PS. Do not allow orphan ProfilePics (w/o a doctor), i.e.
> blank=False, null=False
> doc = models.ForeignKey('appointments.Doctor', on_delete=models.
> CASCADE)
>
>
>
> On Wednesday, November 28, 2018 at 8:06:11 AM UTC+2, Joel wrote:
>>
>> Ignore the last post. Formatting blues in my main editor.
>>
>> On Wed, 28 Nov, 2018, 11:34 AM Joel >
>>> I think you made a typo in the code. doctor can't be a Foreign key for
>>> class Doctor. Anyway I get your point, and this is the same way I solved it
>>> yesterday.
>>>
>>> On Wed, 28 Nov, 2018, 11:07 AM Saurabh Agrawal >> wrote:
>>>
>>>>
>>>>>
>>>>>
>>>>> class Doctor(models.Model):
>>>>>
>>>>> name = models.CharField(max_length=35)
>>>>>
>>>>> username = models.CharField(max_length=15)
>>>>>
>>>>>
>>>>>
>>>>> class DoctorProfilePic (models.Model):
>>>>>
>>>>> name = models.CharField(max_length=255, blank=True)
>>>>>
>>>>> pic = StdImageField(upload_to="data/media/%Y/%m/%d",
>>>>> blank=True, variations={
>>>>>
>>>>> 'large': (600, 400),
>>>>>
>>>>> 'thumbnail': (150, 140, True),
>>>>>
>>>>> 'medium': (300, 200),
>>>>>
>>>>> })
>>>>>
>>>>> doctor = models.OneToOneField(Doctor, blank=True,
>>>>>
>>>>> null=True, on_delete=models.SET_NULL,
>>>>> related_name="profile_pic")
>>>>>
>>>>>
>>>>>
>>>>
>>>> Setting on_delete to SET_NULL doesn't make much sense here, I think.
>>>> This implies that if a doctor is deleted, the profile pic will be
>>>> preserved, with the FK to doc being set to NULL in db (which doesn't seem
>>>> desirable). I think here CASCADE should work good and will not have the
>>>> issue that the OP is facing.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>
>>>>>
>>>>> …and after saying all that, I wouldn’t make a separate model for the
>>>>> profile picture.  This is what I would do:
>>>>>
>>>>> class Doctor(models.Model):
>>>>>
>>>>> name = models.CharField(max_length=35)
>>>>>
>>>>> username = models.CharField(max_length=15)
>>>>>
>>>>> profile_pic = StdImageField(upload_to="data/media/%Y/%m/%d",
>>>>> blank=True, variations={
>>>>>
>>>>> 'large': (600, 400),
>>>>>
>>>>> 'thumbnail': (150, 140, True),
>>>>>
>>>>> 'medium': (300, 200),
>>>>>
>>>>> })
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com]
>>>>> *On Behalf Of *Joel Mathew
>>>>> *Sent:* Tuesday, November 27, 2018 12:24 PM
>>>>> *To:* django...@googlegroups.com
>>>>> *Subject:* Unexpected behavior on delete of model
>>>>>
>>>>>
>>>>>
>>>>> Situation:
>>>>>
>>>>>
>>>>>
>>>>> I have two Model classes, in two different apps which are part of the
>>>>> same project. class doctor defined in appointments.mo

Re: Unexpected behavior on delete of model

2018-11-27 Thread Joel
Ignore the last post. Formatting blues in my main editor.

On Wed, 28 Nov, 2018, 11:34 AM Joel  I think you made a typo in the code. doctor can't be a Foreign key for
> class Doctor. Anyway I get your point, and this is the same way I solved it
> yesterday.
>
> On Wed, 28 Nov, 2018, 11:07 AM Saurabh Agrawal  wrote:
>
>>
>>>
>>>
>>> class Doctor(models.Model):
>>>
>>> name = models.CharField(max_length=35)
>>>
>>> username = models.CharField(max_length=15)
>>>
>>>
>>>
>>> class DoctorProfilePic (models.Model):
>>>
>>> name = models.CharField(max_length=255, blank=True)
>>>
>>> pic = StdImageField(upload_to="data/media/%Y/%m/%d", blank=True,
>>> variations={
>>>
>>> 'large': (600, 400),
>>>
>>> 'thumbnail': (150, 140, True),
>>>
>>> 'medium': (300, 200),
>>>
>>> })
>>>
>>> doctor = models.OneToOneField(Doctor, blank=True,
>>>
>>> null=True, on_delete=models.SET_NULL,
>>> related_name="profile_pic")
>>>
>>>
>>>
>>
>> Setting on_delete to SET_NULL doesn't make much sense here, I think. This
>> implies that if a doctor is deleted, the profile pic will be preserved,
>> with the FK to doc being set to NULL in db (which doesn't seem desirable).
>> I think here CASCADE should work good and will not have the issue that the
>> OP is facing.
>>
>>
>>
>>
>>
>>
>>>
>>>
>>> …and after saying all that, I wouldn’t make a separate model for the
>>> profile picture.  This is what I would do:
>>>
>>> class Doctor(models.Model):
>>>
>>> name = models.CharField(max_length=35)
>>>
>>> username = models.CharField(max_length=15)
>>>
>>> profile_pic = StdImageField(upload_to="data/media/%Y/%m/%d",
>>> blank=True, variations={
>>>
>>> 'large': (600, 400),
>>>
>>> 'thumbnail': (150, 140, True),
>>>
>>> 'medium': (300, 200),
>>>
>>> })
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *From:* django-users@googlegroups.com [mailto:
>>> django-users@googlegroups.com] *On Behalf Of *Joel Mathew
>>> *Sent:* Tuesday, November 27, 2018 12:24 PM
>>> *To:* django-users@googlegroups.com
>>> *Subject:* Unexpected behavior on delete of model
>>>
>>>
>>>
>>> Situation:
>>>
>>>
>>>
>>> I have two Model classes, in two different apps which are part of the
>>> same project. class doctor defined in appointments.models is a set of
>>> attributes associated with a doctor, like name, username, email, phone etc.
>>> class DoctorProfilePic is a Model defined in clinic.models, which has a
>>> StdImageField which stores images. doctor has a One to One mapping to
>>> DoctorProfilePic.
>>>
>>>
>>>
>>> class doctor(models.Model):
>>>
>>> docid = models.AutoField(primary_key=True, unique=True) # Need
>>> autoincrement, unique and primary
>>>
>>> name = models.CharField(max_length=35)
>>>
>>> username = models.CharField(max_length=15)
>>>
>>> ...
>>>
>>> profilepic = models.ForeignKey(DoctorProfilePic, blank=True,
>>> null=True, on_delete=models.CASCADE)
>>>
>>> ...
>>>
>>>
>>>
>>> class DoctorProfilePic (models.Model):
>>>
>>> id = models.AutoField(primary_key=True, unique=True)
>>>
>>> name = models.CharField(max_length=255, blank=True)
>>>
>>> pic = StdImageField(upload_to="data/media/%Y/%m/%d", blank=True,
>>> variations={
>>>
>>> 'large': (600, 400),
>>>
>>> 'thumbnail': (150, 140, True),
>>>
>>> 'medium': (300, 200),
>>>
>>> })
>>>
>>> doc = models.ForeignKey('appointments.doctor', blank=True,
>>>
>>> null=True, on_delete=models.CASCADE)
>>>
>>>
>>>
>>> Anticipated response:
>>>
>>>
&g

Re: Unexpected behavior on delete of model

2018-11-27 Thread Joel
I think you made a typo in the code. doctor can't be a Foreign key for
class Doctor. Anyway I get your point, and this is the same way I solved it
yesterday.

On Wed, 28 Nov, 2018, 11:07 AM Saurabh Agrawal 
>>
>>
>> class Doctor(models.Model):
>>
>> name = models.CharField(max_length=35)
>>
>> username = models.CharField(max_length=15)
>>
>>
>>
>> class DoctorProfilePic (models.Model):
>>
>> name = models.CharField(max_length=255, blank=True)
>>
>> pic = StdImageField(upload_to="data/media/%Y/%m/%d", blank=True,
>> variations={
>>
>> 'large': (600, 400),
>>
>> 'thumbnail': (150, 140, True),
>>
>> 'medium': (300, 200),
>>
>> })
>>
>> doctor = models.OneToOneField(Doctor, blank=True,
>>
>> null=True, on_delete=models.SET_NULL,
>> related_name="profile_pic")
>>
>>
>>
>
> Setting on_delete to SET_NULL doesn't make much sense here, I think. This
> implies that if a doctor is deleted, the profile pic will be preserved,
> with the FK to doc being set to NULL in db (which doesn't seem desirable).
> I think here CASCADE should work good and will not have the issue that the
> OP is facing.
>
>
>
>
>
>
>>
>>
>> …and after saying all that, I wouldn’t make a separate model for the
>> profile picture.  This is what I would do:
>>
>> class Doctor(models.Model):
>>
>> name = models.CharField(max_length=35)
>>
>> username = models.CharField(max_length=15)
>>
>> profile_pic = StdImageField(upload_to="data/media/%Y/%m/%d",
>> blank=True, variations={
>>
>> 'large': (600, 400),
>>
>> 'thumbnail': (150, 140, True),
>>
>> 'medium': (300, 200),
>>
>> })
>>
>>
>>
>>
>>
>>
>>
>> *From:* django-users@googlegroups.com [mailto:
>> django-users@googlegroups.com] *On Behalf Of *Joel Mathew
>> *Sent:* Tuesday, November 27, 2018 12:24 PM
>> *To:* django-users@googlegroups.com
>> *Subject:* Unexpected behavior on delete of model
>>
>>
>>
>> Situation:
>>
>>
>>
>> I have two Model classes, in two different apps which are part of the
>> same project. class doctor defined in appointments.models is a set of
>> attributes associated with a doctor, like name, username, email, phone etc.
>> class DoctorProfilePic is a Model defined in clinic.models, which has a
>> StdImageField which stores images. doctor has a One to One mapping to
>> DoctorProfilePic.
>>
>>
>>
>> class doctor(models.Model):
>>
>> docid = models.AutoField(primary_key=True, unique=True) # Need
>> autoincrement, unique and primary
>>
>> name = models.CharField(max_length=35)
>>
>> username = models.CharField(max_length=15)
>>
>> ...
>>
>> profilepic = models.ForeignKey(DoctorProfilePic, blank=True,
>> null=True, on_delete=models.CASCADE)
>>
>> ...
>>
>>
>>
>> class DoctorProfilePic (models.Model):
>>
>> id = models.AutoField(primary_key=True, unique=True)
>>
>> name = models.CharField(max_length=255, blank=True)
>>
>> pic = StdImageField(upload_to="data/media/%Y/%m/%d", blank=True,
>> variations={
>>
>> 'large': (600, 400),
>>
>> 'thumbnail': (150, 140, True),
>>
>> 'medium': (300, 200),
>>
>> })
>>
>> doc = models.ForeignKey('appointments.doctor', blank=True,
>>
>> null=True, on_delete=models.CASCADE)
>>
>>
>>
>> Anticipated response:
>>
>>
>>
>> When user selects one of the profile pics from a selection box, and
>> clicks Delete, django is supposed to delete the picture from the collection
>> of pictures uploaded by the doctor.
>>
>>
>>
>> Problem:
>>
>>
>>
>> When the delete button is clicked, django deletes both the picture and
>> the doctor, instead of just the former.
>>
>>
>>
>> Code:
>>
>>
>>
>> def removeprofpic(request, docid):
>>
>> docid = int(docid)
>>
>> if not IsOwnerorSuperUser(request, docid):
>>
>> 

Unexpected behavior on delete of model

2018-11-27 Thread Joel Mathew
Situation:

I have two Model classes, in two different apps which are part of the same
project. class doctor defined in appointments.models is a set of attributes
associated with a doctor, like name, username, email, phone etc. class
DoctorProfilePic is a Model defined in clinic.models, which has a
StdImageField which stores images. doctor has a One to One mapping to
DoctorProfilePic.

class doctor(models.Model):
docid = models.AutoField(primary_key=True, unique=True) # Need
autoincrement, unique and primary
name = models.CharField(max_length=35)
username = models.CharField(max_length=15)
...
profilepic = models.ForeignKey(DoctorProfilePic, blank=True,
null=True, on_delete=models.CASCADE)
...

class DoctorProfilePic (models.Model):
id = models.AutoField(primary_key=True, unique=True)
name = models.CharField(max_length=255, blank=True)
pic = StdImageField(upload_to="data/media/%Y/%m/%d", blank=True,
variations={
'large': (600, 400),
'thumbnail': (150, 140, True),
'medium': (300, 200),
})
doc = models.ForeignKey('appointments.doctor', blank=True,
null=True, on_delete=models.CASCADE)

Anticipated response:

When user selects one of the profile pics from a selection box, and clicks
Delete, django is supposed to delete the picture from the collection of
pictures uploaded by the doctor.

Problem:

When the delete button is clicked, django deletes both the picture and the
doctor, instead of just the former.

Code:

def removeprofpic(request, docid):
docid = int(docid)
if not IsOwnerorSuperUser(request, docid):
return HttpResponse("You dont have permissions to do this.")
doc = doctor.objects.get(docid = docid)
if request.method == 'POST':
print(request.POST)
picid = int(request.POST.get('profilepic'))
print(f'doc:{doc} picid:{picid}')
pic = DoctorProfilePic.objects.get(doc = doc, id =picid)
pic.delete()
msg = f"Successfully removed profile picture."
else:
msg = "Not a valid POST"
return HttpResponse(msg)

Now I'm guessing my problem is in defining the on_delete=models.CASCADE?
Can someone explain what I've done wrong?
Sincerely yours,

 Joel G Mathew

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__vyDXxz6sfmcS_Bcy8M5cANmB7mwmTMwS4rfF96bJmbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: get_or_delete leading to duplicate creation

2018-11-27 Thread Joel Mathew
You're talking as if this is a bug. If your records are being duplicated,
the problem is your code. It's not unto django to gauge what you need to do
in the database. Be explicit and update the records if you want updation.
Sincerely yours,

 Joel G Mathew



On Tue, 27 Nov 2018 at 18:07, Ankit Khandewal 
wrote:

> Hello,
>
> I am using get_or_create method in my project and this is leading to
> creating duplicate for objects, there created_at time difference is in
> milliseconds, please report this issue to fix.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4c8f9ca3-1379-49de-b37e-1978fc83444b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4c8f9ca3-1379-49de-b37e-1978fc83444b%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9FC%3D%3DpsxcUTAZGaE%3DaNrRtpNa758VBjbtX3hN7J8HqZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django doesn't run manage.py: ModuleNotFoundError: No module named 'ProjectName' (clonded Django project))

2018-11-27 Thread Joel Mathew
What I've found helpful in these situations is:

As mentioned just above, always use virtual environment to run your project.
Include the name of the folder of the virtualenv in .gitignore
Use `pip freeze` > requirements.txt
Install modules from requirements.txt in each virtualenv

Sincerely yours,

 Joel G Mathew



On Tue, 27 Nov 2018 at 18:07, Marco Antonio Diaz Valdes <
marko19691...@gmail.com> wrote:

> Hello, my partners and I are working on a Django project using git, a
> partner begin the project and committed it on github, then the rest of us
> copy the project on their respective computers, but when we run the "python
> manage.py runserver" command (or any other command using manage.py) the
> ones who copied the project get the next error:
>
> Traceback (most recent call last): File "manage.py", line 15, in 
> execute_from_command_line(sys.argv) File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/core/management/__init__.py",
> line 381, in execute_from_command_line utility.execute() File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/core/management/__init__.py",
> line 375, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv) File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/core/management/__init__.py",
> line 224, in fetch_command klass = load_command_class(app_name, subcommand)
> File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/core/management/__init__.py",
> line 36, in load_command_class module =
> import_module('%s.management.commands.%s' % (app_name, name)) File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/importlib/__init__.py",
> line 127, in import_module return _bootstrap._gcd_import(name[level:],
> package, level) File "", line 1006, in
> _gcd_import File "", line 983, in
> _find_and_load File "", line 967, in
> _find_and_load_unlocked File "", line 677, in
> _load_unlocked File "", line 728, in
> exec_module File "", line 219, in
> _call_with_frames_removed File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/core/management/commands/migrate.py",
> line 14, in  from django.db.migrations.autodetector import
> MigrationAutodetector File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/db/migrations/autodetector.py",
> line 11, in  from django.db.migrations.questioner import
> MigrationQuestioner File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/db/migrations/questioner.py",
> line 9, in  from .loader import MigrationLoader File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/db/migrations/loader.py",
> line 8, in  from django.db.migrations.recorder import
> MigrationRecorder File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/db/migrations/recorder.py",
> line 9, in  class MigrationRecorder: File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/db/migrations/recorder.py",
> line 22, in MigrationRecorder class Migration(models.Model): File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/db/models/base.py",
> line 87, in __new__ app_config = apps.get_containing_app_config(module)
> File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/apps/registry.py",
> line 249, in get_containing_app_config self.check_apps_ready() File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/apps/registry.py",
> line 131, in check_apps_ready settings.INSTALLED_APPS File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/conf/__init__.py",
> line 57, in __getattr__ self._setup(name) File
> "/home/marcoadv/Documentos/Mat-programacion/SoftwareDevelopment/classTime_ve/lib/python3.7/site-packages/django/conf/__init__.py",
> line 44, in _setup self._wrapped = Settings(settings_module) File
> "/home/marcoadv/Documentos/Mat-pr

Re: problem on django contrib

2018-11-24 Thread Joel Mathew
You didnt show the admin page. You showed urls.py. path is an easier way to
use urls, without need for regex.
Your problem is not clear to me. If it's something on the admin page. What
exactly are you trying to do? Post everything relevant.
Sincerely yours,

 Joel G Mathew



On Sun, 25 Nov 2018 at 09:16, Saeed Pooladzadeh  wrote:

> Can you please explain what should I do exactly?
>
> should I place these code in admin page? and delete the previous code?
>
> در شنبه 24 نوامبر 2018، ساعت 19:32:52 (UTC-8)، Joel نوشته:
>>
>> Use path for simple urls:
>>
>> from django.contrib import admin
>> from django.urls import path, include
>> from django.conf.urls import url
>>
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('appointments/', include('appointments.urls')),
>> path('clinic/', include('clinic.urls')),
>> path('', include('clinic.urls'))
>> ]
>> Sincerely yours,
>>
>>  Joel G Mathew
>>
>>
>>
>> On Sun, 25 Nov 2018 at 08:33, Saeed Pooladzadeh 
>> wrote:
>>
>>>
>>> here comes the code for urls.py but i cant uncomment it because python
>>> doesnt accept it
>>>
>>> """
>>> Definition of urls for DjangoWebProject19.
>>> """
>>>
>>> from django.conf.urls import include, url
>>>
>>> # Uncomment the next two lines to enable the admin:
>>>  #from django.contrib import admin
>>>  #admin.autodiscover()
>>>
>>> urlpatterns = [
>>> # Examples:
>>> # url(r'^$', DjangoWebProject19.views.home, name='home'),
>>> # url(r'^DjangoWebProject19/',
>>> include('DjangoWebProject19.DjangoWebProject19.urls')),
>>>
>>> # Uncomment the admin/doc line below to enable admin documentation:
>>>  #url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>>>
>>> # Uncomment the next line to enable the admin:
>>>  #url(r'^admin/', include(admin.site.urls)),
>>> ]
>>>
>>> در شنبه 24 نوامبر 2018، ساعت 18:54:47 (UTC-8)، Joel نوشته:
>>>>
>>>> Show the screenshot and complete code
>>>> Sincerely yours,
>>>>
>>>>  Joel G Mathew
>>>>
>>>>
>>>>
>>>> On Sun, 25 Nov 2018 at 08:07, Saeed Pooladzadeh 
>>>> wrote:
>>>>
>>>>> Hello
>>>>>
>>>>>
>>>>> I'm trying to use Django on the visual studio but for admin page when
>>>>> I uncomment the
>>>>>
>>>>>  from django.contrib import admin
>>>>>
>>>>> I get this message :
>>>>>
>>>>> unexpected token and it can't accept this line of code,
>>>>>
>>>>> please inform me why.
>>>>> Should I install a specific package or something?
>>>>>
>>>>> thanx
>>>>> Saeed
>>>>>
>>>>> --
>>>>> 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...@googlegroups.com.
>>>>> To post to this group, send email to django...@googlegroups.com.
>>>>> Visit this group at https://groups.google.com/group/django-users.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/24fc6b59-3342-4a9b-b3f5-075e64518c5c%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/24fc6b59-3342-4a9b-b3f5-075e64518c5c%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/10d16b02-ea16-4550-b9a1-f098572c20e1%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/10d16b02-ea16-4550-b9a1-f098572c20e1%4

Re: problem on django contrib

2018-11-24 Thread Joel Mathew
Use path for simple urls:

from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url


urlpatterns = [
path('admin/', admin.site.urls),
path('appointments/', include('appointments.urls')),
path('clinic/', include('clinic.urls')),
path('', include('clinic.urls'))
]
Sincerely yours,

 Joel G Mathew



On Sun, 25 Nov 2018 at 08:33, Saeed Pooladzadeh  wrote:

>
> here comes the code for urls.py but i cant uncomment it because python
> doesnt accept it
>
> """
> Definition of urls for DjangoWebProject19.
> """
>
> from django.conf.urls import include, url
>
> # Uncomment the next two lines to enable the admin:
>  #from django.contrib import admin
>  #admin.autodiscover()
>
> urlpatterns = [
> # Examples:
> # url(r'^$', DjangoWebProject19.views.home, name='home'),
> # url(r'^DjangoWebProject19/',
> include('DjangoWebProject19.DjangoWebProject19.urls')),
>
> # Uncomment the admin/doc line below to enable admin documentation:
>  #url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> # Uncomment the next line to enable the admin:
>  #url(r'^admin/', include(admin.site.urls)),
> ]
>
> در شنبه 24 نوامبر 2018، ساعت 18:54:47 (UTC-8)، Joel نوشته:
>>
>> Show the screenshot and complete code
>> Sincerely yours,
>>
>>  Joel G Mathew
>>
>>
>>
>> On Sun, 25 Nov 2018 at 08:07, Saeed Pooladzadeh 
>> wrote:
>>
>>> Hello
>>>
>>>
>>> I'm trying to use Django on the visual studio but for admin page when I
>>> uncomment the
>>>
>>>  from django.contrib import admin
>>>
>>> I get this message :
>>>
>>> unexpected token and it can't accept this line of code,
>>>
>>> please inform me why.
>>> Should I install a specific package or something?
>>>
>>> thanx
>>> Saeed
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/24fc6b59-3342-4a9b-b3f5-075e64518c5c%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/24fc6b59-3342-4a9b-b3f5-075e64518c5c%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/10d16b02-ea16-4550-b9a1-f098572c20e1%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/10d16b02-ea16-4550-b9a1-f098572c20e1%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_85x0Mv8UW-qjeJ8WwzCvF3KhDRAE1EA%2B8-OqmcNXKbuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: problem on django contrib

2018-11-24 Thread Joel Mathew
Show the screenshot and complete code
Sincerely yours,

 Joel G Mathew



On Sun, 25 Nov 2018 at 08:07, Saeed Pooladzadeh  wrote:

> Hello
>
>
> I'm trying to use Django on the visual studio but for admin page when I
> uncomment the
>
>  from django.contrib import admin
>
> I get this message :
>
> unexpected token and it can't accept this line of code,
>
> please inform me why.
> Should I install a specific package or something?
>
> thanx
> Saeed
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/24fc6b59-3342-4a9b-b3f5-075e64518c5c%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/24fc6b59-3342-4a9b-b3f5-075e64518c5c%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-kxrzQdZEUAX6UY4OaFpGsSDj6w89xGNW9U73p6dnQ3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Working with kronos

2018-11-22 Thread Joel
Thanks for the advise regarding understanding the issue in depth. My
initiation to python has been all of three months, and to django since two.
So far, I'd been scared to look under the hood, and any further than the
documentation. But I realize that it's not as daunting now add it used to
be. And coming from perl, I'm impressed at how cleaner it is.

Now I'm feeling power packed to examine the innards of django and python.
Thank you!

On Fri, 23 Nov, 2018, 9:06 AM Jason  the documentation is ambiguous in that regard.  that said, I feel it says
> you can register the cron tasks either way, but it doesn't do anything to
> actually install the commands.  you can see the code of the installtasks
> management command:
>
>
> https://github.com/jgorset/django-kronos/blob/v1.0/kronos/management/commands/installtasks.py
>
> which then runs the functions in
> https://github.com/jgorset/django-kronos/blob/v1.0/kronos/__init__.py#L117-L154
>
> as you can see there, it uses the python crontab package to install the
> crontab task.
>
> Furthermore, in
> https://github.com/jgorset/django-kronos/blob/v1.0/kronos/__init__.py#L107-L114,
> you can see what exactly the decorator consists of.  It just adds the task
> to a task registry set and doesn't do anything about actual installation.
>
> as an aside, one of the things I've found to be pretty valuable is to look
> at the project repository when it comes to questions like this.  this is
> not meant to be mean, and I'm sorry if it comes across that way.  I didn't
> know about this project before your question, but a brief look in the repo
> revealed those links and functions above, which are the most likely answers
> to your question above.  you're asking good questions here and giving good
> help in return, so if you internalize a method of investigating problems
> like this, or have more specific and focused questions that your
> investigations have unearthed.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7e5feb84-d1d6-4dfe-bc48-2e36ac0f0e30%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9zVznFM3pp3rG1%3DrGepULA6TmzmaefDSMsRfWEv-M25w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Working with kronos

2018-11-22 Thread Joel
Yes, the language of the documentation certainly needs tweaking. I had done
the installtasks and it did work. Thank you very much for your help.
Now, I can have my app check for upcoming appointments and send reminders.
It was a much needed functionality.

On Fri, 23 Nov, 2018, 9:06 AM Jason  the documentation is ambiguous in that regard.  that said, I feel it says
> you can register the cron tasks either way, but it doesn't do anything to
> actually install the commands.  you can see the code of the installtasks
> management command:
>
>
> https://github.com/jgorset/django-kronos/blob/v1.0/kronos/management/commands/installtasks.py
>
> which then runs the functions in
> https://github.com/jgorset/django-kronos/blob/v1.0/kronos/__init__.py#L117-L154
>
> as you can see there, it uses the python crontab package to install the
> crontab task.
>
> Furthermore, in
> https://github.com/jgorset/django-kronos/blob/v1.0/kronos/__init__.py#L107-L114,
> you can see what exactly the decorator consists of.  It just adds the task
> to a task registry set and doesn't do anything about actual installation.
>
> as an aside, one of the things I've found to be pretty valuable is to look
> at the project repository when it comes to questions like this.  this is
> not meant to be mean, and I'm sorry if it comes across that way.  I didn't
> know about this project before your question, but a brief look in the repo
> revealed those links and functions above, which are the most likely answers
> to your question above.  you're asking good questions here and giving good
> help in return, so if you internalize a method of investigating problems
> like this, or have more specific and focused questions that your
> investigations have unearthed.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7e5feb84-d1d6-4dfe-bc48-2e36ac0f0e30%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8W%3Dwk5PZv2MJbrcrbBokD7JwMCO3sfJq0V5CkDEzFLjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: mail sending

2018-11-22 Thread Joel
django-kronos is probably the easiest to do this. As mentioned, you could
create a management command to check a database or file for the time when
you want to run this, with any other data, then you'd set an interval at
which you want to check if mails need be sent, and then execute your mail
sending function if the criteria is satisfied.

On Thu, 22 Nov, 2018, 8:19 PM Jani Tiainen  Hi.
>
> Essentially you need to record the time you want your mail to be sent and
> then you need some kind of background worker to check (periodically) if
> there are any mails to be sent.
>
> Celery is one tool that can do that.
>
> I personally use simple cron job that uses django management command to
> achieve same stuff (sending emails asynchronously).
>
> Tushar Nadkar  kirjoitti to 22. marrask. 2018
> klo 8.53:
>
>> when a button is clicked , i want to send specific mail after 3 days ?
>> how can i do that in django
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAAHYEvMUPoT%2BivTkPx%2BekvksnVWo%3DiByAt48iQX8m-HjTSQMTw%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHn91ocf3eFL7QMiXj0Mspg4zDCovE0VGaJ8-onEaRdsq02TXA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-KvAkYrF0hhKfvc_GZo_wueLrTM%2B1kCHXtQvJH8VfjQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Working with kronos

2018-11-22 Thread Joel Mathew
I understood the documentation to mean that either we can create management
commands and register with cronos, or create cron.py.
Sincerely yours,

 Joel G Mathew



On Thu, 22 Nov 2018 at 18:42, Jason  wrote:

> https://github.com/jgorset/django-kronos/tree/v1.0#register-tasks-with-cron
>
> sounds like you need to run a register management command first.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bc4a5948-8e8d-45c8-8a7c-522e482680bc%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/bc4a5948-8e8d-45c8-8a7c-522e482680bc%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9XHEiRgkzG_16jz-CXB%2BE5fQ_PjYOMn6F1evbDEGEXaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Working with kronos

2018-11-21 Thread Joel Mathew
I was trying the basic django-kronos command to test:
I did pip3 install django-kronos,

myproject/myapp/cron.py:
import kronos
import random

@kronos.register('* * * * *')
def complain():
complaints = [
"I forgot to migrate our applications's cron jobs to our new server! Darn!",
"I'm out of complaints! Damnit!"
]

print random.choice(complaints)

In my myproject/myproject/settings.py:

INSTALLED_APPS = [
'appointments.apps.AppointmentsConfig',
'clinic.apps.ClinicConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_extensions',
'bootstrap4',
'widget_tweaks',
'parsley',
'session_security',
'kronos'
]

Ran:
./manage.py runserver
I expected the dev server to throw up a message every minute. Nothing seems
to be happening.

Sincerely yours,

 Joel G Mathew

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9TOrybmhDJhG%2BB%3DsmScROAA1s4vJn2xmqaYbDtBNeerQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unapplied Migration - how to apply

2018-11-20 Thread Joel Mathew
Anyway, there is no point running `makemigrations` after `migrate` is run.
That doesnt do anything, unless you have made a change in your models after
your migrate is done
Sincerely yours,

 Joel G Mathew



On Wed, 21 Nov 2018 at 01:45, Joel Mathew  wrote:

> Yes, for your special case where you seem to have a pre-existing
> migration, you dont need makemigrations before migrate. I was just
> commenting that this is not the usual case.
>
> Sincerely yours,
>
>  Joel G Mathew
>
>
>
> On Wed, 21 Nov 2018 at 01:43, Tim Johnson  wrote:
>
>> * Joel Mathew  [181120 10:35]:
>> > makemigrations should come before migrate. You cant migrate without
>> > creating the migrations first.
>>   Now I am being confused:
>>
>>   The sequence that Joel suggests did not work for me.
>>   (I tried it before opening this thread)
>>
>>   The reverse sequence that was suggested by Shubham Rewale
>>   did fully apply the migration.
>>
>>   Which is correct?
>> --
>> Tim Johnson
>> http://www.tj49.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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/20181120201324.GK30127%40mail.akwebsoft.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8%2Bxqoi12Gf2anpbe_O9A0njvHFn9GgHeeka3sqCZJP4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unapplied Migration - how to apply

2018-11-20 Thread Joel Mathew
Yes, for your special case where you seem to have a pre-existing migration,
you dont need makemigrations before migrate. I was just commenting that
this is not the usual case.

Sincerely yours,

 Joel G Mathew



On Wed, 21 Nov 2018 at 01:43, Tim Johnson  wrote:

> * Joel Mathew  [181120 10:35]:
> > makemigrations should come before migrate. You cant migrate without
> > creating the migrations first.
>   Now I am being confused:
>
>   The sequence that Joel suggests did not work for me.
>   (I tried it before opening this thread)
>
>   The reverse sequence that was suggested by Shubham Rewale
>   did fully apply the migration.
>
>   Which is correct?
> --
> Tim Johnson
> http://www.tj49.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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/20181120201324.GK30127%40mail.akwebsoft.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-_35s-zzkB77YUHttjuUU4mMjvkC7r3HDAfyCOFg_g2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unapplied Migration - how to apply

2018-11-20 Thread Joel Mathew
makemigrations should come before migrate. You cant migrate without
creating the migrations first.
Sincerely yours,

 Joel G Mathew



On Wed, 21 Nov 2018 at 00:47, Tim Johnson  wrote:

> * Shubham Rewale  [181120 08:44]:
> > python manage.py migrate
> > Then use
> > Python manage.py makemigrations
>
>   Thank you. That worked to apply the missing item.
>   Note: Had tried that in the past but reversed the sequence of the
>   two commands.
>
>   Have a great day Shubham
>
> > On Tue, 20 Nov 2018, 10:10 p.m. Tim Johnson  >
> > > using django on ubuntu 16.04
> > > python 3.5.2
> > > django.VERSION =
> > > (2, 0, 0, 'final', 0)
> > > Working from the Django Core book by Nigel George.
> > > When launching
> <...> For more options, visit https://groups.google.com/d/optout.
>
> --
> Tim Johnson
> http://www.tj49.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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/20181120191706.GJ30127%40mail.akwebsoft.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-%3DZ%3DM3rX_w6N-HLHqj-LkdJxzAhg9v7V6wifrMMEY6wQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Self hosted sentry server

2018-11-19 Thread Joel Mathew
I'm just wondering if any  of you are running a self hosted sentry server
for your django installation? Does it have all features of the commercial
non hosted subscription?
Sincerely yours,

 Joel G Mathew

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_99HpuBcucf-cONLvkNJR3wxDXCA3DVNhafPp8yeOfGiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to access Facebook graph api in django

2018-11-19 Thread Joel Mathew
What's the problem you're facing? Where's your code?
Sincerely yours,

 Joel G Mathew



On Mon, 19 Nov 2018 at 19:04, Tushar Nadkar 
wrote:

> i want to access my users email , address , phone number, pincode by face
> book graph api
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAHYEvMrSy9CJjQ4eAL_W6gSkkbk_4QN%2BEdHXD%3DT92rvRqEq9g%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAAHYEvMrSy9CJjQ4eAL_W6gSkkbk_4QN%2BEdHXD%3DT92rvRqEq9g%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__BHyhCMqUQeHTv5wBdkN1Sc_0uS5C%2B_OySGsDoJChObA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: iss api

2018-11-18 Thread Joel
Isn't this reverse geocoding? I think it's already an example in the
official tutorial.

On Sun, 18 Nov, 2018, 7:45 PM gokul s  hi i want create model that get the longitude and lattitude for
> International Space Station and plot the longitude and lattitude on map so
> that we can track the live location on map.i  have wrote function to
> receive lattitude and longitude but i dont know how to plot it with map.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6fd2de51-bcca-4778-8d5a-0d22329132cc%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-Cfcs_8BhOXGsKDKreQM5otdQa-h5gC8X7cYhzOtD%3D%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: file URL missing project name

2018-11-18 Thread Joel Mathew
It's anybody's guess unless you post your code.
Sincerely yours,

 Joel G Mathew



On Sun, 18 Nov 2018 at 20:47, Jeff Williams 
wrote:

> Hi All,
> I'm new to django, so sorry if this is a newbie issue.
>
> I've managed to upload an ImageFieldbut when I try to display it in my
> template using object.pic.url...the URL I'm getting back is missing my
> project name from the URL and the pic is not loading.
>
> Specifically I'm getting
> http://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>  back.and
> I need
>
> http://127.0.0.1:8000/*oldgrub*
> /media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>
> back to have it work.
>
> What am I missing?  I've poured over my configs.
> Jeff
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMgbqCe3UzvrWFg4fiRSPXp6HtLJoPJmGs8oPSZjAd%3Dxx4ygNQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMgbqCe3UzvrWFg4fiRSPXp6HtLJoPJmGs8oPSZjAd%3Dxx4ygNQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-Siy3yQgn8O9Kj0NC6URxwhebR%3DqO7BvUwzyL9mi9NdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: API project example

2018-11-17 Thread Joel
Follow the initial two django tutorials and you'll get the idea.

On Sun, 18 Nov, 2018, 5:23 AM Arturo Fernandez  Hi guys, I'm developing an idea, but the funny things is that I'm learning
> Django at the same time. Do you guys know of any SIMPLE project that
> requests data from an api and displays it on the font end (html)?
>
> I'm working with themoviedb using https://github.com/celiao/tmdbsimple. I
> got the shell as the example there but how do I do it on the html so it can
> be displayed?
>
> If you know of any project please let me know so I can learn by seeing it.
>
> Many thanks
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6b544943-ab9f-41da-b9ad-045a4b9615cd%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__npjHhC9GbVbjzC0wD0sam7UTChHyVR-5FbvOkLDuWgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


User permissions

2018-11-17 Thread Joel Mathew
How are you implementing user permission groups in your project? I'm using
a model to store user and other models as foreign key and permissions as
boolean? Is there a preferred module or standard way to do this?

Sincerely yours,

 Joel G Mathew

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-q4HqkxoUnaO1ij%2BKanW-wJKV-xL6NufcuPboVfNMPRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to download a file when a django function is called by javascript instead of navigation to the url?

2018-11-17 Thread Joel
Yes. But it's not usable when we're using JavaScript to fetch the url.

On Sat, 17 Nov, 2018, 9:20 PM Jason  oh, I didn't know that was a thing.  TIL.
>
>
> https://docs.djangoproject.com/en/2.1/ref/request-response/#django.http.FileResponse
>
> note the bit about as_attachment setting content disposition
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a950f7f3-2e7e-490d-b271-3125829a9376%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8mx5-wsdR39naUt%2BPYiTCGP5dD%2BMCJ8QObB9%2BLGxGqrg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   4   >