Re: Process Data during server initialization

2020-10-22 Thread Okware Aldo
Hi Lois,

To expand on what Scott is saying.
- model DB tables to store the data you need to render the graphs
- build a service to preprocess the data - this service can run
periodically depending on how up to date you need the graphs to be (a
microservice)
- build a single endpoint to simple fetch the data the graphs need (Django)
if this is a monolith the normal Django views should do the trick






On Fri, Oct 23, 2020 at 12:01 AM Lois Greene-Hernandez 
wrote:

> Well it's data that I need to populate the pages.  It's very processor
> intensive and I'll need to pass it back to the views once it's processed.
> Can I pass data back to the views once I've run a task?  I'm looking into
> caching alternatives.
>
> Thanks
> Lois
>
> On Thu, Oct 22, 2020 at 4:55 PM Scott Sawyer  wrote:
>
>> Could you run a cron job on the system to analyze the data periodically?
>>
>> Sent from my iPhone
>>
>> On Oct 22, 2020, at 1:30 PM, Lois Greene-Hernandez 
>> wrote:
>>
>> Hello,
>>
>> I'm working on a data and calculation intensive django application.  It
>> uses pandas and plotly.py to create many charts and graphs.  I have some
>> control over the design of the application but not total control.  One
>> decision that I stuck with is that all charts and graphs are preprocessed
>> on the first page that loads.  If it were up to me, I'd process what is
>> needed at the time but its not up to me.
>>
>> Since I need to load and process a lot of data prior to page load, I was
>> wondering if it would be possible to do this during server start up.  I'd
>> also need to pass a log of data from whatever startup process I ran to the
>> django views.
>>
>> Any information that you could shed on this problem would be greatly
>> appreciated.
>>
>> Thanks
>>
>> Lois J. Greene-Hernandez
>>
>> --
>> 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/5e34166f-ade9-4dec-bb9d-0a8d6392fdc8n%40googlegroups.com
>> 
>> .
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/X1joo7QEbnc/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/F90610CE-721D-4FEB-8992-FAF63A6C6368%40gmail.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/CAAGmcw0tk9fd%3DhjvpdZTpqqf9-gDDKgtW7YYfvJxVcCo1DvD4g%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/CAMEZma-P3Z6yoAJJGCWbDpd8YEWkc_kV8uS4FKDNvsR-LF-4WA%40mail.gmail.com.


Re: set school year and change boolean to False when school year is not active

2019-10-17 Thread Okware Aldo
hello,
You could use signals pre_save
https://docs.djangoproject.com/en/2.2/topics/signals/


On Fri, Oct 18, 2019 at 4:49 AM Rain  wrote:

> Hello!. thanks for your help..
> what i want to achieve is ti check if end year is already meet.
> then if school year already ended. The field would be inactive or the
> boolean True would be False.
> if the set year already passed.
>
> On Fri, Oct 18, 2019 at 4:41 AM James Gutu  wrote:
>
>> It depends what you are trying to achieve.
>> What do you mean by "then when school year end  this would automatically
>> in_active"?
>> Do you need to determine start_date <= self.end_year *only when saving*
>> or you need to check *everyday* to see if datetime.now() > self.end_year?
>>
>> On Thu, Oct 17, 2019 at 4:27 PM Rain  wrote:
>>
>>> Hi Guys!! Hope Fully someone can help me any hint or answer really
>>> appreaciated..
>>> ireally stuck here in a couple of days now.
>>> My Problem is i want to set a school year using
>>> start_year and end_year field then when school year end  this would
>>> automatically in_active
>>> for example
>>> start_year: 2019-01-01
>>> end_year: 2020-01-01
>>> active_year: True
>>>
>>> then when 2020-01-01 ends
>>> the boolean will automatically change the status to
>>> active_year:False
>>>
>>> --
>>> 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/e429d5d2-a6fc-4bf1-82b0-1c12e08f3f49%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>>
>> --
>> Regards,
>> James Gutu
>> Mobile: +447368461508
>> Skype: jmgutu
>>
>> --
>> 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/CAOnWGOLqLHhZeo9brsWuVNipaOX3yyxuW%2BN22tq7xbe_XEg7hA%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/CAM-q_1cE%2Bpstaxti72smp%3DfEzgGqV0oCbjp14C17x%3DfwnKnhug%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/CAMEZma-bceR0T3GwULj%3DW3ojs1gyu-qVYXaYgEifoZHiDjMuyw%40mail.gmail.com.


Re: Database setup

2019-04-19 Thread Okware Aldo
So if you launch xampp and you are sure all the services are running.
services (Apache, MySQL, and PHP), xampp also ships with phpmyadmin a mysql
webbased interface. which you can launch by typing `localhost/phpmyadmin`
in any browser of choice.

Once the PHPMyAdmin interface is launched. using this tool you can create a
MySQL DB, create a user with password and attach the user to that database

if you have a database already you could use the default root user for
MySQL, there is usually no password. so you username: root and password
would be blank, I don't recommend this, it's not a good practice.

https://www.youtube.com/watch?v=1-81n_vuwug

On Fri, Apr 19, 2019 at 10:58 PM Soumen Khatua 
wrote:

> Yes I already install xampp server but what will be my password? Actually
> for development purpose xampp server not accept any password, I guess!!
>
>
> Thank you for your valuable time.
>
> On Sat, 20 Apr 2019, 10:48 Okware Aldo,  wrote:
>
>> Hey, If you have xampp installed, just create a database using
>> phpmyadmin, attach a user to that database.
>> then ensure you have a driver package installed and setup for django. eg.
>> pymsql has worked well for.
>> then make the necessary changes in django settings file.
>>
>>
>> On Fri, Apr 19, 2019 at 9:21 PM Soumen Khatua 
>> wrote:
>>
>>> Hi Folks,
>>> How can I configure xampp server provided mysql database in django.
>>>
>>> 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 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/CAPUw6WZXNhKtx4zkUk-tqjSTvfBU%2BhFKuzqXG-UzHmDzT9iZyg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAPUw6WZXNhKtx4zkUk-tqjSTvfBU%2BhFKuzqXG-UzHmDzT9iZyg%40mail.gmail.com?utm_medium=email&utm_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/CAMEZma_4bR_yUbUTWJCB_JhmRXWqEHpgzGzQp24qCCr%3DG%3DjQvg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAMEZma_4bR_yUbUTWJCB_JhmRXWqEHpgzGzQp24qCCr%3DG%3DjQvg%40mail.gmail.com?utm_medium=email&utm_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/CAPUw6WZ9FfDQi2dewUuL4W%2BV9XEsafK4Fmp-XiV72ySyNdYZGw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPUw6WZ9FfDQi2dewUuL4W%2BV9XEsafK4Fmp-XiV72ySyNdYZGw%40mail.gmail.com?utm_medium=email&utm_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/CAMEZma9ypAVxv%3DfMMs%2B0Q3CtzdoUNxC06M1t8QiT19s4-iE7Pg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database setup

2019-04-19 Thread Okware Aldo
Hey, If you have xampp installed, just create a database using phpmyadmin,
attach a user to that database.
then ensure you have a driver package installed and setup for django. eg.
pymsql has worked well for.
then make the necessary changes in django settings file.


On Fri, Apr 19, 2019 at 9:21 PM Soumen Khatua 
wrote:

> Hi Folks,
> How can I configure xampp server provided mysql database in django.
>
> 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 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/CAPUw6WZXNhKtx4zkUk-tqjSTvfBU%2BhFKuzqXG-UzHmDzT9iZyg%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/CAMEZma_4bR_yUbUTWJCB_JhmRXWqEHpgzGzQp24qCCr%3DG%3DjQvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: drf - change Foreign key to another field in a serializer using modelviewset

2019-02-07 Thread Okware Aldo
Hi,

I think you should consider creating a custom serializer, where you can
modify that field, though I would advise you create another or modify yo
return the json object of the organiser.

https://www.django-rest-framework.org/api-guide/fields/#serializermethodfield

On Thu, Feb 7, 2019 at 10:23 PM Ing.Daniel Bojorge 
wrote:

> Hi.
>
> You can customize the queryset.
>
>
> Dios L@s Bendiga
>
> Saludos,
>
>
>
> [image: --]
>
> daniel.bojorge
> [image: http://]about.me/daniel.bojorge
> 
>
>
> *Domina el ORM  Django* 
> *Curso Desarrollo Web con Python usando Django 2.1 Para Principiantes*
> 
> *WebService RestFul API con Python usando Django RestFrameWork*
> 
> *Fácil Replicación de Cualquier Base de Datos y/o Sistema Operativo*
> 
> *Programación en Capas (Web y Escritorio)* 
> Mi Blog 
> Nicaragua
>
> "Si ustedes permanecen unidos a mí, y si permanecen fieles a mis
> enseñanzas, pidan lo que quieran y se les dará.
> (Juan 15:7 DHH)
> Bendito el varón que se fía en el SEÑOR, y cuya confianza es el SEÑOR.
> (Jeremías 17:7 RV2000)
>
>
>
> El jue., 7 feb. 2019 a las 12:18, cyril moreau ()
> escribió:
>
>> Hi,
>>
>> I have a ModelViewSet class as :
>> class EventAPIListCreate( viewsets.ModelViewSet):
>>  queryset = EventAPI.objects.all()
>>  serializer_class = EventAPISerializer
>>
>> and my serializer looks like :
>> class EventAPISerializer(serializers.ModelSerializer):
>>class Meta:
>> model = EventAPI
>>fields = '__all__'
>>
>> when I hit the rest api endpoint I have the following result :
>>
>> [
>> {
>> "id": 1,
>> "name": "Cumple",
>> "location": "calle le corbusier",
>> "description": "cest le cumple de cyril",
>> "date": "2019-02-05T01:01:00Z",
>> "participant": 5,
>> "created_at": "2019-02-05T20:43:01.630400Z",
>> *"organisator": 2*
>> },
>>
>> {
>> "id": 2,
>> "name": "' or 1=1;",
>> "location": "calle le corbusier",
>> "description": "cest le cumple de cyril",
>> "date": "2019-02-05T01:01:00Z",
>> "participant": 4,
>> "created_at": "2019-02-05T20:45:11.265705Z",
>> *"organisator": 2*
>> },..
>>
>>
>> In the result you can see that "organisator" is a number because it is a
>> foreign key.
>>
>> the organisator model is composed as :
>> ID,
>> FirstName,
>> Lastname,
>> Email
>>
>>
>> I would like to change the endpoint result to have :
>>
>> {
>> "id": 1,
>> "name": "Cumple",
>> "location": "calle le corbusier",
>> "description": "cest le cumple de cyril",
>> "date": "2019-02-05T01:01:00Z",
>> "participant": 5,
>> "created_at": "2019-02-05T20:43:01.630400Z",
>> *"organisator": "myem...@gmail.com "*
>> },
>>
>>
>> or
>>
>> {
>> "id": 1,
>> "name": "Cumple",
>> "location": "calle le corbusier",
>> "description": "cest le cumple de cyril",
>> "date": "2019-02-05T01:01:00Z",
>> "participant": 5,
>> "created_at": "2019-02-05T20:43:01.630400Z",
>> *"organisator": "Firstname Lastname"*
>> },
>>
>>
>>
>> How can I do that?
>> Can i use customize the serializer or the modelviewset somehow?
>> should i use an APIView class instead of a modelviewset to be able to get
>> this result?
>>
>> I would like to keep the modelviewset as i find it very useful, but maybe
>> it is not posible
>>
>> 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 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/bc44ca0c-442b-4067-92e0-df9dadc28a47%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/CAMQeQjawBsed98R1gNQkXNV9BbRNVHqbgZQ03%2B6t7kf-UTy_qg%40mail.gmail.com
> 

Re: Job Request

2019-01-25 Thread Okware Aldo
I am looking for projects I can contribute on. so if you have a project I
can contribute on. I am happy to help 2 hours of code in a week for free.

On Fri, Jan 25, 2019 at 3:51 PM Nitin Kalmaste 
wrote:

> Where can I find Live Projects to work on So that I can Improve My python
> Skills
>
> On Thursday, January 24, 2019 at 9:05:39 PM UTC+5:30, Motaz Hejaze wrote:
>>
>> Hi all ,
>>
>> Is there any remote job regarding Django , i am a beginner to mid-level
>> in Django ..
>>
>> Thanks all ..
>>
> --
> 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/abc65682-9f58-4898-b555-88e8752c0957%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/CAMEZma9T34QG-q%2B5VGqgNW6kuQNaYK7sJRyjt7WEO86LfwCZgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Sale on Packt publishing

2019-01-08 Thread Okware Aldo
Django 2 by example - Antonio Mele and Django design patterns.

On Tue, 8 Jan 2019, 16:58 Lehner Viktor,  wrote:

> Which Django book do you recomend to by from PACKT ?
>
> --
> 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/6e7b54c1-7f24-4c17-866c-21b1eb909ca0%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/CAMEZma-es9s0Au2zuJLLB8hWeAK_PLbwMYVmMHEEbD56DNdmNA%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 Okware Aldo
I can have a look if you give me access to the code, we could do
teamviewer, or  repo.

Let me know.

On Sun, 30 Dec 2018, 22:40 abel otugeme,  wrote:

> 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/CAMEZma9ja8TOwuh_n5fpzaBrANt3igG1%2BkBhz%3DSearvJw1NQAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to Django

2018-12-16 Thread Okware Aldo
I can remotely help, provide access me with remote access or push code
github

On Sat, 15 Dec 2018, 20:54  Hello - I'm trying to get Django up and running and I'm having some likely
> trivial trouble. I'm following the "Writing your first Django app"
> tutorial, but I'm getting stuck trying to create the project using 
> 'django-admin
> startproject mysite'. The output says command not found. I've tried
> troubleshooting but haven't had any luck so far. Any assistance is much
> appreciated.
>
> --
> 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/b2057d6f-270c-4916-bf6d-da1cbf4e7c87%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/CAMEZma9fAWn%3DzToF-DF%2B4KyRZjEH_KYAc2_rThE8jcVt2gPQNw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django UpdateView and Createview

2018-12-09 Thread Okware Aldo
Ryan's suggestion should give you a starting point.

On Sun, Dec 9, 2018 at 3:43 PM Deepak Kumar 
wrote:

> On Sunday, December 9, 2018 at 6:21:55 AM UTC+5:30, Ryan Nowakowski wrote:
> > Take a look at
> https://docs.djangoproject.com/en/2.1/topics/class-based-views/generic-editing/
> >
> >
> > On December 7, 2018 7:09:25 AM CST, Rupam Hazra 
> wrote:
> >
> > Hi,
> >
> >
> > I have working in a TaskManagement Sytem where i have project module and
> technology module.
> >
> >
> > class ProjectMaster(models.Model):
> > name=models.CharField(max_length=255,blank=True,null=True)
> > description=models.CharField(max_length=255,blank=True,null=True)
> > is_agreement_sent=models.BooleanField(default=False)
> > is_invoice_create=models.BooleanField(default=False)
> > is_invoice_sent=models.BooleanField(default=False)
> > is_paid=models.BooleanField(default=False)
> > status=models.BooleanField(default=True)
> > is_deleted=models.BooleanField(default=False)
> > created_at=models.DateTimeField(auto_now_add=True)
> > created_by = models.ForeignKey(User,
> on_delete=models.CASCADE,related_name='createdUser',blank=True,null=True)
> > updated_at=models.DateTimeField(auto_now_add=True)
> > updated_by=models.ForeignKey(User, on_delete=models.CASCADE,
> related_name='UpdUser',blank=True,null=True)
> > #technology_master = models.ForeignKey(TechnologyMaster,
> on_delete=models.CASCADE, related_name='technologies', )
> >
> > def __str__(self):
> > return str(self.name)
> > class TechnologyMaster(models.Model):
> > #projectmaster =
> models.ForeignKey(ProjectMaster,on_delete=models.CASCADE)
> > name=models.CharField(max_length=255,blank=True,null=True)
> > status = models.BooleanField(default=True)
> > is_deleted = models.BooleanField(default=False)
> > created_at = models.DateTimeField(auto_now_add=True)
> > created_by = models.ForeignKey(User,
> on_delete=models.CASCADE,blank=True, null=True,related_name='created_by')
> > updated_at = models.DateTimeField(auto_now_add=True)
> > updated_by = models.ForeignKey(User,
> on_delete=models.CASCADE,blank=True, null=True,related_name='updated_by')
> > def __str__(self):
> > return str(self.id)+'-'+ self.nameHere one functionality is one
> project has multiple technologies so i have made one mapping table
> belowclass ProjectTechnologyMapping(models.Model):
> > project_master = models.ForeignKey(ProjectMaster,
> on_delete=models.CASCADE, related_name='projects')
> > technology_master = models.ForeignKey(TechnologyMaster,
> on_delete=models.CASCADE, related_name='technologies')
> > status = models.BooleanField(default=True)
> > is_deleted = models.BooleanField(default=False)
> > created_at = models.DateTimeField(auto_now_add=True)
> > created_by = models.ForeignKey(User,
> on_delete=models.CASCADE,blank=True,null=True,related_name='pro_tech_created_user')
> > updated_at = models.DateTimeField(auto_now_add=True)
> > updated_by = models.ForeignKey(User,
> on_delete=models.CASCADE,blank=True,null=True,related_name='pro_tech_updated_user')
> > def __str__(self):
> > return str(self.id)So, my question is how add and update using
> django createview,updateview (generic view) using templates.
>
> --
> 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/b0be82da-dca5-4594-9f22-e0c3323adc3b%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/CAMEZma_N6aUqeboxXAzdZfYqx1c__2vGaaujMQuTGThxcW0Rtg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: No module named "newsimage" app

2018-09-25 Thread Okware Aldo
Hi Mellisa,

are you using the module/app 'newsimage' in some part of your application?

first make changes to install apps section as Vinod Kumar suggested, then
make sure whenever you  make reference to the app its imported.

On Tue, Sep 25, 2018 at 2:19 PM 'Vinod Kumar' via Django users <
django-users@googlegroups.com> wrote:

> add app name after default dajngo.contrib . In your case INSTALLED_APPS will
> look like
>
> INSTALLED_APPS = [
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
>
> # third party modules
>
> # custom module
>
> 'newsimage',
>
> ]
>
>
>
> On Tue, Sep 25, 2018 at 4:35 PM Melissa Malala 
> wrote:
>
>> My project is giving me an error called "No Module named "newsimage" app
>> (2 Screenshots attached) whenever I run the server using:
>> python3.6 manage.py runserver.
>>
>> I have added the name of the app under INSTALLED_APPS but it won't
>> recognise the name of the app. Is there anything else I need to do?
>>
>> --
>> 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/8533b537-cd43-4492-813c-eac8e5dbded5%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> 
>
> *This e-mail and all attachments are intended solely for use by the
> intended recipient and may contain confidential / proprietary information
> of KiwiTech, LLC, subject to important disclaimers and conditions including
> restrictions on the use, disclosure, transfer or export of such
> information.* *If you have received this message in error or are not the
> named recipient(s), please immediately notify the sender at the telephone
> number stated above or by reply e-mail and delete this e-mail from your
> computer*
>
> --
> 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/CAJOHC1y7z4BqVLnDtoVhc_VWUw3M1UVJKHUdP2Z2Mt%2BXfoKO4Q%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/CAMEZma8F8Y7%3DjZd86oojETWBb-H3Q%2BOVX_FHFPkaknYhvwPbHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error: C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

2018-09-02 Thread Okware Aldo
Use pymysql package instead.

On Sun, 2 Sep 2018, 17:04 Kasper Laudrup,  wrote:

> Hi Rupam,
>
> On 02/09/2018 15.15, Rupam Hazra wrote:
> > Hi,
> >
> > I am stuck with this issue when i am installing mysqlclient this issue
> >
>
> Installing mysqlclient from source on Windows is definitely not related
> to Django in any way, so you would be much better of asking your
> question on a mysql related list/forum.
>
> I don't understand why you want to build it yourself though, wouldn't it
> be easier just to use some of the installation packages already made for
> Windows?
>
> 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/5cbe363f-4020-57e5-8aba-4e5bdcc2beeb%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/CAMEZma_dU%2B0YxHdKZL-HMi6U5JxfKL7W4vQX-frKyF%3DdVje8Yw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django database problem

2018-08-17 Thread Okware Aldo
Mikko,

Check out this link below, it will help you understand how to connect you
Django project to any DB manager.

https://docs.djangoproject.com/en/2.1/intro/tutorial02/

On Fri, Aug 17, 2018 at 6:55 PM Mikko Meronen 
wrote:

> Hi,
>
> I'm quite new with django and python and I wish someone could help me.
>
> I'm building a webpage where my python program/bot collects data from
> webpages.
>
> Is there a way that I can use my python program to store the data to
> django's database?
>
> At the moment when I run my program, I collect the data to separate sqlite
> database, but I don't know how to collect/connect it to django's sqlite
> database (or models).
>
> - Mikko
>
> --
> 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/CAGD0jjLbzK1XVVSUTD4Z66p_RUoK0pBW%2BrEYtVM_HwAd9d%3DwvQ%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/CAMEZma_gWB4gysi%2BBC559jNFiJxvge8QvWzqgDs7mqB2D34QYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django makemigration polls error

2018-07-25 Thread Okware Aldo
I think he should share screenshot of his setting.py file, but from what I
can see -- if he is running django 1.10 and above apps should be 'polls'
not  *'polls.apps.PollsConfig'*

On Wed, Jul 25, 2018 at 2:23 PM theAloneOne  wrote:

> You may have missed a comma after *'polls.apps.PollsConfig'* in your
> settings.py file in the *INSTALLED_APPS* list so check it again and you
> may not be using the same django-version as used in documentation so get
> the latest if you are following latest docs release.
>
> --
> 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/f10762a5-d1b4-442c-aea0-a455e3925b71%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/CAMEZma8EO5xS6LTzVv1wHgDsU6zbUDcOgDfOG_ZZhwrTXFn3ww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django makemigration polls error

2018-07-25 Thread Okware Aldo
Did you include Polls app in INCLUDE_APPS section in settings.

On Wed, 25 Jul 2018, 06:34 Ashish Kumar,  wrote:

> I am trying to follow the latest Django tutorial at the documentation and
> I faced the following error when I enter python manage.py makemigrations
> polls
> Traceback (most recent call last): File "manage.py", line 15, in 
> execute_from_command_line(sys.argv) File
> "C:\Users\asus\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
> line 371, in execute_from_command_line utility.execute() File
> "C:\Users\asus\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
> line 347, in execute django.setup() File
> "C:\Users\asus\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\__init__.py",
> line 24, in setup apps.populate(settings.INSTALLED_APPS) File
> "C:\Users\asus\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\registry.py",
> line 89, in populate app_config = AppConfig.create(entry) File
> "C:\Users\asus\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\config.py",
> line 123, in create import_module(entry) File
> "C:\Users\asus\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py",
> line 126, in import_module return _bootstrap._gcd_import(name[level:],
> package, level) File "", line 994, in
> _gcd_import File "", line 971, in
> _find_and_load File "", line 950, in
> _find_and_load_unlocked ModuleNotFoundError: No module named
> 'polls.apps.PollsConfigwebapp'; 'polls.apps' is not a package
>
> I'm new to Django. I had followed each steps properly and even 
> re-checked.Experts
> please assist.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/2f948227-37d7-491d-b589-939abeab557e%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/CAMEZma__ocmfm8nu9XGvumt%3DXDWr8x7yMgaCz1WUoAzWksvgHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Good afternoon, I need help to generate a PDF of my models in DJANGO

2018-05-29 Thread ALDO JAVIER VIGUERAS
Thanks for help me give me idea where is problem i'm will try it different from 
but when i finished will put it 

-- 
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/cd83bf95-92f9-4c88-990d-d0bc94479ecb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Good afternoon, I need help to generate a PDF of my models in DJANGO

2018-05-29 Thread ALDO JAVIER VIGUERAS
Hallo, I want to do a view to retur me a PDF with my models tah I have in 
models.py , I habe python 3 Django 2.11 and the models are in POSTGRESQL .
The next is my code that a I have, but gived TypeError: pruebapdf() missing 
1 required positional argument: 'DesdeJango'
'DesdeJango'= is  model name.

VIEW.PY


def pruebapdf(request,DesdeJango):
response=HttpResponse(content_type='application/pdf')
response['Content-Disposition']='attachment; filename=PDF_CON 
_MODELO.pdf'
buffer=BytesIO()
c=canvas.Canvas(response,pagesize=A4)
#Estilo
styles = getSampleStyleSheet()
styleBH=styles["Normal"]
styleBH.alignment = TA_CENTER
styleBH.fontSize=10
#parametros
folio=Paragraph('folio',styleBH)
nombre=Paragraph('nombre',styleBH)
sexo=Paragraph('sexo',styleBH)
edad=Paragraph('edad',styleBH)
gecha=Paragraph('gecha',styleBH)
formato=[]
formato.append(['folio','nombre','sexo','edad','gecha'])
#Estilo de la tabla
styleN=styles['BodyText']
styleN.alignment=TA_CENTER
styleN.fontSize=7
#ALTURA
high=650
#ModeloPrueba(request.POST,instance=mascota)

#ciclo for para poner la base de datos

for dato in DesdeJango.objects.all():
dato=[dato['folio'], 
dato['nombre'],dato['sexo'],dato['edad'],dato['gecha']]
formato.append(dato)
#ponemos el grosor del la fila
high=high-18

#AÑADIMOS DATOS DE PAGINACION
width, height=A4
table=Table(formato,colWidths=[1.9*cm,9.5*cm,1.9*cm,1.9*cm,1.9*cm])
table.setStyle(TableStyle([('INNERGRID',(0,0),(-1,-1),0.25, 
colors.black), ]))
table.wrapOn(c, width, height)
table.drawOn(c,30,high)
c.showPage()
c.save()
pdf=buffer.getvalue()

c.showPage()
c.save()
pdf = buffer.getvalue()
buffer.close()
response.write(pdf)


return response


URL.PY

path(r'html',pruebapdf , name='PDF'),


NOTE : AttributeError: 'WSGIRequest' object has no attribute 'objects'


I thank you in advance for your support




-- 
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/2a6ef8f4-5153-4845-87dc-0fbe92e66469%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Good practise on Form logic

2015-07-18 Thread Aldo Suarez
Say for example you have a Form with its validator methods. 
Then, in the view you normally do:

in forms.py,

if form.is_valid():
> # do some logic / add to database
> # redirect



Now: Is it good practise to do that "post-logic" inside Form methods or 
should I do it on the view? i.e.

in views.py,

def some_view(request):
> if request.method == 'POST':
> form = SomeForm(request.POST)
> if form.is_valid():
> form.some_logic(request.user)
> # redirect
> else:
> form = SomeForm()
> # render


in forms.py,

class SomeForm(forms.Form):
> def clean(self):
> # clean data
> def some_logic(self, user):
> # some logic w/ cleaned data

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cdb0ae37-7f46-42c0-b99c-f3a641bbad0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


problems accessing to media.djangoproject.com - perhaps from argentina ?

2010-07-04 Thread Aldo Nievas
Hi
anone else have had problem with media.djangoproject.com ?

/.virtualenvs/site.com/bin# ./easy_install django
Searching for django
Reading http://pypi.python.org/simple/django/
Reading http://www.djangoproject.com/
Best match: Django 1.2.1
Downloading http://media.djangoproject.com/releases/1.2/Django-1.2.1.tar.gz
error: Download error for
http://media.djangoproject.com/releases/1.2/Django-1.2.1.tar.gz: [Errno 60]
Operation timed out
(site.com)macbookpro~/.virtualenvs/site.com/bin#

I'm also having problems accessing to www.djangoproject.com

ISP: telecentro

Regards.
Aldo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error : Django with Apache and mod_python

2010-06-06 Thread Aldo Nievas
File "/usr/local/lib/python2.6/dist-packages/django/template/
loader.py", line 138, in find_template
   raise TemplateDoesNotExist(name)

TemplateDoesNotExist: 500.html


please help what  I can do ???



or TEMPLATE_DIRS has not been defined well.

How TEMPLATE_DIRS looks like ?


Regards
Aldo Nievas |  SATIO Software Solutions
aldo.nie...@satio.com.ar
www.satio.com.ar
MSN: aldo.nie...@gmail.com
SKYPE: aldo.nievas


On Sat, Jun 5, 2010 at 12:49 PM, Jagdeep Singh Malhi <
singh.malh...@gmail.com> wrote:

>
> MOD_PYTHON ERROR
>
> ProcessId:  3219
> Interpreter:'127.0.1.1'
>
> ServerName: '127.0.1.1'
> DocumentRoot:   '/var/www'
>
> URI:'/'
> Location:   '/'
> Directory:  None
> Filename:   '/var/www/'
> PathInfo:   ''
>
> Phase:  'PythonHandler'
> Handler:'django.core.handlers.modpython'
>
> Traceback (most recent call last):
>
>  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line
> 1537, in HandlerDispatch
>default=default_handler, arg=req, silent=hlist.silent)
>
>  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line
> 1229, in _process_target
>result = _execute_target(config, req, object, arg)
>
>  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line
> 1128, in _execute_target
>result = object(arg)
>
>  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> modpython.py", line 228, in handler
>return ModPythonHandler()(req)
>
>  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> modpython.py", line 201, in __call__
>response = self.get_response(request)
>
>  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> base.py", line 130, in get_response
>return self.handle_uncaught_exception(request, resolver,
> sys.exc_info())
>
>  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> base.py", line 181, in handle_uncaught_exception
>return callback(request, **param_dict)
>
>  File "/usr/local/lib/python2.6/dist-packages/django/views/
> defaults.py", line 23, in server_error
>t = loader.get_template(template_name) # You need to create a
> 500.html template.
>
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> loader.py", line 157, in get_template
>template, origin = find_template(template_name)
>
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> loader.py", line 138, in find_template
>raise TemplateDoesNotExist(name)
>
> TemplateDoesNotExist: 500.html
>
>
> please help what  I can do ???
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Simple Pagination Problem

2009-07-29 Thread Aldo

I want to display to my html page

Displaying results 1- 10 of 55322 found.

Is there something straight forward in the pagination to do this?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django with ajax

2009-06-02 Thread Aldo

Thanks Jorge,

Dajax looks very useful. Ill do it with Json though until Dajax
becomes mainstream. Thanks.

On Jun 2, 10:47 am, Jorge Bastida  wrote:
> Hello Marc,
>
> You can render a template into an string.
>
> from django.template.loader import render_to_string
> my_template = render_to_string('template.html',{'some':'data'})
>
> If you want to send the list of objects to the browser you can use
> serialization into 
> json:http://docs.djangoproject.com/en/dev/topics/serialization/#id2
>
> In other hand, i'm currently developing Dajax 
> (http://code.google.com/p/dajaxproject/) it will help you using ajax in
> django. For example, for sending serialized objects to the browser and use
> it as you want in JS.
>
> Thanks
>
> 2009/6/2 Aldo 
>
>
>
> > Hey,
>
> > I have some ajax running on my pages.
>
> > I want to have it pass back some objects. However, I am unsure if I
> > can pass a list of objects back. So far I have only ever passed back
> > raw xml or text. Can objects be passed and then iterated via the html
> > template?
>
> > Thanks
>
> --
> neo2001[at]gmail.com
> jorge[at]thecodefarm.com
> neo[at]art-xtreme.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django with ajax

2009-06-02 Thread Aldo

Hey,

I have some ajax running on my pages.

I want to have it pass back some objects. However, I am unsure if I
can pass a list of objects back. So far I have only ever passed back
raw xml or text. Can objects be passed and then iterated via the html
template?

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



quote_plus

2009-05-25 Thread Aldo

I want to use quote_plus in my django templates to display a url.

Can anyone tell me how I call it in my template?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Getting distinct objects (well attributes)

2009-05-20 Thread Aldo

Ill help myself and anyone else who stumbles across this -

The answer is:

Place.objects.values_list('county', flat=true).distinct()

On May 20, 2:52 pm, Aldo  wrote:
> Hi folks,
>
> The problem Im having is that I have a large number of objects.
> Objects are people (name, address, phone etc)
>
> I want to retrieve all the objects where name startswith "Mary"
> X = objects.filter(name__startswith="Mary").distinct()
>
> But, If there are 3 objects called "Mary Smith" I do not want X to
> have all 3. Just 1 name.
>
> Basically I want a list of the unique names.
>
> Please help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Getting distinct objects (well attributes)

2009-05-20 Thread Aldo

Hi folks,

The problem Im having is that I have a large number of objects.
Objects are people (name, address, phone etc)

I want to retrieve all the objects where name startswith "Mary"
X = objects.filter(name__startswith="Mary").distinct()

But, If there are 3 objects called "Mary Smith" I do not want X to
have all 3. Just 1 name.

Basically I want a list of the unique names.

Please help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



self unique symmetrical relation

2009-05-07 Thread Aldo

Hello,

I have a problem for a quite simple model.
I would like to model a person marriage relation.

example :

class Person(models.Model):
name=models.CharField(max_length=100)
married_to=models.OneToOneField('self',symmetrical=True) #
symmetrical not allowed
married_to=models.ForeignKey
('self',unique=True,symmetrical=True) # symmetrical not allowed
married_to=models.ManyToManyField
('self',unique=True,symmetrical=True) # unique not allowed

The relation I want has to be unique and symmetrical.
Someone can only be married to one other person (unique).
If Alice is married to Bob, then Bob is automatically married to Alice
(symmetrical).

How would you model this relation ?
Thanks.

Regards,
Aldo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Get/POST problem

2009-02-05 Thread Aldo

Thomas,

Thanks for that. I figured it out on my own. Just thought maybe there
was a standard way of doing it without usng a Redirect like that.
Suppose not

Thanks

On Feb 3, 11:14 am, Thomas Guettler  wrote:
> Hi,
>
> I would use the forms library, even if the form has only one input element.
> I would use django.http.HttpResponseRedirect() to the list view, after
> successful
> deletion.
>
> Aldo schrieb:
>
>
>
> > Hi folks,
>
> > MY URL is x.y.z/list
> > It shows a list of objects. They have link buttons to delete/update
> > for each object.
>
> > When I click delete for an object I go to a URL via POST with the
> > object id in the url
> > This brings me to a "Are you sure you want to delete this object
> > page".
> > MY URL is x.y.z/list/3
>
> > I click submit and it deletes the object and brings me back to the URL
> > page at the top /list.
>
> > My problem is my delete function :
>
> > def delete(request,  id):
> >     if request.method == 'POST':
> >         if verify(id):
> >                 MyObject.objects.get(pk=id).delete()
> >                 #Go back to the list
> >                 return render_to_response('html/list.html',
> > {'objects':MyObjects.objects.all())
> >         if request.method == 'GET':
> >             if verify(id):
> >                return render_to_response('html/delete.html',
> > {'token':token, 'id':id})
> >         return render_to_response('html/404.html')
>
> > Is there a neater way of doing this - rather than finding the request
> > type and behaving differently depending.
>
> > I am doing a similar thing for my update and it just seems off.
>
> > Please help.
>
> --
> Thomas Guettler,http://www.thomas-guettler.de/
> E-Mail: guettli (*) thomas-guettler + de
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django Get/POST problem

2009-02-03 Thread Aldo

Hi folks,

MY URL is x.y.z/list
It shows a list of objects. They have link buttons to delete/update
for each object.

When I click delete for an object I go to a URL via POST with the
object id in the url
This brings me to a "Are you sure you want to delete this object
page".
MY URL is x.y.z/list/3

I click submit and it deletes the object and brings me back to the URL
page at the top /list.

My problem is my delete function :

def delete(request,  id):
if request.method == 'POST':
if verify(id):
MyObject.objects.get(pk=id).delete()
#Go back to the list
return render_to_response('html/list.html',
{'objects':MyObjects.objects.all())
if request.method == 'GET':
if verify(id):
   return render_to_response('html/delete.html',
{'token':token, 'id':id})
return render_to_response('html/404.html')

Is there a neater way of doing this - rather than finding the request
type and behaving differently depending.

I am doing a similar thing for my update and it just seems off.

Please help.







--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django date filter

2008-12-22 Thread Aldo

Hi folks,

Simple enough problem but cant find the functionality - if it exists.

this_week = datetime.date.today() - timedelta(7)
Cars.objects.filter(created_date>this_week)

I basically want to find all cars that were created in the last 7
days. I have seen there are things for the month and year
created_date__year = this_week.year
created_date__month = this_week.month
What i want is
created_date__week = this_week.week

Is there any simple way of doing this.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django + mail server

2008-12-16 Thread Aldo

Have a look at this also!

http://docs.djangoproject.com/en/dev/topics/email/

On Dec 15, 8:48 pm, Oliver Beattie  wrote:
> http://docs.djangoproject.com/en/dev/ref/settings/#email-host
>
> On Dec 15, 7:25 pm, prem1er  wrote:
>
> > Didn't know about this. Where do I set the EMAIL_HOST parameter?
>
> > On Dec 15, 1:35 pm, "Karen Tracey"  wrote:
>
> > > On Mon, Dec 15, 2008 at 1:01 PM, prem1er  
> > > wrote:
>
> > > > Hey everyone,
> > > >   I'm trying to create a registration page on my website using Django
> > > > forms.  I just realized that I needed to install a mail server in
> > > > order to send confirmation messages to my users through the forms.
> > > > What type of setup is everyone using for this?  i.e. Postfix + mutt.
> > > > Thanks in advance.
>
> > > Why do you have to install a mail server?  Can you not simply set
> > > EMAIL_HOST, etc. to point to an existing mail server that you have access 
> > > to
> > > and authority to send mail through?
>
> > >http://docs.djangoproject.com/en/dev/topics/email/
>
> > > Karen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Forms Date Format

2008-12-16 Thread Aldo

Thanks Karen,

Using a combination of  both the links you provided I sorted it.

I just needed to change my  form slightly
class MyForm(ModelForm):
  mydate = forms.DateTimeField(input_formats=['%d-%m-%Y'])
  class Meta:
  model = MyObject

Thanks again for pointing me the right direction.

On Dec 15, 6:24 pm, "Karen Tracey"  wrote:
> On Mon, Dec 15, 2008 at 10:55 AM, Aldo  wrote:
>
> > Still no good lars. Thanks though.
>
> http://docs.djangoproject.com/en/dev/ref/forms/fields/#datefield
>
> documents how to override the default valid date formats for input to a
> DateField.
>
> http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#overrid...
>
> describes how to override the default fields created by a ModelForm.  So I
> think you want to override the field in your ModelForm and specify a
> different list of valid date input formats.
>
> Karen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Forms Date Format

2008-12-15 Thread Aldo

Still no good lars. Thanks though.

On Dec 15, 3:44 pm, Lars Stavholm  wrote:
> Aldo wrote:
> > Yes I have tried that but still nothing - thats what lead me to
> > looking at this!
>
> Try with "USE_I18N = False" in settings.py.
> Some sort of known issue, I do believe there's
> a ticket somewhere confirming this.
> /L
>
> > On Dec 15, 3:28 pm, Lars Stavholm  wrote:
> >> Aldo wrote:
> >>> I am using django forms. I have created a model/form with 2 fields,
> >>> name and date.
> >>> Prior to saving the form i check if the form is_valid?
> >>> if form.is_valid():
> >>>     form.save()
> >>> My problem is it wants the date in the format - MM/DD/
> >>> Otherwise it will not see the form as valid - and not save.
> >>> How can i change this I want the date in the format DD/MM/
> >> Maybe setting DATE_FORMAT in settings.py could help.
>
> >>http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#date-...
>
> >> /Lars
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Forms Date Format

2008-12-15 Thread Aldo

Yes I have tried that but still nothing - thats what lead me to
looking at this!

On Dec 15, 3:28 pm, Lars Stavholm  wrote:
> Aldo wrote:
> > I am using django forms. I have created a model/form with 2 fields,
> > name and date.
>
> > Prior to saving the form i check if the form is_valid?
>
> > if form.is_valid():
> >     form.save()
>
> > My problem is it wants the date in the format - MM/DD/
> > Otherwise it will not see the form as valid - and not save.
>
> > How can i change this I want the date in the format DD/MM/
>
> Maybe setting DATE_FORMAT in settings.py could help.
>
> http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#date-...
>
> /Lars
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Forms Date Format

2008-12-15 Thread Aldo

Let me add, that my model contains this

mydate = models.DateTimeField().input_formats = ('%Y.%m.%d %H:%M:%S',)

But when i use the input_formats arg it allows my field to accept any
numeric data
eg: 2342342/42354235 is now accepted.

On Dec 15, 2:57 pm, Aldo  wrote:
> I am using django forms. I have created a model/form with 2 fields,
> name and date.
>
> Prior to saving the form i check if the form is_valid?
>
> if form.is_valid():
>     form.save()
>
> My problem is it wants the date in the format - MM/DD/
> Otherwise it will not see the form as valid - and not save.
>
> How can i change this I want the date in the format DD/MM/
>
> Please help
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django Forms Date Format

2008-12-15 Thread Aldo

I am using django forms. I have created a model/form with 2 fields,
name and date.

Prior to saving the form i check if the form is_valid?

if form.is_valid():
form.save()

My problem is it wants the date in the format - MM/DD/
Otherwise it will not see the form as valid - and not save.

How can i change this I want the date in the format DD/MM/

Please help
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



one to one symmetric relationship

2008-07-08 Thread Aldo

Hello,

Thanks for your answer Malcom.
My mistake was to suppose that one to one relationships were
symmetric.

Do you have an idea on how to design a symmetric one to one
relationship ?
I tried with ForeignKey(unique=True) but it is not symmetric.
I even tried ManyToManyField(unique=True), which is symmetric but not
really unique in an object point of view.
It is unique in a DB point of view.
We can add (A,B) and (C,A) tuples in the m2m table, which creates
multiple relationships A-B and A-C.

Is it possible with existing fields ?

Regards,
Aldo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



OneToOneField('self') problem

2008-07-03 Thread Aldo

Hello,

I have successfully used OneToOne relationships for inheritance, this
is pretty well documented on the official doc and the result on admin
site is very elegant.
But I cannot use OneToOne field on another simple case : the marriage
case.
The goal is to link 2 objects of the same type together, for example 2
persons which are married.
I tried this very simple model :

class Person(models.Model):
name = models.CharField(max_length=100)
married_to = models.OneToOneField('self', blank = True, null =
True)
def __unicode__(self):
return self.name
class Admin:
pass

I have several problems on the admin site with this model :
-I cannot change 'married_to' field after object creation.
-The OneToOne relationships is not symmetrical as it should be. When I
create Paul married_to Laura, Laura is not automatically married_to
Paul.

I am using today 0.97 trunk SVN version.

Can anybody help me with this model or propose another one ?
Thanks !

Ciao.

Aldo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



CSS retrieval

2008-06-19 Thread Aldo Bergamini

Dear list,

I have a question that I could not solve by 'list archival peeking'.  
Although I got a couple of messages hinting at the same problem I  
have, I did not find one pointing to the solution.

It's about Firefox and it's access to the basic css files for Django.  
If I a access my Django application on my local development machine  
both Safari and Firefox apply the css files to the view templates.

So I get the nice Django color scheme, from the login to my  
application 'views'. So far so good.

As I am creating a somewhat complex tool that accesses data on  
databases that are hosted on the private lan, while I can have a few  
sample data sets on my laptop, I need to have a still non production  
setup accessing some more Postgres databases; this setup is such that  
can be accessed through an Apache reverse proxy setup, actually still  
pointing to a simple Django debug server; I use this a second test  
environment.

I have setup the related Apache reverse proxying; the point that  
puzzles me is that on Safari (MacOSX) I get the HTML pages along with  
their CSS files, whereas Firefox,  afaik still on MacOSX, does not  
display the 'graphic' CSS attributes of the page elements.

The same setup on the localhost config on my laptop (directly talking  
to the Django server with no proxying) works well on both browsers.

I had even some accesses from Windows with XP on the external server:  
CSS files are passed along from the Django server to the browser via  
Apache.

So what is wrong with the Apache proxying setup, so that apparently  
only FireFox has problems getting CSS files?

BTW: in the messages I found in the archives there were hints about  
the trace that the HTTP request causes on the console, when getting  
(or failing to get) a CSS file. Neither on the localhost setup or on  
the Apache server do I ever see a request for a CSS file (whatever  
browser I am using to do my little tests).

Thanks for any pointer to an explanation/solution.

Best regards,
Aldo


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django.cgi on Linux Hosting

2008-04-15 Thread Aldo

Thanks for your help on this Karen,

Its apache returning the 404. So as i suspected the rewrite rules are
not working for some reason. Yes admin is in the urls.
Sure the rewrite rules - rewrites www.musicischarity.com to
www.musicischarity.com/home so it really should be working off the
bat.

Initially i got in touch with my hosting provider to confirm the
rewrite rules were working - which they confirmed. Ive just sent an
email again.



On Apr 14, 3:21 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Mon, Apr 14, 2008 at 3:41 AM, Aldo <[EMAIL PROTECTED]> wrote:
> > Yes, so thats fair enough - it just means that maybe MAYBE the dj
> > script is being called - but when i access it viawww.gfdfdf.com/admin/
> > it gives me a 404
>
> (You've switched 
> fromhttp://www.musicischarity.comtowww.gfdfdf.com<http://www.gfdfdf.com/admin/>
> ?)
>
> So the next step is to figure out if the 404 is coming from Apache or
> Django.  Do you have the admin urls configured for your Django app?  If not,
> then it's expected you'd get a 404 trying to access that url -- I just used
> it as an example of one that might work since I have no idea what your own
> application urls are.
>
> Some ways to determine if the 404 is coming from Apache or Django:
> 1 - appearance -- does it look like the standard Apache "not found" or your
> own 404.html template?
> 2 - turn on DEBUG=True in your settings file and you will see the Django
> debug "page not found" page that includes all the urlpatterns and how the
> one it was handed didn't match any of them, if you are getting to Django
> 3 - the Apache error log will have "File not found" errors listed for
> something ending in "admin" if it is Apache returning the 404, but not if it
> is Django.
> 4 - How long does it take for the 404 to be returned?  Quick means it's
> probably coming from Apache, slow means probably your script is running and
> it's your app/Django that is ultimately returning the 404.  (This config is
> a VERY slow way of running Django, and I'm not sure you will find
> performance acceptable even if/when you get it to work.)
>
> If it is Apache returning the 404 then somehow your rewrite rules are not
> kicking in.  What you list below rewrites everything ending in a slash (you
> did include the trailing slash on the attempt to access admin?) except for
> those that start with cgi-bin or media, plus it rewrites an empty url to a
> Django url of 'home/' (so you'd need a urlpattern for 'home/' in your Django
> config).
>
> If it is Django returning the 404 than the urlpattern configuration is not
> handling the incoming urls as you expect, and you need to fix them.
>
> Karen
>
> > On Apr 11, 4:28 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > On Fri, Apr 11, 2008 at 9:28 AM, Aldo <[EMAIL PROTECTED]> wrote:
>
> > > > Fair point.
>
> > > > My problem is - Initially i created my index.html in the root(DOCUMENT
> > > > ROOT).
> > > > Now I have downloaded Django as described - put it in my root.
> > > > I have created my .htaccess files as
> > > > RewriteEngine on
> > > > RewriteRule ^cgi-bin/ - [L]
> > > > RewriteRule ^media/ - [L]
> > > > RewriteRule ^(.*)(/)$ cgi-bin/dj/$1/
> > > > RewriteRule ^$ cgi-bin/dj/home/
> > > > Ive created the cgi-bin/dj file and gave permissions.
> > > > However when i try to access that file(http://www.musicischarity.com/
> > > > cgi-bin/dj <http://www.musicischarity.com/cgi-bin/dj>) it gives me an
> > > > error -  Error 500: Internal Server Error
>
> > > You are not supposed to access the script directly like this.  Rather
> > you
> > > are supposed to use your application's normal urls (e.g.
> >http://www.muicscharity.com/admin/for, say, the Django admin app), and the
> > > RewriteRules convert that to an invocation of your dj script.
>
> > > > (Usually I would have content-type in it - but its not in the
> > > > examples. tried it and still no good.)
> > > > The dj file was edited to contain my own details. paths etc. maybe i
> > > > have them wrong.
> > > > sys.path.append("/hsphere/local/home/musicisc/Django-0.96")
> > > > sys.path.append("/hsphere/local/home/musicisc")
> > > > and
> > > > # Change this to the directory above your site code.
> > > > sys.path.append("/hsphere/local/home/musicisc/Django-0.96/")
> > > > os.chdir("/hsphere/local/home/musici

Re: Django.cgi on Linux Hosting

2008-04-14 Thread Aldo

Yes, so thats fair enough - it just means that maybe MAYBE the dj
script is being called - but when i access it via www.gfdfdf.com/admin/
it gives me a 404

On Apr 11, 4:28 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 11, 2008 at 9:28 AM, Aldo <[EMAIL PROTECTED]> wrote:
>
> > Fair point.
>
> > My problem is - Initially i created my index.html in the root(DOCUMENT
> > ROOT).
> > Now I have downloaded Django as described - put it in my root.
> > I have created my .htaccess files as
> > RewriteEngine on
> > RewriteRule ^cgi-bin/ - [L]
> > RewriteRule ^media/ - [L]
> > RewriteRule ^(.*)(/)$ cgi-bin/dj/$1/
> > RewriteRule ^$ cgi-bin/dj/home/
> > Ive created the cgi-bin/dj file and gave permissions.
> > However when i try to access that file(http://www.musicischarity.com/
> > cgi-bin/dj <http://www.musicischarity.com/cgi-bin/dj>) it gives me an
> > error -  Error 500: Internal Server Error
>
> You are not supposed to access the script directly like this.  Rather you
> are supposed to use your application's normal urls 
> (e.g.http://www.muicscharity.com/admin/for, say, the Django admin app), and 
> the
> RewriteRules convert that to an invocation of your dj script.
>
>
>
>
>
> > (Usually I would have content-type in it - but its not in the
> > examples. tried it and still no good.)
> > The dj file was edited to contain my own details. paths etc. maybe i
> > have them wrong.
> > sys.path.append("/hsphere/local/home/musicisc/Django-0.96")
> > sys.path.append("/hsphere/local/home/musicisc")
> > and
> > # Change this to the directory above your site code.
> > sys.path.append("/hsphere/local/home/musicisc/Django-0.96/")
> > os.chdir("/hsphere/local/home/musicisc/Django-0.96/")
> > # Change mysite to the name of your site package
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'musicischarity.settings'
> > run_with_cgi(django.core.handlers.wsgi.WSGIHandler())
>
> > I am not sure anyone will be able to help - but my alternative is to
> > give up - ive been working on this for hours.
>
> CGI is not at all a recommended way to run Django (see the discussion 
> inhttp://code.djangoproject.com/ticket/2407) but it seems it can be made to
> work after a fashion if it's your only option.
>
> Karen
>
>
>
> > On Apr 11, 1:23 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > On Fri, Apr 11, 2008 at 6:48 AM, Aldo <[EMAIL PROTECTED]> wrote:
>
> > > > Hi folks I have a linux hosting account with digiweb. I want to run my
> > > > django app on it - but am running into problems.
>
> > > >http://care.register365.com/index.php?_m=knowledgebase&_a=viewarticle.
> > ..
>
> > > >http://seamusc.com/blog/2007/jun/11/how-get-django-working-digiwebie-.
> > ..
>
> > > > I am trying to follow examples such as below but to no avail. Could
> > > > anyone be able to help me out? or give me pointers?
>
> > > You provide links to two sites with detailed instructions on how to do
> > what
> > > you are interested in, but no details on what trouble you have run into
> > > trying to follow those instructions.  It's rather hard to provide any
> > > guidance with no clues as to what isn't working.
>
> > > Karen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django.cgi on Linux Hosting

2008-04-11 Thread Aldo

Fair point.

My problem is - Initially i created my index.html in the root(DOCUMENT
ROOT).
Now I have downloaded Django as described - put it in my root.
I have created my .htaccess files as
RewriteEngine on
RewriteRule ^cgi-bin/ - [L]
RewriteRule ^media/ - [L]
RewriteRule ^(.*)(/)$ cgi-bin/dj/$1/
RewriteRule ^$ cgi-bin/dj/home/
Ive created the cgi-bin/dj file and gave permissions.
However when i try to access that file(http://www.musicischarity.com/
cgi-bin/dj) it gives me an error -  Error 500: Internal Server Error
(Usually I would have content-type in it - but its not in the
examples. tried it and still no good.)
The dj file was edited to contain my own details. paths etc. maybe i
have them wrong.
sys.path.append("/hsphere/local/home/musicisc/Django-0.96")
sys.path.append("/hsphere/local/home/musicisc")
and
# Change this to the directory above your site code.
sys.path.append("/hsphere/local/home/musicisc/Django-0.96/")
os.chdir("/hsphere/local/home/musicisc/Django-0.96/")
# Change mysite to the name of your site package
os.environ['DJANGO_SETTINGS_MODULE'] = 'musicischarity.settings'
run_with_cgi(django.core.handlers.wsgi.WSGIHandler())

I am not sure anyone will be able to help - but my alternative is to
give up - ive been working on this for hours.

On Apr 11, 1:23 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 11, 2008 at 6:48 AM, Aldo <[EMAIL PROTECTED]> wrote:
>
> > Hi folks I have a linux hosting account with digiweb. I want to run my
> > django app on it - but am running into problems.
>
> >http://care.register365.com/index.php?_m=knowledgebase&_a=viewarticle...
>
> >http://seamusc.com/blog/2007/jun/11/how-get-django-working-digiwebie-...
>
> > I am trying to follow examples such as below but to no avail. Could
> > anyone be able to help me out? or give me pointers?
>
> You provide links to two sites with detailed instructions on how to do what
> you are interested in, but no details on what trouble you have run into
> trying to follow those instructions.  It's rather hard to provide any
> guidance with no clues as to what isn't working.
>
> Karen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django.cgi on Linux Hosting

2008-04-11 Thread Aldo

Hi folks I have a linux hosting account with digiweb. I want to run my
django app on it - but am running into problems.

http://care.register365.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=110&nav=0,21
http://seamusc.com/blog/2007/jun/11/how-get-django-working-digiwebie-using-djangocgi/

I am trying to follow examples such as below but to no avail. Could
anyone be able to help me out? or give me pointers?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Reporting with Django

2008-02-14 Thread Aldo

Interested in generating some simple reports with Django.

I have a number of text and dateFields and need some sample DB
reports. I could do it myself by designing a page to give me counts -
but would prefer if there was a sweeter way to do it in django.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---