How to send email from django without authenticate smtp server

2024-03-04 Thread Praveen Chaudhary
Hello everyone,

Basically, I want to send the email from django using smtp server. I have
my own smtp server domain host at port 25, but don't want to pass
EMAIL_HOST_USER & EMAIL_HOST_PASSWORD. I am using EmailMultiAlernatives to
send the html and file, I am unable to send email without EMAIL_HOST_USER &
EMAIL_HOST_PASSWORD

Thank you for your help.

*Prabin Chaudhary*

Software Engineer

Mobile: +977-9840193890 | prabinchy1...@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/CAN9B8Z08UcPUVgcz19GNXc%2BcYeSQTEraYvGT2xrMNo_%3DmBX2_g%40mail.gmail.com.


Apscheduler is not running multiple jobs

2024-02-25 Thread Praveen Chaudhary
Hello, everyone

I am using an apscheduler to schedule my job in a django project. here is
code

def start():
"""
The `start` function creates a report using a scheduler to generate and
send reports based on
specified sources and schedules.
"""
logger.info(f" Started creating report")

executors = {
'default': ThreadPoolExecutor(1)
}

scheduler = BackgroundScheduler(executors=executors, daemon=True)

sources, idx_list, job_schedules, triggers = generate_report()

for source, idx, job_schedule, trigger in zip(sources, idx_list,
job_schedules, triggers):
job_id = f"daily_report_job_{source.name}_{job_schedule.pk}_{idx}"
logger.info(f" Adding job with ID: {job_id}")

try:
scheduler.add_job(
generate_and_send_report_by_source_name,
trigger=trigger,
id=job_id,
args=[source],
replace_existing=True,

)
except Exception as e:
logger.error(f" Failed to add job with ID {job_id}: {e}")

try:
if scheduler.state == 0:
scheduler.start()
except Exception as e:
logger.error(f" Scheduler failed to start: {e}")


def generate_report():
"""
The `generate_report` function retrieves active sources, iterates through
their job schedules,
creates triggers based on the schedule, and returns the sources, job
schedules, and triggers.
:return: The `generate_report` function returns four values: `sources`,
`idx_list`, `job_schedules`,
and `triggers`.
"""
sources = get_active_sources()
job_schedules = []
triggers = []

if not sources:
logger.error(" Failed to generate report. No active sources found.")
return [], [], []

idx_list = []
for idx, source in enumerate(sources, start=1):
source_job_schedules = source.job_schedule.all()

for job_schedule in source_job_schedules:
if job_schedule.day_of_week is not None:
trigger = CronTrigger(
day_of_week=job_schedule.day_of_week,
hour=job_schedule.hour,
minute=job_schedule.minute
)
else:
trigger = CronTrigger(
hour=job_schedule.hour,
minute=job_schedule.minute
)
triggers.append(trigger)
idx_list.append(idx)
job_schedules.append(job_schedule)

return sources, idx_list, job_schedules, triggers


here is the models.py
class JobSchedule(TimeStamp):
name = models.CharField(max_length=255)
day_of_week = models.IntegerField(choices=DAY_CHOICES, null=True, blank=True
)
hour = models.CharField(max_length=10, null=True, blank=True)
minute = models.CharField(max_length=10, null=True, blank=True)

class Meta:
verbose_name = "Job Schedule"
verbose_name_plural = "Job Schedules"

def __str__(self) -> str:
return f"{self.name}"


class Source(TimeStamp):
name = models.CharField(max_length=255, unique=True)
source_type = models.CharField(max_length=100, choices=SOURCE_TYPE, default=
"View")
query = models.TextField()
destinations = models.ManyToManyField(Destination, related_name=
"destinations")
job_schedule = models.ManyToManyField(JobSchedule, related_name="schedule")
is_active = models.BooleanField(default=False)

class Meta:
verbose_name = 'Source'
verbose_name_plural = 'Sources'

def __str__(self) -> str:
return f"{self.name}"




*the problem is when i create one source with two different job schedule
instance, apscheduler is adding only one job*


*here is my my log message:*
apscheduler.schedulerAdded job "generate_and_send_report_by_source_name" to
job store "default"




*but it works if i create two source instances with two different job
schedule instances. *


*What are the mistakes I am making? I have tried many times to solve this
issue but did not recognize what I am missing.*


*Prabin Chaudhary*

Software Engineer

Mobile: +977-9840193890 | prabinchy1...@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/CAN9B8Z07qB7a336TRwju0uPzdXe7NeC%3DtYVvVStcCv3%3DjMpPzQ%40mail.gmail.com.


Re: Exciting Opportunity: Join Our Django WhatsApp Bulk Messaging Project!

2024-02-22 Thread praveen raj
Interested. Please include me.



On Sun, 18 Feb, 2024, 10:18 pm SURAJ TIWARI,  wrote:

>  Join Our Django WhatsApp Bulk Messaging Project!
>
>  Hello everyone,
>
> Are you looking for an exciting opportunity to gain hands-on experience in
> Django development? Do you want to work on a meaningful project that
> leverages WhatsApp for bulk messaging? We're thrilled to invite you to join
> our dynamic team!
>
>  Benefits:
>
>- Get hands-on experience working on a real-world Django project.
>- Learn how to leverage WhatsApp for bulk messaging, a valuable skill
>in today's digital landscape.
>- Opportunities for hybrid work, allowing flexibility in your schedule.
>- Collaborate with experienced developers and gain valuable mentorship.
>- Access to cutting-edge tools and technologies.
>
>  Opportunities Available:
>
>- Django developers
>- Frontend developers
>- UI/UX designers
>- Quality assurance testers
>
> 欄 How to Join: Simply reply to this message expressing your interest,
> and we'll provide you with all the necessary details to get started on our
> project.
>
> Let's work together to create something amazing and gain valuable
> experience along the way! ✨
>
> Best regards,
>
> Suraj Tiwari
>
>
> --
> 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/e8a705fd-10d9-4c1a-b4ba-0a7b896dbfean%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/CABn%2BeM1d4uJRdmG96_GBx_3AK21GpkKaDoZVPPanBC%2BmBZ44vA%40mail.gmail.com.


Re: Exciting Opportunity: Join Our Django WhatsApp Bulk Messaging Project!

2024-02-19 Thread Praveen Thakur
I,m interested. Can you provide more details?

On Mon, 19 Feb 2024, 05:35 Suchak Niraula,  wrote:

> Interested. Can you send the details?
>
> On Sun, Feb 18, 2024, 22:33 SURAJ TIWARI  wrote:
>
>>  Join Our Django WhatsApp Bulk Messaging Project!
>>
>>  Hello everyone,
>>
>> Are you looking for an exciting opportunity to gain hands-on experience
>> in Django development? Do you want to work on a meaningful project that
>> leverages WhatsApp for bulk messaging? We're thrilled to invite you to join
>> our dynamic team!
>>
>>  Benefits:
>>
>>- Get hands-on experience working on a real-world Django project.
>>- Learn how to leverage WhatsApp for bulk messaging, a valuable skill
>>in today's digital landscape.
>>- Opportunities for hybrid work, allowing flexibility in your
>>schedule.
>>- Collaborate with experienced developers and gain valuable
>>mentorship.
>>- Access to cutting-edge tools and technologies.
>>
>>  Opportunities Available:
>>
>>- Django developers
>>- Frontend developers
>>- UI/UX designers
>>- Quality assurance testers
>>
>> 欄 How to Join: Simply reply to this message expressing your interest,
>> and we'll provide you with all the necessary details to get started on our
>> project.
>>
>> Let's work together to create something amazing and gain valuable
>> experience along the way! ✨
>>
>> Best regards,
>>
>> Suraj Tiwari
>>
>>
>> --
>> 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/e8a705fd-10d9-4c1a-b4ba-0a7b896dbfean%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/CA%2BcAA3MiOtiy9X0GZJY0Pg6NzpFgEX8hF%3DfzH0P%3Dhe2uOOMF7w%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/CAOFN2fakGjnvMHR7JPLDxiLwN4dPtJMNOF-5VS2A16HubxkooA%40mail.gmail.com.


Re: Project together

2023-12-07 Thread praveen raj
Im interested

On Thu, 23 Nov, 2023, 11:43 pm Youssef Bachraoui, <
bachraouiyouss...@gmail.com> wrote:

> Hi developer i search to make a group on WhatsApp to begin a project
> together anyone interested about that?
>
> --
> 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/d5244e76-6bd3-4bde-bf31-a72720bee1acn%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/CABn%2BeM2Ed9v4uSjFxF6%2BkF37_p7HoOVPL8w1n5%3DtHsaUPSfjoQ%40mail.gmail.com.


Re: Can any one help me with this question

2023-06-22 Thread Praveen Chaudhary
Hi Annadatha,

I'm glad to hear that upgrading to Oracle 21c worked for you. As for your
question about working without migrations in Django, it's certainly
possible but it's important to understand the implication and trade-offs.

Django migrations provide a way to manage and apply changes to your
database schema over time, allowing for version control and easy deployment
of database changes. They help maintain data integrity and make it easier
to collaborate with other developers.

However, if you prefer not to use migrations, you can disable them in
django by setting the 'MIGRATIIN_MODULES' setting to an empty dictionary in
your projects settings.py file:

 MIGRATION_MODULES = {}


By doing this, you'll essentially disable the migration framework, and
Django won't generate or apply migrations. Instead, you'll need to manually
manage your database schema changes, which can be more error-prone and less
convenient, especially in collaborative projects.

Keep in mind the following considerations if you decide to work without
migrations:

1. Database schema management: You'll need to manually create, modify, and
delete database tables, columns, and other schema elements as needed. This
requires careful coordination and communication between developers working
on the project.

2. Data integrity: Migrations help ensure data integrity during schema
changes by providing a way to define and execute data transformations.
Without migrations, you'll need to handle data migrations and
transformations manually, which can be challenging and error-prone.

3. Deployment and version control: Migrations provide a structured way to
apply schema changes to your database during deployment. Without
migrations, you'll need to find alternative approaches for managing
database changes in different environments and version controlling those
changes.

Ultimately, the decision to use or not use migrations depends on your
specific requirements, project complexity, and team collaboration. If
you're working on a small, personal project with a simple schema and
limited changes, managing the database schema manually might be feasible.
However, for larger projects or teams, migrations can provide significant
benefits in terms of maintainability, collaboration, and data integrity.

I hope this helps you make an informed decision. Let me know if you have
any further questions!

Best regards
Prabin Chaudhary
+977-9840193890
*https://www.linkedin.com/in/icedreamerpraveen/
<https://www.linkedin.com/in/icedreamerpraveen/>*
Software Engineer | Youth Innovation Lab

On Thu, 22 Jun 2023, 7:55 pm Annadatha Rao,  wrote:

> Hi  Prabin,
>
> Thank you, it worked when I upgraded db to 21c (oracle), thank you for
> your help. Small question, can I work without migrations, some have I hate
> migrations being a legacy programmer from (Cobol days). I value your
> opinion.
>
> Thank you,
> ANNADATHA.
>
> On Sun, Jun 18, 2023 at 9:19 PM Praveen Chaudhary 
> wrote:
>
>> Yes, Django migrations can work with Oracle 11.2 using the python-oracle
>> database driver. However, it's important to note that the python-oracle
>> package is not an official Oracle-provided driver. The official driver is
>> called cx_Oracle, which is widely used for connecting Django to Oracle
>> databases.
>>
>> Here's an example of how Django migrations can work with Oracle 11.2
>> using cx_Oracle:
>>
>> 1. Install the cx_Oracle package using pip:
>>  pip install cx_Oracle
>> 2.Update your Django project's settings.py file to include the Oracle
>> database configuration:
>>  DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.oracle',
>> 'NAME': 'your_database_name',
>> 'USER': 'your_username',
>> 'PASSWORD': 'your_password',
>> 'HOST': 'your_host',
>> 'PORT': 'your_port',
>> }
>> }
>>
>> Replace the 'your_database_name', 'your_username', 'your_password',
>> 'your_host', and 'your_port' with the appropriate values for your Oracle
>> database.
>> 3.Define your Django models in the models.py file.
>> 4.Generate and apply the migrations using Django's makemigrations and
>> migrate commands:
>>
>> These commands will generate the necessary SQL statements based on your
>> models and apply them to the Oracle database.
>>
>> Please note that the example assumes you have already set up Oracle 11.2
>> and have the necessary Oracle client software installed on your machine.
>>
>> It's also important to ensure that your version of Django is compatible
>> with Oracle 11.2. Refer to the Django documentation and the documentation
>> of the cx_Oracle package for any specific requirements or considerations
>> when working with Oracle databas

Re: Can any one help me with this question

2023-06-18 Thread Praveen Chaudhary
Yes, Django migrations can work with Oracle 11.2 using the python-oracle
database driver. However, it's important to note that the python-oracle
package is not an official Oracle-provided driver. The official driver is
called cx_Oracle, which is widely used for connecting Django to Oracle
databases.

Here's an example of how Django migrations can work with Oracle 11.2 using
cx_Oracle:

1. Install the cx_Oracle package using pip:
 pip install cx_Oracle
2.Update your Django project's settings.py file to include the Oracle
database configuration:
 DATABASES = {
'default': {
'ENGINE': 'django.db.backends.oracle',
'NAME': 'your_database_name',
'USER': 'your_username',
'PASSWORD': 'your_password',
'HOST': 'your_host',
'PORT': 'your_port',
}
}

Replace the 'your_database_name', 'your_username', 'your_password',
'your_host', and 'your_port' with the appropriate values for your Oracle
database.
3.Define your Django models in the models.py file.
4.Generate and apply the migrations using Django's makemigrations and
migrate commands:

These commands will generate the necessary SQL statements based on your
models and apply them to the Oracle database.

Please note that the example assumes you have already set up Oracle 11.2
and have the necessary Oracle client software installed on your machine.

It's also important to ensure that your version of Django is compatible
with Oracle 11.2. Refer to the Django documentation and the documentation
of the cx_Oracle package for any specific requirements or considerations
when working with Oracle databases.

Remember to replace 'your_database_name', 'your_username', 'your_password',
'your_host', and 'your_port' with the appropriate values for your Oracle
database configuration.

Prabin Chaudhary
+977-9840193890
*https://www.linkedin.com/in/icedreamerpraveen/
*
Software Engineer | Youth Innovation Lab


On Sun, 18 Jun 2023 at 21:15, Annadatha Rao  wrote:

> Dear All,
>
> Do DJANGO migrations work with Oracle 11.2 with python-oracle db driver,
> please show me an example if works.
>
> Thank you for your support,
> Annadatha.
>
> --
> 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/CAFtPNJw9wQgAo2jCFEs6undCf9FZ_oqww9kZWKLLaJAMGyoNaA%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/CAN9B8Z3itg0bvV8wzoNoAkJiF9FVZ%3DAP2Z2aLxRreYxVVki1_w%40mail.gmail.com.


Re: template css issue

2023-06-07 Thread Praveen Chaudhary
This is the original template and it's working locally.


Thank you!
Your E-mail has been received
Prabin Chaudhary
+977-9840193890
*https://www.linkedin.com/in/icedreamerpraveen/
<https://www.linkedin.com/in/icedreamerpraveen/>*
Software Engineer | Youth Innovation Lab


On Wed, 7 Jun 2023 at 12:23, Praveen Chaudhary 
wrote:

> Hello Everyone,
>
> Hope you are doing well. I want a small favor from you guys.
> Here I have attached two files. These files are the email template sent
> from the django project to the outlook. The template looks correct and the
> css is working fine when I send the email from local but the css is not
> working when I deploy it to the server. You can see the difference .
> Can anyone please tell me what i am missing or doing wrong.
>
> *Prabin Chaudhary*
>
> Software Engineer | Youth Innovation Lab
>
> Mobile: +977-9840193890 | prabinchy1...@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/CAN9B8Z03sEx_O%3DF4gFP94xDtQ_6-jY1Xr7PYNT8_kX2OBo6Gog%40mail.gmail.com.


Re: Help on Django + Plotly integration

2023-03-23 Thread Praveen Kumar
Hello Kasper,

I have followed following link to get portly chart:

https://hackmamba.io/blog/2022/03/quickly-create-interactive-charts-in-django/

But I'm not getting end result. Please find below the structure that I have 
made. Please let me know if I'm missing anything.

[image: Screenshot 2023-03-23 154859.png]

Kindly suggest.

Thanks & Regards,
Praveen
On Wednesday, 22 March 2023 at 20:38:55 UTC+5:30 Kasper Laudrup wrote:

> On 22/03/2023 15.29, Praveen Kumar wrote:
> > Hi Team,
> > 
> > I need help in implementing Plotly with Django for interactive 
> dashboards.
> > 
> > Please suggest.
> >
>
> Try following this:
>
> https://googlethatforyou.com?q=plotly%20django
>
> Kind regards,
>
> Kasper Laudrup
>

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


Help on Django + Plotly integration

2023-03-22 Thread Praveen Kumar
Hi Team,

I need help in implementing Plotly with Django for interactive dashboards.

Please suggest.

Thanks & Regards,
Praveen

-- 
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/f4a11d66-f269-4e02-b3fe-a056d4a972ecn%40googlegroups.com.


Uncaught TypeError: styled_default is not a function

2023-03-15 Thread praveen raj
Hi all,
i'm trying to django-react application with postgres db but its giving me 
the following error:
Uncaught TypeError: styled_default is not a function
at Popper.js:11:20
[image: Capture1.PNG]

here i'm using mui : 
[image: Capture2.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/8e9404ee-e223-43ee-99c9-f73e76a7055bn%40googlegroups.com.


Re:

2023-03-13 Thread Praveen Kumar
Please suggest the training material that I need to follow

On Monday, 13 March 2023 at 14:39:46 UTC+5:30 Mir Junaid wrote:

> I can help you connect me on linkedIn on below link:
>  https://www.linkedin.com/in/junaid-ahmad-mir-a7a7561b7/
>
> On Mon, 13 Mar 2023 at 13:55, Praveen Kumar  wrote:
>
>> Yes, I want login structure and a dashboard in hieratical structure to 
>> show the progress.
>>
>> On Fri, Mar 10, 2023 at 8:32 PM Mir Junaid  wrote:
>>
>>> what kind of dashboard 
>>> and for what purpose
>>>
>>>
>>> On Fri, 10 Mar 2023 at 11:20, Praveen Kumar  
>>> wrote:
>>>
>>>> Hello Team,
>>>>
>>>> Need help on creating one dashboard using Django. Please help me with 
>>>> it.
>>>>
>>>> Thanks ,
>>>> Praveen
>>>> 333286
>>>>
>>>> -- 
>>>> 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/CACdZTY8aAWA_zKQBY_M_yztot33i0rEX6E9arD4y6P-hFXKV9Q%40mail.gmail.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/CACdZTY8aAWA_zKQBY_M_yztot33i0rEX6E9arD4y6P-hFXKV9Q%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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAM%2BpT8yAnunx-%2BhyhOS%3D-Vj%3DCQjJtLmyXiguHFrMj229wpu1EQ%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/CAM%2BpT8yAnunx-%2BhyhOS%3D-Vj%3DCQjJtLmyXiguHFrMj229wpu1EQ%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>>
>>
>> -- 
>> Thanks & Regards,
>> Praveen
>>
>> -- 
>> 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/CACdZTY83OsfcAsB1rSpwym41rf6O9CMoTE%2B4bBbv04sg6_H%3Dvw%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/CACdZTY83OsfcAsB1rSpwym41rf6O9CMoTE%2B4bBbv04sg6_H%3Dvw%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/e746dcb2-9a5d-459e-8117-1a63d376332dn%40googlegroups.com.


Re:

2023-03-13 Thread Praveen Kumar
Yes, I want login structure and a dashboard in hieratical structure to show
the progress.

On Fri, Mar 10, 2023 at 8:32 PM Mir Junaid  wrote:

> what kind of dashboard
> and for what purpose
>
>
> On Fri, 10 Mar 2023 at 11:20, Praveen Kumar 
> wrote:
>
>> Hello Team,
>>
>> Need help on creating one dashboard using Django. Please help me with it.
>>
>> Thanks ,
>> Praveen
>> 333286
>>
>> --
>> 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/CACdZTY8aAWA_zKQBY_M_yztot33i0rEX6E9arD4y6P-hFXKV9Q%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CACdZTY8aAWA_zKQBY_M_yztot33i0rEX6E9arD4y6P-hFXKV9Q%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/CAM%2BpT8yAnunx-%2BhyhOS%3D-Vj%3DCQjJtLmyXiguHFrMj229wpu1EQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAM%2BpT8yAnunx-%2BhyhOS%3D-Vj%3DCQjJtLmyXiguHFrMj229wpu1EQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Thanks & Regards,
Praveen

-- 
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/CACdZTY83OsfcAsB1rSpwym41rf6O9CMoTE%2B4bBbv04sg6_H%3Dvw%40mail.gmail.com.


You do not have permission to perform this action

2023-03-10 Thread praveen raj
If I add a login required I get the error "You do not have permission to 
perform this action".
How do I solve this problem?
   @login_required
def resolve_all_projects(self,info,**kwargs):
qs = Projects.objects.all()
print(qs.query)
return qs

[image: Capture.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/97f7b4c6-56f4-4071-9c6c-67e42db3cd62n%40googlegroups.com.


[no subject]

2023-03-09 Thread Praveen Kumar
Hello Team,

Need help on creating one dashboard using Django. Please help me with it.

Thanks ,
Praveen
333286

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


Re: Python Django Training

2020-02-02 Thread Praveen Kumar
I'm interested

On Sat, Feb 1, 2020, 7:12 PM Srikanth K  wrote:

> Hi,
>
> I am from Hyderabad. I am Python Developer by Profession. I am eager take
> up any Python , Django Training (online Preferrable or Weekends). Members
> who require can contact me or share me  there idea.
>
> Regards,
> Srikanth.K
>
> --
> 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/CACPyz-gXb7wo9E0Uhs_pnxF9X52uA10__Fq1xt4trjXUaN3ehQ%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/CACdZTY_y%2BcOq%3Da2-N6E5YtfZfZ5XDcL9fxGPMXD3PVoA3Lo18A%40mail.gmail.com.


Re: Error while trying to connect latest Dango with MSSQL

2019-09-23 Thread Praveen Kumar
 truncate_name(self.db_table,
connection.ops.max_name_length())

  File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\__init__.py",
line 28, in __getattr__

return getattr(connections[DEFAULT_DB_ALIAS], item)

  File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\utils.py
<https://f1mobile.rediff.com/cgi-bin/prored.cgi?red=http://utils.py=0=0=0=ACUJeVUzXi0FPVRlAz5XMVE2XgVdbQR0WWwLZwQg=e98bb4fb2be23db0a24b1803569b6d39513ea8a1>",
line 201, in __getitem__

backend = load_backend(db['ENGINE'])

  File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\utils.py
<https://f1mobile.rediff.com/cgi-bin/prored.cgi?red=http://utils.py=0=0=0=ACUJeVUzXi0FPVRlAz5XMVE2XgVdbQR0WWwLZwQg=e98bb4fb2be23db0a24b1803569b6d39513ea8a1>",
line 125, in load_backend

) from e_user

django.core.exceptions.ImproperlyConfigured: 'django.db.backends.mssql'
isn't an available database backend.

Try using 'django.db.backends.XXX', where XXX is one of:

'mysql', 'oracle', 'postgresql', 'sqlite3'


On Wed, Sep 18, 2019, 10:59 AM 'Amitesh Sahay' via Django users <
django-users@googlegroups.com> wrote:

> What is the error message? If the subject line you are talking about, its
> very generic. please be specific.
>
> Regards,
> Amitesh
>
>
> On Wednesday, 18 September, 2019, 02:06:03 am IST, Praveen Kumar <
> kumar.pravee...@gmail.com> wrote:
>
>
> Hi All,
>
> Just I have updated the latest version of Dango. But now I'm getting error
> message. Please suggest me.
>
> --
> 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/cf2ca49b-738e-457e-9d13-8a2df09a3a8f%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/329456698.7041138.1568784512666%40mail.yahoo.com
> <https://groups.google.com/d/msgid/django-users/329456698.7041138.1568784512666%40mail.yahoo.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/CACdZTY-MiFOhz2Dvjp4a0CS_Vxq-n57_QNC61QqGv_T2yXgXtA%40mail.gmail.com.


Error while trying to connect latest Dango with MSSQL

2019-09-17 Thread Praveen Kumar
Hi All,

Just I have updated the latest version of Dango. But now I'm getting error 
message. Please suggest me.

-- 
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/cf2ca49b-738e-457e-9d13-8a2df09a3a8f%40googlegroups.com.


ms sql server connectivity to django

2019-01-06 Thread Praveen Kumar
Hi All,

Changed DATABASE code as under in setting.py in Django project. But not 
getting able to connect to MS SQL Server. Please suggest.

ATABASES = {
'default': {
'NAME': 'APJ_AIM_LITE',
'ENGINE': 'sqlserver_ado',
'HOST': 'DB_SERVER',
'USER': '',
'PASSWORD': '',
}
}

-- 
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/ee503251-d646-4585-b773-0b1fc5b11c66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Import Export on the website (not on admin page)

2018-11-08 Thread Praveen Kumar
Hi, I am looking to have an import and export button s on the user page
(not on admin page). I am aware that there is django-export-import which
can be used on the django admin page. Is there any other module/package or
can we just use django-import-export itself on the website /user view?

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


problem in pattern matching in urls.py and redirecting to another page after few secs

2018-11-02 Thread praveen bhuvi
Now my 1st problem is in views.py i have a function , now in that function 
when certain condition is met i have to redirect to another page after 10 
sec or 20 sec.
my 2nd problem is i dont know how to set (or) match the pattern in 
[application]/urls.py

-- 
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/54f8b7de-cbbd-4038-b0ab-d28bc29a8b84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django tables with check box and delete button

2018-10-16 Thread Praveen Kumar
Currently I have a listview and a bootstrap table that displays the number
of records. I had tried to use request.method POST, to get the list of
checked boxes and feed it back to the delete action. However I get an error
stating that 'POST is not allowed 405' and when I looked on the web,
somewhere it states that POST doesn't work with django listview.

So any examples on generating a table with checkboxes which gives ability
to delete multiple records using a delete button would be helpful!

On Tue 16 Oct, 2018, 1:35 PM Joel Mathew,  wrote:

> There's not much difference in doing this than what is standard practise.
> You just create the regular fields, loop over the ones creating multiple
> rows, assign unique name fields to each of them (you can use
> {{for.counter}} for this). You then capture the request with
> request.POST.getlist.
>
>
>
>
> On Tue, 16 Oct 2018 at 13:27, Praveen Kumar  wrote:
>
>> Hello,
>>
>> Is there any django standard ways of creating a table with check boxes
>> and let the user to select multiple rows using check box and the delete?
>>
>> Appreciate if anyone can help to provide an example to achieve this.
>>
>> 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/CAB0oX7_URdpMiwqxkGrQq5tJaxeP5bqSDOspUukfs7d4gO_Mow%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAB0oX7_URdpMiwqxkGrQq5tJaxeP5bqSDOspUukfs7d4gO_Mow%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__Y80aCy7FwKsoaGhgb88gr%3DvzWHnWHE4FELW%3DwBF3r%2BA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAA%3Diw__Y80aCy7FwKsoaGhgb88gr%3DvzWHnWHE4FELW%3DwBF3r%2BA%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/CAB0oX7_QF6FxsLmKc1t2uNMN_%3DmvuutAXSGoYNkd6Q1Ft%3DdFbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django tables with check box and delete button

2018-10-16 Thread Praveen Kumar
Hello,

Is there any django standard ways of creating a table with check boxes and
let the user to select multiple rows using check box and the delete?

Appreciate if anyone can help to provide an example to achieve this.

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


track on click

2013-12-20 Thread praveen pal
Dear All

 how can we keep track on click in Django?
  suppose i have a MOOC (massive open online course ) site in which user 
register for a course and 
  watch videos , attempt quiz and give answer of question i want to track 
these detail 

how  many time user watch particular video?
di user watch complete video or left it after click on start button ?
how many time time user attempt particular quiz?

is it possible?
Thanks in advance

-- 
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/48479684-e93a-44af-804b-3bc2c2133492%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django custom authentication

2013-10-24 Thread Praveen Madhavan
I checked for the session cookie...
It is getting created, could it be the django version ? I am using django 
1.5 and I found few django openid apps not working on 1.5 .

On Tuesday, 22 October 2013 20:44:16 UTC+5:30, Praveen Madhavan wrote:
>
> Tom 
>
> Thanks for the response, here is my view
>
> def home(request):
> if not request.user.is_authenticated():
> # I have written my own custom authenticate method that returns an 
> user object
> user=authenticate(request=request)
> if not user:
> return HttpResponseRedirect("/accounts")
> else:
> login(request,user)
> return HttpResponse("Logged in Successfully")
> else:
> return HttpResponse(request.user)
>
>
>
> On Tuesday, 22 October 2013 18:30:13 UTC+5:30, Tom Evans wrote:
>>
>> On Tue, Oct 22, 2013 at 12:53 PM, Praveen Madhavan 
>> <prave...@gmail.com> wrote: 
>> > Hello All, 
>> > 
>> >  I am trying custom authentication with django, I wrote a class and 
>> > filled it with the methods authenticate and get_user, I also added this 
>> > authentication to the AUTHENTICATION_BACKENDS in settings.py file. 
>> > 
>> > I have called my custom authenticate method and followed it up with 
>> > login in my view. 
>>
>> Show us this view. You should not be calling a "custom authenticate 
>> method", you should be using login() and authenticate() from 
>> django.contrib.auth. If you are not, then this explains why on 
>> subsequent views you are not logged in. 
>>
>> > 
>> > Everything seems to work fine, is_authenticated returns true for 
>> the 
>> > user after login, but the subsequent requests have request.user as 
>> > anonymous, unable to figure out the reason, require your help 
>>
>> The other cause of login failing is if your browser does not send the 
>> session cookie back to the server. This would happen if you have 
>> configured django to send cookies with a different host than the pages 
>> are served from. Use chrome inspector or firefox or any other tool you 
>> fancy to determine if this is the case. 
>>
>> The easiest way to see is to look at the session cookie sent with the 
>> pre-login page response, and the session cookie sent with the 
>> post-login page response, do they have different ids? 
>>
>> Cheers 
>>
>> Tom 
>>
>

-- 
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/b447397c-084f-4de1-b498-43b4557d41f6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-22 Thread Praveen Madhavan
Hi,
Can you please exlpain it further. I am facing the same issue. I have 
written a get_user() method in my customauthentication.py. My 
authentication is successful but the subsequent requests show up as 
anonymous user.

Thanks
Praveen.M


On Monday, 21 October 2013 16:28:12 UTC+5:30, HM wrote:
>
> Turns out: the auth backend that worked in 1.3 but not in 1.4+ was missing 
> a get_user()-method. I added it in and that was that.
>
>
> HM
>

-- 
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/6415f4cb-2319-4f64-955b-09be2094bf0a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django custom authentication

2013-10-22 Thread Praveen Madhavan
Tom 

Thanks for the response, here is my view

def home(request):
if not request.user.is_authenticated():
# I have written my own custom authenticate method that returns an 
user object
user=authenticate(request=request)
if not user:
return HttpResponseRedirect("/accounts")
else:
login(request,user)
return HttpResponse("Logged in Successfully")
else:
return HttpResponse(request.user)



On Tuesday, 22 October 2013 18:30:13 UTC+5:30, Tom Evans wrote:
>
> On Tue, Oct 22, 2013 at 12:53 PM, Praveen Madhavan 
> <prave...@gmail.com > wrote: 
> > Hello All, 
> > 
> >  I am trying custom authentication with django, I wrote a class and 
> > filled it with the methods authenticate and get_user, I also added this 
> > authentication to the AUTHENTICATION_BACKENDS in settings.py file. 
> > 
> > I have called my custom authenticate method and followed it up with 
> > login in my view. 
>
> Show us this view. You should not be calling a "custom authenticate 
> method", you should be using login() and authenticate() from 
> django.contrib.auth. If you are not, then this explains why on 
> subsequent views you are not logged in. 
>
> > 
> > Everything seems to work fine, is_authenticated returns true for the 
> > user after login, but the subsequent requests have request.user as 
> > anonymous, unable to figure out the reason, require your help 
>
> The other cause of login failing is if your browser does not send the 
> session cookie back to the server. This would happen if you have 
> configured django to send cookies with a different host than the pages 
> are served from. Use chrome inspector or firefox or any other tool you 
> fancy to determine if this is the case. 
>
> The easiest way to see is to look at the session cookie sent with the 
> pre-login page response, and the session cookie sent with the 
> post-login page response, do they have different ids? 
>
> Cheers 
>
> Tom 
>

-- 
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/935a040b-89eb-45cb-9b3e-2e460e64f87f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django custom authentication

2013-10-22 Thread Praveen Madhavan
Hello All,

 I am trying custom authentication with django, I wrote a class and 
filled it with the methods authenticate and get_user, I also added this 
authentication to the AUTHENTICATION_BACKENDS in settings.py file.

I have called my custom authenticate method and followed it up with 
login in my view.

Everything seems to work fine, is_authenticated returns true for the 
user after login, but the subsequent requests have request.user as 
anonymous, unable to figure out the reason, require your help


Thanks
Praveen.M

-- 
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/b2da7920-4154-4315-b4e7-957c869aa727%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Getting Started with Mac OS X

2012-02-28 Thread Praveen Rachabattuni
Hi,

I am using on Mac OS X Lion and its working pretty well.
Seems there is something wrong with your django installation, try 
reinstalling 

$ pip uninstall django
$ pip install django

Hope that helps.

Regards,
Praveen R

On Tuesday, 28 February 2012 06:06:21 UTC+5:30, JChlipala wrote:
>
> Hello, 
>
> I am a Django beginner, and am trying to get Django set up in Mac OS 
> X.  I am going through the tutorial, but getting stuck very early 
> (essentially at the beginning).  I have installed Python and Django. 
> The next instruction is to enter the command "django-admin.py 
> startproject mysite".  When I do this, I get the following error: 
>
> File "", line 1 
> django-admin.py startproject mysite 
> ^ 
>
> SyntaxError:  invalid syntax 
>
> Does anybody know why I am getting this error?  The tutorial has a 
> note for Mac OS X users explaining what to do if you get a "permission 
> denied" error, but that is obviously not what is happening to me. 
>
> Thank you for any help!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/39Bcwp2cUHgJ.
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: Hosting Alwaysdata: install dajax libraries

2012-01-30 Thread Praveen Krishna R
*You can always copy the source folder of the dajax or whatever app into
your project folder.*
*
*
On Mon, Jan 30, 2012 at 7:19 PM, ElDoge <eld...@gmail.com> wrote:

> Hi, I am a newbie of Django and I have to try a web application (not
> made by me, but founded in the web)  that manages the shifts rounds of
> the volunteers of my association.
>
> I installaed it into alwaysdata.com free hosting, but the web app need
> the dajax and dajaxice library. It is possible to install it in the
> free hosting? How?
>
> Thanks for you 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Determine gender from first name

2012-01-25 Thread Praveen Krishna R
*I don't know if there are any databases or webservices available for the
purpose. But how would you handle the exceptions ?! Like if it does not
exist in the db, and common names used across genders ?!*
*
*
On Wed, Jan 25, 2012 at 11:49 AM, Demetrio Girardi <
demetrio.gira...@gmail.com> wrote:

> This is not a django-specific question, but I couldn't find anything
> useful on the subject and have no better place to ask.
>
> Let's say I want to put "welcome {{user.first_name}}" on top of my
> template. In many languages, "welcome" has to be declined by gender. I
> have no use for the user's gender otherwise, so I don't want to ask
> for it in the registration process.
>
> How can I go about this? Is there a publicly available database of
> first names divided by language and gender? A public web-service that
> guesstimates the gender?
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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 admin date and time picker not working

2012-01-08 Thread Praveen Krishna R
*Please check If your media files are served properly, Check either 404
messages in the console, or take View Source option in browser and click on
the media links directly which should bring the js or css or whatever
otherwise it is not serving media files I guess.*
*
*

On Sat, Jan 7, 2012 at 6:57 AM, Santiago Ingold
<santiago.ing...@gmail.com>wrote:

> I'm following the 4 part tutorial at djangoproject.com.
>
> In the 2nd part of it (https://docs.djangoproject.com/en/1.3/intro/
> tutorial02/) im configuring the admin interface, it works fine, except
> for the fact that date and time javascript pickers does not appear.
>
> I've been following the tutorial step by step, so I can't imagine what
> i'm doing wrong.
>
> Also, the widget does not appear in admin/auth/user/1/ neither
>
> Any ideas? 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: particular permission

2012-01-08 Thread Praveen Krishna R
*You can add a Foreign Key in the model to django.contrib.auth.models.User,
 and then in the views or wherever you can filter based on the request.user
object.*
*something like -> SampleModel.objects.filter(user = request.user)
*
On Sat, Jan 7, 2012 at 9:46 PM, mirco fini <mirco.f...@gmail.com> wrote:

> hi!
>
> I would like to create a site where the user can read just database
> records written by him or by his group.
> Anybody knows how can I obtain that?
>
> thanks a lot
>
> Mirco
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

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

2012-01-07 Thread Praveen Krishna R
*I have not tried any of these social auth apps myself. Yet if you want
help with any of those packages which you tried, then you can can dump the
detail error log or whatever here and get some help. It could be some
version compatibility issues or similiar, for which there may exist some
fixes.*
*
*
On Sat, Jan 7, 2012 at 3:22 PM, coded kid <duffleboi...@gmail.com> wrote:

> Hi guys, please I need your help. I've been trying all my best for the
> past 4days in order to get django-socialauth working but still no
> success. No django social packages I haven't tried. I've downloaded up
> to 10 different social packages but none is working. Though out of
> those 10 some fail to install. I do get AttributeError: No object
> named 'clone' I using windows 7. I'm fed up with all this!! Can anyone
> share with me tips or links to a good package that will work fine?
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Cheap Django hosting?

2012-01-04 Thread Praveen Krishna R
*Did you say $2 per month for an EC2 instance ?!!
*
On Tue, Jan 3, 2012 at 7:04 PM, Timothy Makobu
<makobu.mwambir...@gmail.com>wrote:

> Hi,
>
> If you must have root (mybe Twisted is one of your dependancies? or you
> need all 65535 ports?) Amazon EC2 is a prudent choice. For example, I pay 1
> to 2 USD/m, and sometimes cents on my micro instance. They charge me for
> only what I use, and their free quotas are generous.
>
>
>
> On Tue, Jan 3, 2012 at 5:16 PM, Sid <sidmitra@gmail.com> wrote:
>
>> @alec
>>
>> If you want to go with a VPS, try http://www.lowendbox.com/
>>
>> Plenty of cheap throwaway machines, i find webfaction, new PAAS like
>> gondor, ep.io to be too restrictive. Nothing beats root access, and
>> cheaply too!
>>
>> -Sid
>> http://www.sidmitra.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/ckNJjXg2HsAJ.
>>
>> 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.
>>
>
>  --
> 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.
>



-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: How to integrate django forms with django.

2011-12-16 Thread Praveen Krishna R
*Integrating jQuery and jQuery UI have nothing to do with django, that
means you don't write anything in django to get it working. They will be
considered as static files, they will be included in your html templates as
usual. *
*
*
*If you know how to include jQuery and jQueryUI into an html file, then
there is no much difference integrating them into django templates. **May
be you would prefix something like {{ MEDIA_URL }} to the src or href or
whatever parameters.*
*
*
*And the form you would be rendering in your templates will look like
something like*
*{{ form.as_table }} *
*
*
*
*
On Sat, Dec 17, 2011 at 8:11 AM, Ganesh Kumar <bugcy...@gmail.com> wrote:

> Sorry typo How to integrate django forms with jquery
>
>
> Did I learn something today? If not, I wasted it.
>
>
>
> On Sat, Dec 17, 2011 at 10:39 AM, Ganesh Kumar <bugcy...@gmail.com> wrote:
> > Hi guys,
> >
> > I am beginner of django, I have created django from, How to add with
> > jquery and jqueryUI stuff, to my from , please guide me.
> >
> > -Ganesh.
> >
> > Did I learn something today? If not, I wasted it.
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: How to handle the URL

2011-10-16 Thread Praveen Krishna R
*You need SlugField or even check the AutoSlugField app.
*
On Sun, Oct 16, 2011 at 7:29 AM, Tsung-Hsien <jasoniem9...@gmail.com> wrote:

> I want to build a gallery which connects to different photo sets.
> I have been completed the gallery main page, however, I meet two
> problems:
> 1) Use title name of cover image as the URL of photo page, but if the
> name include blank, then The URL is not complete. For example: the
> cover image named summer days, however ,only shows summer on the URL.
>
> 2)How to build the dynamic URL connecting to each photo sets?
>
> the models as below:
>
> class Item(models.Model):
>name = models.CharField(max_length=250)
>description = models.TextField()
>
>class Meta:
>ordering = ["name"]
>
>def __unicode__(self):
>return self.name
>
>def get_cover_photo(self):
>if self.photo_set.all().count() > 0:
>return self.photo_set.all()[0].image
>else:
>return None
>
>
>
>
> class Photo(models.Model):
>item = models.ForeignKey(Item)
>title = models.CharField(max_length=100)
>image = models.ImageField(uplo
>
>
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Uploading and viewing images problem

2011-09-20 Thread Praveen Krishna R
*Have you done something like this in your project urls.py*
*
*
*
urlpatterns += patterns('',
*
(r'^site_media/(?P.*)$',
'django.views.static.serve',{'document_root': settings.MEDIA_ROOT}),
)
So that you can enable serving the media from the development server ?!
*my MEDIA_URL = '/site_media/'*

And html from the templates
* *


On Tue, Sep 20, 2011 at 7:43 AM, Rodney Topor <r.to...@gmail.com> wrote:

> I've written a small project to upload and view images using a recent
> development version of Django.  In settings.py, I've defined
> MEDIA_ROOT = join(PATH, 'media') # the full path to the media
> subdirectory of my project directory
> MEDIA_URL = '/media/'
> I've created subdirectories /media/images in my project directory.
> I've defined my model with an ImageField(upload_to='images'), defined
> a form with enctype="multipart/form-data/", etc.
> When I create a new object with a selected image, the image is
> correctly uploaded to /media/images/.  The HTML page intended to
> display the image correctly (?) uses the following HTML element:
>  width="100" />
> The development server displays a message of the form:
> [20/Sep/2011 14:35:04] "GET /media/images/foo.jpg HTTP/1.1" 404 2218
> I.e., the image is not found and the rendered page contains only a
> query where the image should be displayed.
> So the images are being uploaded correctly, the generated HTML
> contains  elements that refer to the correct locations of the
> images, but they are not being displayed.  The image and its
> containing directories are all world-readable.
> So can someone please explain what else I have to do to make this
> work?  Many thanks.
> Rodney
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Login based in url for user

2011-09-11 Thread Praveen Krishna R
*You can filter the objects based on user. Which means you can include a
ForeignKey to User model in your models, and save the logged in user while
saving the model. In the views, while displaying, you can filter based on
the logged-in user. So no other user get to see your objects
*
On Tue, Aug 30, 2011 at 11:57 PM, Carsten Jantzen <cars...@jantzens.net>wrote:

> Hej I am new and trying to make a login for mysite.
> I have written a basic login which validates against another site and
> is working fine atm.
>
> I would like to make the auth related to the url.
> So that user a with permission 1 can access www.test.dk/1/content but
> he is not allowed to access www.test.dk/2/content
> user 2 with permission 4 can access www.test.dk/4/content but he is
> not allowed to access www.test.dk/1/content
>
> It there a good way to solved this?
>
> Is it possible extend the or use the @login_required tag to this solution.
>
> Hope for some input so I can find a solution.
>
> Regards
> Carsten
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

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



tiny mce with file browser

2011-09-08 Thread Praveen Krishna R
*Hi,*
*
*
*I hope somebody have implemented a file browser with tinymce, *
*I would like to know what module you used to implement it. *
*I don't want to use Grappelli to get this feature.*
*comments ?
*

-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: time part of datetime not saved

2011-09-05 Thread Praveen Krishna R
*dump your code ?! *
*BTW, *
*You can set auto_now_add = true in the model, which will assign the current
datetime, while saving without any code at all.
*
On Mon, Sep 5, 2011 at 11:54 AM, het.oosten <het.oos...@gmail.com> wrote:

> I have a model start = models.DateTimeField()
>
> In my view I create a datetime:
> x = datetime.datetime(*(time.strptime(str(component.get('dtstamp')),'%Y
> %m%dT%H%M%SZ')[0:6])) .
>
> This return a valid datetime:
> >>> x
> datetime.datetime(2011, 9, 4, 8, 45, 32)
>
> The problem is that only the date part is saved in the database. The
> time is saved as zero's:
> >>> db.created
> datetime.datetime(2011, 9, 4, 0, 0)
>
> Do i need to convert the date before saving it into the database?
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

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

2011-08-24 Thread Praveen Krishna R
On Windows
Notepad++, django development server, sqlite3, south

On Ubuntu
Vim, MySQL, south, virtualenv


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: How to make an app independent on a specific site?

2011-08-24 Thread Praveen Krishna R
*Even if you write

from models import Publisher, Book, Author

its gonna work, inside the books application;
*
On Wed, Aug 24, 2011 at 7:09 AM, Jim <jianbao@gmail.com> wrote:

> Greetings, everyone.
>
> I am new to Django, and much of my knowledge comes from the Django book
> version 2 <http://www.djangobook.com/en/2.0/>. In the book, a site,
> mysite, is created for demo purposes. And an app, books, is also created for
> demo purposes. In the file, mysite/books/admin.py, there is a line like
> this:
>
>
> from mysite.books.models import Publisher, Author, Book
>
> It seems to me that this line makes the app dependent on the name of the
> site, which is mysite. There is a possibility that an app you have developed
> for a site might turn out to have generic use. So, I think it is a good idea
> to always keep an app independent on the site as much as possible.
>
> Here is the question. Is it possible that to store the site name into a
> variable, such as site_name, then construct a statement like the following?
>
> statement = 'from ' + site_name + '.books.models import Publisher' 
> exec(statement)
> # I am not sure if exec is a legitimate function. Here is just an example
>
>
>
>
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Jn_07ca2t6MJ.
> 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.
>



-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Help installing django-sentry

2011-08-22 Thread Praveen Krishna R
*(I have never used the package you mentioned. )
Do you think you have configured the urls ( /sentry in your case ) for the
django-sentry !?
*
On Sun, Aug 21, 2011 at 11:18 PM, tharshan muthulingam <tharsha...@gmail.com
> wrote:

> Hi,
> I have been having alot of trouble trying to install and run django-sentry.
> My project directory is ~/django_projects/Project
>
> Inside there i have the simple polls app from the tutorial, and I have
> installed sentry using pip. I have added it to the list of installed apps.
>
> When I go to the sentry directory I got this error:
> http://127.0.0.1:8000/sentry/
>
> ViewDoesNotExist at /sentry/Tried result in module polls.views. Error was:
> 'module' object has no attribute 'result'
>
> I honestly have no clue what that means, and I would really appreciate some
> help with fixing this.
>
> Thank you!!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/XAczs-79BVMJ.
> 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.
>



-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: How to create a sub-app directly

2011-08-21 Thread Praveen Krishna R
*Is there  a concept of sub-apps exist in Django !?*
*I knew some concepts like independant reusable apps.*
*You can easily handle the rest with your urls right ?! correct me?
*
On Sun, Aug 21, 2011 at 6:27 PM, Subhranath Chunder <subhran...@gmail.com>wrote:

> Extend the manage.py functionality, by adding your custom command.
> https://docs.djangoproject.com/en/dev/howto/custom-management-commands/
>
>
> On Sun, Aug 21, 2011 at 8:52 PM, Jim <jianbao@gmail.com> wrote:
>
>> Hello folks,
>>
>> Here is the story. I created a site, mysite, with this command django-admin
>> startproject mysite. Then, under the directory mysite/, I created an app
>> named apps with this command ./manage.py startapp apps. apps is meant to
>> hold all applications for mysite. Now, here comes the question:
>> *How do I create a sub-app under apps with manage.py directly?*
>>
>> I tried
>> ../manage.py startapp someapp
>> under apps/, but that created the someapp under mysite/ rather than under
>> apps/.
>>
>> I also tried
>> ./manage.py startapp apps/someapp
>> and
>> ./manage.py startapp apps.someapp
>> under mysite/, but neither worked.
>>
>> So, my current work-around is to create a sub-app under mysite/ first,
>> then move it into apps/ manually. But that seems dumb, and I suspect there
>> is a simpler way to do this.
>>
>> Thanks for reading this. Any help is certainly appreciated.
>>
>> Jim
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/QtvEmvU5QvMJ.
>> 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.
>>
>
>
>
> --
> Thanks,
> Subhranath Chunder.
> www.subhranath.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.
>



-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: spam in response to posting to this list

2011-08-10 Thread Praveen Krishna R
*+1
*
On Wed, Aug 10, 2011 at 7:32 PM, Kayode Odeyemi <drey...@gmail.com> wrote:

> I have been getting this too.
>
>
> On Wed, Aug 10, 2011 at 5:15 PM, Tom Evans <tevans...@googlemail.com>wrote:
>
>> On Wed, Aug 10, 2011 at 5:06 PM, Eric Hutchinson
>> <eric.hutchin...@burgopakusa.com> wrote:
>> > I responded to the thread about ordering tables, and got this as a
>> > response
>> >
>>
>> I reported the same thing a couple of days ago. Russell Keith-Magee is
>> aware of the issue (he gets them too), but it seems almost impossible
>> to track down a specific subscriber from the info in that email.
>>
>> Cheers
>>
>> Tom
>>
>> --
>> 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.
>>
>>
>
>
> --
> Odeyemi 'Kayode O.
> http://www.sinati.com. t: @charyorde
>
>
>  --
> 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.
>



-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: dull look after install on ubuntu

2011-08-10 Thread Praveen Krishna R
*please dump your *settings.py ?!

On Wed, Aug 10, 2011 at 5:53 AM, Peter Kovgan <peter.kov...@gmail.com>wrote:

> Thank you guys.
>
> I use development server of django(manage.py runserver).
>
> I created an app. from the official site of the django, this one of the
> first tutorial.
>
> I did it on windows installation.
>
> Then I came home, installed the same app on ubuntu.
>
> Now my conf is:
>
> > django 1.3
> > on python 2.7.1
> > ubuntu 11.04
> > looking through firefox 4
>
> and it stopped show "stattic content"
>
> HERE IS COLLECTSTATIC::
>
> peter@peter-big:~/work/django/projects/src/mysite$ python manage.py
> collectstatic
> Traceback (most recent call last):
>   File "manage.py", line 14, in 
> execute_manager(settings)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 438, in execute_manager
> utility.execute()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 379, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 261, in fetch_command
> klass = load_command_class(app_name, subcommand)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 68, in load_command_class
> return module.Command()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py",
> line 41, in __init__
> self.storage = get_storage_class(settings.STATICFILES_STORAGE)()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/storage.py",
> line 23, in __init__
> raise ImproperlyConfigured("You're using the staticfiles app "
> django.core.exceptions.ImproperlyConfigured: You're using the staticfiles
> app without having set the STATIC_ROOT setting.
>
> I tried to resolve it myself, but nothing has worked.
>
> I used answers to another threads, but probably my installation is somehow
> different.
>
> What exactly I specify in MEDIA_ROOT = ''" ?
>
> Thank you.
>
>
>
>
>
>
>
>
> On 10 August 2011 00:29, Gelonida N <gelon...@gmail.com> wrote:
>
>> On 08/09/2011 09:58 PM, Peter Kovgan wrote:
>> > django 1.3
>> > on python 2.7.1
>> > ubuntu 11.04
>> > looking through firefox 4
>> >
>> > Dull look, like all javascript has been removed
>> > On windows looks nice, but here all works, but no colors, no styles,
>> > nothing...
>> >
>> > What could it be?
>>
>>
>> Well you don't really give a lot of info, so my guess might be
>> completely wrong.
>>
>>
>> Do you use the django development server (  manage.py runserver) or do
>> you run with apache / some existing server?
>>
>> Did you run the command "manage.py collectstatic"?
>>
>>
>>
>> --
>> 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.
>>
>>
>  --
> 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.
>



-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Run an application periodically on django

2011-08-04 Thread Praveen Krishna R
*If you are on Linux machine, you can use cron jobs to schedule the jobs.*
*
*
*When I faced such a problem what I did was, I created a view to update my
site with a secret Url. I have scheduled a cron job to call this url. So
when the view gets called (with "curl" command I'm correct), the site gets
updated. **I can call this url from a browser also, anytime. **There should
be definitely  better methods of doing this, like importing django to make a
standalone app or something?! I haven't tried it yet!*
*
*
*
*
*On djcelery, I think you need to configure RabbitMQ or something to work
with!? correct me Kenneth, if I'm wrong. *

On Thu, Aug 4, 2011 at 8:12 AM, Mohamed Ghoneim <ghooo.gh...@gmail.com>wrote:

> Hey guys,
>
> I am new to djnago and I have heard a lot about its powerful capabilities,
> so I preferred it over other web frameworks.
>
> My problem is I have a webpage that its content should be updated
> automatically every 30 seconds as I build an app that gets data from another
> web page
> and parse it and then updates my webpage.
>
> My problem is how can I schedule this this app to run every 30 seconds? and
> can I do this on a hosting website?
> --
> Mohamed Sayed Ghoneim
>
>  --
> 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.
>



-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: User based objects

2011-07-08 Thread Praveen Krishna R
*Shawn, Once again **thank you very much for your help,
*
*here is my code, if anybody could make use of it (I have changed my actual
model/form names)! *
*
*
*
class SampleForm(forms.Form):
head = forms.CharField()
body = forms.CharField(widget = forms.Textarea)
def __init__(self, *args, **kwargs):
self.user = kwargs.pop("user")
super(SampleForm, self).__init__(*args, **kwargs)
self.fields['mychoicefield'] = forms.ModelChoiceField(queryset =
MySampleModel.objects.filter(user__username__iexact = self.user.username))

in the view I use
new_form = SampleForm(user = request.user)
**

*
On Fri, Jul 8, 2011 at 8:36 PM, Shawn Milochik <sh...@milochik.com> wrote:

> On Fri, Jul 8, 2011 at 10:28 AM, Praveen Krishna R
> <rpraveenkris...@gmail.com> wrote:
> > Thank you, Shawn, I didn't knew that! I'm trying on that way now!
> >
>
> You're welcome. The one 'gotcha' is that you're going to have to
> remove the user from the kwargs before you call the __init__ of the
> superclass. Otherwise you'll get an 'unexpected keyword argument'
> exception.
>
> Example:
>
>
>def __init__(self, *args, **kwargs):
>
>self.user = kwargs.pop('user')
>
>super(MyForm, self).__init__(*args, **kwargs)
>
>
> You can then use self.user in your form's functions for filtering --
> probably starting right in __init__ after the super() call to set
> self.fields['field_name'].choices to be whatever they should be.
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: User based objects

2011-07-08 Thread Praveen Krishna R
*Thank you, Shawn, I didn't knew that! I'm trying on that way now!
*
On Fri, Jul 8, 2011 at 6:52 PM, Shawn Milochik <sh...@milochik.com> wrote:

> You can certainly pass request.user to the form from your view.
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

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



User based objects

2011-07-08 Thread Praveen Krishna R
*Hi,
*
*
*
*This is one of my Model which has an owner, column - user.*
*
*
*
class MiscList(models.Model):
name = models.CharField(max_length= 30)
user = models.ForeignKey(User);
count = models.IntegerField()
createdate = models.DateTimeField(auto_now_add = True)
**
def __unicode__(self):
**
return self.name

*
*
In one of my forms I would like to have this list filtered by the currently
logged in user.
Anyone of you have solved a scenario like this.
Since this is not a view I am not able to pass request.user object to the
form, in any way, what is the
preferred way of doing this ?
*
*
*
-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Trying to keep upload filename from disappearing - with python 2.7.1/django 1.2.4

2011-06-12 Thread Praveen Krishna R
*Perhaps you should try validating the other fields with javascript/jQuery
?!, *
*If it is something like Required Field validations...
*
On Fri, Jun 10, 2011 at 6:37 PM, djangobeginner <henryversem...@yahoo.com>wrote:

> I'm new to django and python but I'm working on a new screen for a
> project I'm on. The screen is supposed to capture a bunch of text
> information as well as allow a user to browse and select a file on
> their local machine for uploading. I'm having a problem with the
> filename disappearing from the selected filename textbox, whenever I
> submit the screen to begin uploading the file and I have an error on
> the screen. If I have an error on the screen the screen is returned
> showng an error message, but without the original filename selected
> being displayed (empty filename textbox), which will force the user to
> reselect the file again. Has anyone had this problem before, and if so
> how do I prevent the filename from disappearing? I have tried making a
> copy of the request.FILES similar to the way I have done previously
> with a request.POST (request.POST.copy()) capturing the filename data
> when entering my view, but when I try to add it back to the
> request.FILES by doing this in my error logic branch:
>
> request.FILES['filename'] = filename
>
> I get an AttributeError exception "can't set attribute". So since this
> doesn't work what is the proper way 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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 solved tutorial for download??

2011-06-09 Thread Praveen Krishna R
I don't understand what you mean by "django tutorial solved"
There is a tutorial which gets you up and running with django, if you are a
beginner. and its here ! https://docs.*django*
project.com/en/dev/intro/tutorial01/<https://docs.djangoproject.com/en/dev/intro/tutorial01/>
*
*
On Wed, Jun 8, 2011 at 5:09 PM, Pardini Andres <unpar...@gmail.com> wrote:

> Hi guys,
>
> I am looking for django tutorial solved, for downloading
>
> If anyone has a link, please share it :)
>
> Cheers!!
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Preview for the new website..

2011-06-06 Thread Praveen Krishna R
*If you are a developer (with much less designing skills) and want to get up
and running with your site, **then I would suggest you to go and buy an html
template and integrate it with **django. I recommend themeforest.com (I'm
not affiliated with them anyways!). **Playing with html templates will make
you comfortable with html/css eventually.*

On Sun, Jun 5, 2011 at 9:52 AM, raj <nano.ri...@gmail.com> wrote:

> I'm a very beginner developer. I'm just wondering how you got the
> actual styling together? Did you bang all that out with photoshop/css/
> javascript or something? Cause I want to make a website, but I don't
> know if I should go ahead and learn this way, or if there is an easier
> way. Thank you.
> -Raj
>
> On Jun 4, 7:58 am, Shamail Tayyab <pleoma...@gmail.com> wrote:
> > Hi guys,
> >
> >From some time I've been working on thishttp://tunesdiary.com
> > which is now running live on Django.
> >
> > It was a cool learning experience with my first site in Django after I
> > came in from rails background and this group had been real supporting
> > to me (thanks for the support guys, this is one real active group).
> > Few things that I liked about Django are:
> >
> > * ORM/Signals - definitely makes your life so simple..
> > * Inbuilt support for authentication and its applicability..
> > * Middleware approach towards design..
> > * Powerful templating - especially the templatetags thing.
> > * And a lot more..
> >
> > I'ld like you to review my work and do tell me the goods and more
> > important, the bads..
> >
> > With best regards
> >
> > --
> > Shamail Tayyab
> >
> > P.S The site uses Facebook to login (as of now), I definitely has a
> > lot of plans to fix that, but being alone on this work is not
> > permitting time to get around to add standard login and some other
> > contexts like twitter/openID.
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Serving static file on Windows

2011-05-31 Thread Praveen Krishna R
*Pasting one of my earlier replies to the same question*
***
*
*Please check django official docs to find out how static files are served
on production and development server.

in the dev server include a similiar snippet into your projects
urls.py, urlpatterns:

(r'^site_media/(?P.*)$', 'django.views.static.serve',{'document_root':
'D:/djangoprojects/praveensprofile/templates/static'}),

and in the templates something similar to the below text.


*
On Mon, May 30, 2011 at 1:57 PM, Alagu Madhu <alma...@gmail.com> wrote:

> urls.py
>
> from django.conf.urls.defaults import patterns, include, url
>
>
> urlpatterns = patterns('',
>(r'^$', 'hydra.views.index'),
>)
>
>
>
>
>
>
> On May 30, 12:28 pm, Praveen Krishna R <rpraveenkris...@gmail.com>
> wrote:
> > *could you dump your urls.py ?
> > *
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Mon, May 30, 2011 at 12:19 PM, Alagu Madhu <alma...@gmail.com> wrote:
> > > Hi,
> >
> > > sample/
> > > static/
> > >js/jquery.1.6.1.min.js
> > > css/
> >
> > > settings.py
> >
> > > APP_DIR = os.path.abspath(os.path.dirname(__file__))
> > > STATIC_ROOT = os.path.join(APP_DIR, 'static/')
> > > STATIC_URL = '/static/'
> > > INSTALLED_APPS = (
> > >'django.contrib.auth',
> > >'django.contrib.contenttypes',
> > >'django.contrib.sessions',
> > >'django.contrib.sites',
> > >'django.contrib.messages',
> > >'django.contrib.staticfiles',
> > > )
> >
> > > urls.py
> >
> > > urlpatterns = patterns('',
> > >(r'^$', 'hydra.views.index'),
> > > )
> >
> > >http://192.168.1.141:44/static/js/jquery.1.6.1.min.js
> >
> > > Page not found (404)
> > > 'js\jquery.1.6.1.min.js' could not be found
> >
> > > Thanks
> >
> > > Madhu
> >
> > > On May 24, 9:44 pm, shofty <m...@shofty.me> wrote:
> > > > ignore that last comment, im clearly behind a version!
> >
> > > > not sure why you're needing to static.serve the static files, if
> > > > you're on django 1.3 it does that bit for you.
> >
> > > > On May 24, 9:22 am, AlaguMadhu<alma...@gmail.com> wrote:
> >
> > > > > Hi,
> >
> > > > > sample/
> > > > >   media/
> > > > > js/jquery.1.6.1.min.js
> > > > >  css/
> > > > >static/
> > > > > js/jquery.1.6.1.min.js
> > > > >  css/
> >
> > > > > settings.py
> >
> > > > > import os
> > > > > PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
> > > > > MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media/')
> > > > > MEDIA_URL = '/media/'
> > > > > STATIC_ROOT = os.path.join(PROJECT_DIR, 'static/')
> > > > > STATIC_URL = '/static/'
> >
> > > > > urls.py
> >
> > > > > urlpatterns = patterns('',
> > > > > (r'^media/(?P.*)$', 'django.views.static.serve',
> > > > > {'document_root': settings.MEDIA_ROOT}),
> > > > > (r'^static/(?P.*)$', 'django.views.static.serve',
> > > > > {'document_root': settings.STATIC_ROOT}),
> >
> > > > >http://192.168.1.141:44/static/js/jquery.1.6.1.min.js
> >
> > > > > Page not found (404)
> > > > > 'js\jquery.1.6.1.min.js' could not be found
> >
> > > > > Thanks
> >
> > > > >Madhu
> >
> > > --
> > > 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.
> >
> > --
> > Thanks and Regards,
> > *Praveen Krishna R*
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Serving static file on Windows

2011-05-30 Thread Praveen Krishna R
*could you dump your urls.py ?
*
On Mon, May 30, 2011 at 12:19 PM, Alagu Madhu <alma...@gmail.com> wrote:

> Hi,
>
> sample/
> static/
>js/jquery.1.6.1.min.js
> css/
>
> settings.py
>
> APP_DIR = os.path.abspath(os.path.dirname(__file__))
> STATIC_ROOT = os.path.join(APP_DIR, 'static/')
> STATIC_URL = '/static/'
> INSTALLED_APPS = (
>'django.contrib.auth',
>'django.contrib.contenttypes',
>'django.contrib.sessions',
>'django.contrib.sites',
>'django.contrib.messages',
>'django.contrib.staticfiles',
> )
>
> urls.py
>
> urlpatterns = patterns('',
>(r'^$', 'hydra.views.index'),
> )
>
> http://192.168.1.141:44/static/js/jquery.1.6.1.min.js
>
> Page not found (404)
> 'js\jquery.1.6.1.min.js' could not be found
>
>
> Thanks
>
> Madhu
>
>
>
>
> On May 24, 9:44 pm, shofty <m...@shofty.me> wrote:
> > ignore that last comment, im clearly behind a version!
> >
> > not sure why you're needing to static.serve the static files, if
> > you're on django 1.3 it does that bit for you.
> >
> > On May 24, 9:22 am, AlaguMadhu<alma...@gmail.com> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hi,
> >
> > > sample/
> > >   media/
> > > js/jquery.1.6.1.min.js
> > >  css/
> > >static/
> > > js/jquery.1.6.1.min.js
> > >  css/
> >
> > > settings.py
> >
> > > import os
> > > PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
> > > MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media/')
> > > MEDIA_URL = '/media/'
> > > STATIC_ROOT = os.path.join(PROJECT_DIR, 'static/')
> > > STATIC_URL = '/static/'
> >
> > > urls.py
> >
> > > urlpatterns = patterns('',
> > > (r'^media/(?P.*)$', 'django.views.static.serve',
> > > {'document_root': settings.MEDIA_ROOT}),
> > > (r'^static/(?P.*)$', 'django.views.static.serve',
> > > {'document_root': settings.STATIC_ROOT}),
> >
> > >http://192.168.1.141:44/static/js/jquery.1.6.1.min.js
> >
> > > Page not found (404)
> > > 'js\jquery.1.6.1.min.js' could not be found
> >
> > > Thanks
> >
> > >Madhu
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

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

2011-05-29 Thread Praveen Krishna R
*I have used tiny_mce with django.
*
On Sat, May 28, 2011 at 3:34 PM, Vladimir <veva...@yandex.ru> wrote:

> Has anyone any experience in CKeditor or tinymce using with django ?
>
> On 26 май, 20:25, Oscar Carballal <piz...@gmail.com> wrote:
> > 2011/5/26 Brett Parker <idu...@sommitrealweird.co.uk>:
> >
> > > On 26 May 08:27, Vladimir wrote:
> > >> Is there a tool to transform MS WORD file into HTML ? I know there is
> > >> markdown and textile, but I would prefer MS WORD.
> >
> > >http://wvware.sourceforge.net/
> >
> > > --
> > > Brett Parker
> >
> > Alsohttp://ginstrom.com/software/doc2html/
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Reload a view pass X seconds

2011-05-29 Thread Praveen Krishna R
*This you could achieve with a javascript/jQuery snippet on the page.
*
On Sun, May 29, 2011 at 10:03 AM, javier <mithrand...@gmail.com> wrote:

> Hi,
>
> I'm developing a django project and I want to put a chronometer in one
> of my pages, so pass X seconds the view will be reload again.
>
> Can anyone help me?
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

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



Anyone using google closure library with django?

2011-05-24 Thread Praveen Krishna R
Hi guys,


Anybody here use closure library from google.  ?
How do u compare it to jQuery ?
I have used jQuery only yet



-- 
Thanks and Regards,
*Praveen Krishna R*

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

2011-05-19 Thread Praveen Krishna R
*Hey,
*
*
*
*This Regarding the static file serving, What I understood, after reading
some docs on the internet is,*
*
*
*Keep a server like Nginx as a front end proxy infront of Apache, and nginx
 also serves the Static Files, *
*(please correct me if I am wrong.)
*
*
*
*My Question is If I use the Amazon CloudFront to serve the files, Do I need
to still keep the nginx there ?!*
*
*
-- 
Thanks and Regards,
*Praveen Krishna R*

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



App engine serving static files?

2011-02-15 Thread Praveen Krishna R
*Hey Guys,*
*
*
*Does Anyone has experience, serving static content with google app engine?*
*Does it make a big difference, than serving it with nginx on the same
server as django?*
*I currently use a shared hosting, and was just thinking to move the static
content to GAE*
*I would like to know your thoughts on this*
*
*
-- 
Thanks and Regards,
*Praveen Krishna R*

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

2011-02-15 Thread Praveen Krishna R
*plz Check django official docs to find out how static files are served on
production and development server.*
*
*
*in the dev server include a similiar snippet into your projects
urls.py, urlpatterns:*
*
*
*(r'^site_media/(?P.*)$',
'django.views.static.serve',{'document_root':
'D:/djangoprojects/praveensprofile/templates/static'}),*
*
*
***and in the templates something similar to the below text.*
*
*
*
*
*
*
On Tue, Feb 15, 2011 at 1:07 PM, Szabo, Patrick (LNG-VIE) <
patrick.sz...@lexisnexis.at> wrote:

> How do i check the logs !?
> I'm using the integrated webserver.
>
> Kind regards
>
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Patrick Szabo
>  XSLT-Entwickler
> LexisNexis
> Marxergasse 25, 1030 Wien
>
> mailto:patrick.sz...@lexisnexis.at
> Tel.: +43 (1) 534 52 - 1573
> Fax: +43 (1) 534 52 - 146
>
>
> -Ursprüngliche Nachricht-
>
> Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com]
> Im Auftrag von Kenneth Gonsalves
> Gesendet: Dienstag, 15. Februar 2011 11:05
> An: django-users@googlegroups.com
> Betreff: Re: images
>
> On Tue, 2011-02-15 at 11:00 +0100, Szabo, Patrick (LNG-VIE) wrote:
> > Unfortunately i only get the "alt text" shown and not the image.
> > The image is in the same directory as the template.
>
> check your logs to see where it is searching for your image
> --
> regards
> KG
> http://lawgon.livejournal.com
> Coimbatore LUG rox
> http://ilugcbe.techstud.org/
>
> --
> 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.
>
>
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Having trouble synchronizing the database, can someone help?

2011-02-14 Thread Praveen Krishna R
*Please try delete and recreate the database and do the syncdb again, *
*if you are learning. **If you are in production, use South for django, for
the schema migration.*

On Tue, Feb 15, 2011 at 10:06 AM, Chen Xu <xuche...@gmail.com> wrote:

> Hi, everyone:
> I have a question about Django models,
> so I created a Model:
>
> class Person(models.Model):
> name = models.CharField(max_length=60)
>
> and ran the follwing:
>
>python manage.py syncdb
>
>   this successfully did what I want, but later on, I added a new field into
> a model
>
> class Person(models.Model):
> GENDER_CHOICES = (
> (u'M', u'Male'),
> (u'F', u'Female'),
> )
> name = models.CharField(max_length=60)
> gender = models.CharField(max_length=2, choices=GENDER_CHOICES)
>
> and I tried to run:
>  python manage.py syncdb again to sync my database, but it does not do it:
>
> So I am wondering if it is because since Person model already exists, it
> will just simply ignore  checking if the field changes.
> And what I should do to sync the database?
>
>
> Thanks
>
>
>
>
> --
> ⚡ Chen Xu ⚡
>
> --
> 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.
>



-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: Looking for IDE + FTP

2011-02-13 Thread Praveen Krishna R
*+1 Notepad++
*
On Sun, Feb 13, 2011 at 2:46 PM, Ori Livneh <ori.liv...@gmail.com> wrote:

> Karen,
>
> Windows lets you mount FTP and WebDAV shares. Linux additionally has SSHFS.
> (Less likely to be useful, but also worth mentioning, are SMB and NFS.)
> These are all good ways to have a remote folder behave as though it were a
> folder or a drive on your local computer, which allows you to use pretty
> much any editor you like to remote edit files. Googling any of these terms
> will produce helpful howtos.
>
> vim is wonderful, but has a rather steep learning curve.
>
> Notepad++ is a capable and free text editor has an FTP plugin.
> See
> http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central
>
>
> <http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central>
> Best,
> Ori
>
>
> On Sun, Feb 13, 2011 at 5:02 AM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> Aptana looks nice, PYCharm looks a bit ugly :/
>>
>>
>> On Sat, Feb 12, 2011 at 5:10 PM, Dylan McCurry <notjoesm...@gmail.com>wrote:
>>
>>> I personally use Coda and love it.  Built in ftp, terminal, css
>>> editor, and code editor.
>>>
>>> On Feb 8, 3:30 pm, Karen McNeil <karenlmcn...@gmail.com> wrote:
>>> > I have three Django sites that I've been working on recently and I've
>>> > been doing most of the development work in Dreamweaver.  I don't use
>>> > any of the wysiwyg features (or, pretty much, any of the Dreamweaver
>>> > program features), but I like it because I can do all the the code
>>> > edits and the FTP transfers all in one program.  I like being able to
>>> > grab a remote file, make some code changes, save and upload all at
>>> > once, and view a nice graphical display of the file structure for the
>>> > local and remote sites.
>>> >
>>> > Problem is, Dreamweaver's code view is definitely not built for
>>> > Python, and it doesn't look like they have any plans to support it any
>>> > time in the foreseeable future.  Which means that I get no color-
>>> > coding of the code, and I'm constantly getting indentation errors.
>>> >
>>> > I've always had Dreamweaver on my computer (a Mac) and so have never
>>> > used a separate FTP program, and the only IDE I've ever used is IDLE.
>>> > I used IDLE when I was first learning Python, but now that I'm working
>>> > with the websites, I find it much more convenient to just open the
>>> > files from within DW.  Does anyone know of another, Python-friendly,
>>> > program that I could use for both code-editing and ftp?
>>> >
>>> > Thanks,
>>> > 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.
>>>
>>>
>>  --
>> 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.
>>
>
>  --
> 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.
>



-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: looking cheap Python/Django/mySQL hosting

2011-01-26 Thread Praveen Krishna R
*webfaction.com is also good, you can go live with your app in minutes.*
*See http://djangofriendly.com for a list of django friendly web hosts...
*
On Wed, Jan 26, 2011 at 4:20 PM, Jonas Geiregat <jo...@geiregat.org> wrote:

>
>
>
> > for small project.
> >
>
> I use djangoeurope.com. They have server in Paris and Zurich.
>
>
>
> --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
*Praveen Krishna R*

-- 
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: looking cheap Python/Django/mySQL hosting

2011-01-26 Thread Praveen Krishna R
Free hosting @  *http://www.alwaysdata.com/*

On Wed, Jan 26, 2011 at 8:36 AM, GSV <svyatoslav.zhurov...@gmail.com> wrote:

> for small project.
>
> Thank you
>
> --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
*Praveen Krishna R*

-- 
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: ForeignKey to User

2011-01-18 Thread Praveen Krishna R
*Thank You
*
On Tue, Jan 18, 2011 at 12:08 PM, Ivo Brodien <i...@brodien.de> wrote:

>
> from the 
> docs<http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.related_name>
> :
>
> If you'd prefer Django didn't create a backwards relation, set
> related_name to '+'. For example, this will ensure that the Usermodel
> won't get a backwards relation to this model:
>
> If your Model is called: MyModel then you could do for a user instance:
>
> user.mymodel_set , but if you define a '+’ as related_name, you can’t
> because django does not create the ‘reverse relationship’
>
>
>
>
> On 18.01.2011, at 10:00, Praveen Krishna R wrote:
>
> *Hi,*
> *
> *
> *Could any of you tell me about the things which I should take care while
> defining a *
> *foreign key to User model. ? *
> *
> *
> *Do I need to define the related_name ='+' as it says in the
> documentation? and what does it do?*
> *
>
> user = models.ForeignKey(User, related_name='+')
>
>  *
> --
> *Praveen Krishna R*
>
>
> --
> 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.
>
>
>  --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
*Praveen Krishna R*

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



ForeignKey to User

2011-01-18 Thread Praveen Krishna R
*Hi,*
*
*
*Could any of you tell me about the things which I should take care while
defining a *
*foreign key to User model. ? *
*
*
*Do I need to define the related_name ='+' as it says in the documentation?
and what does it do?*
*

user = models.ForeignKey(User, related_name='+')

*
-- 
*Praveen Krishna R*

-- 
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: GROUP BY fields appearance, bug or feature?

2011-01-16 Thread Praveen Krishna R
*First of all did you try accessing the email subject with a dotted
notation?*
try
u = User.objects.all()
and
u[0].subject


On Sun, Jan 16, 2011 at 12:53 PM, Jari Pennanen <jari.penna...@gmail.com>wrote:

> Hi!
>
> Suppose following model:
>
> class UserEmail(models.Model):
>"""User email"""
>
>user = models.ForeignKey(User, db_index=True,
> null=True, blank=True, editable=False)
>"""User recieving the email"""
>
>added = models.DateTimeField(_("added"), auto_now_add=True)
>"""Added to database"""
>
>subject = models.CharField(_('subject'), max_length=128)
>"""Subject"""
>
>message = models.TextField(_('message'))
>"""Message"""
>
> How can I retrieve list of users and their latest email subject?
>
> This almost works:
>
> User.objects.all()\
>  .annotate(latest_email_added=Max('useremail__added'))
>
> But it does not give me the other fields of latest email such as
> subject, so I try to add other fields using extra:
> User.objects.all()\
>  .annotate(latest_email_added=Max('useremail__added'))\
>  .extra(select={'email_subject' : 'myapp_useremail.subject'})
>
> Suddenly it adds a GROUP BY to the query with a long list of fields
> that should not be there, which breaks everything, now I get multiple
> rows per user which is not wanted.
>
> If I try to modify the group_by manually, like this:
> a = User.objects.all()\
>  .annotate(latest_email_added=Max('useremail__added'))\
>  .extra(select={'email_subject' : 'dmusic_useremail.subject'});
> a.query.group_by = [('auth_user', 'id')];
> print a.query
>
> There is still one extra field in group by making it break:
> ... GROUP BY "auth_user"."id", (dmusic_useremail.subject)
>
> Can someone elaborate this behavior?
>
> Any help is appreciated, 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
*Praveen Krishna R*

-- 
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: Problem with DJANGO_SETTINGS_MODULE is undefined

2011-01-15 Thread Praveen Krishna R
*try *
*manage.py runserver
*
On Sat, Jan 15, 2011 at 10:58 AM, Chen Xu <xuche...@gmail.com> wrote:

> Hi, Django developers:
> I am very new here, trying to set up my Django
> I have a project called 'mysite'
> when I run:
> $ django-admin.py runserver
>
> the terminal gives:
> Error: Settings cannot be imported, because environment variable
> DJANGO_SETTINGS_MODULE is undefined
>
> then I tried this:
> $ export DJANGO_SETTINGS_MODULE=mysite.settings
>
> the terminal then gives me:
> django-admin.py runserverError: Could not import settings 'mysite.settings'
> (Is it on sys.path? Does it have syntax errors?): No module named
> mysite.settings
>
>
> can anyone help me with this?
>
> Thanks very much
>
>
>
>
>  --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
*Praveen Krishna R*

-- 
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: Customize the admin look and feel

2011-01-02 Thread Praveen Krishna R
*Good to know that It worked. Good luck, anyways
*
On Sun, Jan 2, 2011 at 6:01 PM, Anthony Pearce <coden...@gmail.com> wrote:

> That has worked. Puzzling to me though since we left off the admin
> directory in TEMPLATE_DIRS
>
> None the less, thank you very much. I will continue with the tutorial
> and see how much farther I can get.
>
> On Jan 2, 11:46 pm, Praveen Krishna R <rpraveenkris...@gmail.com>
> wrote:
> > Could you please try moving the base_site.html to
> > C:\DjangoProjects\mysite\mytemplates\admin
> > folder and Leave the TEMPLATE_DIRS as it is, which is "*
> > C:/DjangoProjects/mysite/mytemplates*" only. and please try removing the
> /
> > slash at the end.
> >
> >
> >
> >
> >
> > On Sun, Jan 2, 2011 at 5:36 PM, Anthony Pearce <coden...@gmail.com>
> wrote:
> > > TYVM for your response. My first reply does not show, so hopefully I'm
> > > not double posting.
> >
> > > This is what I have so far:
> >
> > > TEMPLATE_DIRS   "C:/DjangoProjects/mysite/mytemplates/"
> > > base_site.html location   C:\DjangoProjects\mysite\mytemplates
> >
> > > This is what base_site.html reads.
> > > {% extends "admin/base.html" %}
> > > {% load i18n %}
> > > {% block title %}{{ title }} | {% trans 'Django site admin' %}{%
> > > endblock %}
> > > {% block branding %}
> > > {% trans 'Django Administration' %}
> > > {% endblock %}
> > > {% block nav-global %}{% endblock %}
> >
> > > If this supposed to help me change the appearance?  I don't see how to
> > > change anything here.
> >
> > > On Jan 2, 4:36 pm, Praveen Krishna R <rpraveenkris...@gmail.com>
> > > wrote:
> > > > Hi,
> >
> > > > Your TEMPLATE_DIRS should contain a path to a folder where you want
> to
> > > keep
> > > > your templates. Say if your project is in *D:/myproject* then create
> a
> > > > folder named
> > > > template under *D:\myproject*, and in that folder create a folder
> named
> > > *admin
> > > > *and then copy and paste base_site.html into the admin folder.
> >
> > > >  TEMPLATE_DIRS section should look like the below snippet in
> settings.py
> >
> > > > *
> > > > TEMPLATE_DIRS = (
> > > > 'D:/myproject /templates'
> > > > )
> >
> > > > *
> >
> > > > On Sun, Jan 2, 2011 at 10:04 AM, Anthony Pearce <coden...@gmail.com>
> > > wrote:
> > > > > I have made it to the "Writing your first Django app, part 2" page
> > > > > down to "Customize the admin look and feel", at the bottom.  I'm
> stuck
> > > > > with this paragraph..
> >
> > > > > Now copy the template admin/base_site.html from within the default
> > > > > Django admin template directory in the source code of Django itself
> > > > > (django/contrib/admin/templates) into an admin subdirectory of
> > > > > whichever directory you're using in TEMPLATE_DIRS. For example, if
> > > > > your TEMPLATE_DIRS includes "/home/my_username/mytemplates", as
> above,
> > > > > then copy django/contrib/admin/templates/admin/base_site.html to
> /home/
> > > > > my_username/mytemplates/admin/base_site.html. Don't forget that
> admin
> > > > > subdirectory.
> >
> > > > > I found the "base_site" at C:/Django-1.2.4/django/contrib/admin/
> > > > > templates/admin/base_site.html.
> >
> > > > > I have no idea where this is supposed to be copied and pasted to.
> >
> > > > > Any help please?
> >
> > > > > --
> > > > > 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<django-users%2bunsubscr...@googlegroups.com>
> <django-users%2bunsubscr...@google­groups.com>
> > > <django-users%2bunsubscr...@google­groups.com>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/django-users?hl=en.
> >
> > > > --
> > > > *Praveen Krishna 

Re: Customize the admin look and feel

2011-01-02 Thread Praveen Krishna R
Could you please try moving the base_site.html to
C:\DjangoProjects\mysite\mytemplates\admin
folder and Leave the TEMPLATE_DIRS as it is, which is "*
C:/DjangoProjects/mysite/mytemplates*" only. and please try removing the /
slash at the end.

On Sun, Jan 2, 2011 at 5:36 PM, Anthony Pearce <coden...@gmail.com> wrote:

> TYVM for your response. My first reply does not show, so hopefully I'm
> not double posting.
>
> This is what I have so far:
>
> TEMPLATE_DIRS   "C:/DjangoProjects/mysite/mytemplates/"
> base_site.html location   C:\DjangoProjects\mysite\mytemplates
>
> This is what base_site.html reads.
> {% extends "admin/base.html" %}
> {% load i18n %}
> {% block title %}{{ title }} | {% trans 'Django site admin' %}{%
> endblock %}
> {% block branding %}
> {% trans 'Django Administration' %}
> {% endblock %}
> {% block nav-global %}{% endblock %}
>
> If this supposed to help me change the appearance?  I don't see how to
> change anything here.
>
>
> On Jan 2, 4:36 pm, Praveen Krishna R <rpraveenkris...@gmail.com>
> wrote:
> > Hi,
> >
> > Your TEMPLATE_DIRS should contain a path to a folder where you want to
> keep
> > your templates. Say if your project is in *D:/myproject* then create a
> > folder named
> > template under *D:\myproject*, and in that folder create a folder named
> *admin
> > *and then copy and paste base_site.html into the admin folder.
> >
> >  TEMPLATE_DIRS section should look like the below snippet in settings.py
> >
> > *
> > TEMPLATE_DIRS = (
> > 'D:/myproject /templates'
> > )
> >
> > *
> >
> >
> >
> >
> >
> > On Sun, Jan 2, 2011 at 10:04 AM, Anthony Pearce <coden...@gmail.com>
> wrote:
> > > I have made it to the "Writing your first Django app, part 2" page
> > > down to "Customize the admin look and feel", at the bottom.  I'm stuck
> > > with this paragraph..
> >
> > > Now copy the template admin/base_site.html from within the default
> > > Django admin template directory in the source code of Django itself
> > > (django/contrib/admin/templates) into an admin subdirectory of
> > > whichever directory you're using in TEMPLATE_DIRS. For example, if
> > > your TEMPLATE_DIRS includes "/home/my_username/mytemplates", as above,
> > > then copy django/contrib/admin/templates/admin/base_site.html to /home/
> > > my_username/mytemplates/admin/base_site.html. Don't forget that admin
> > > subdirectory.
> >
> > > I found the "base_site" at C:/Django-1.2.4/django/contrib/admin/
> > > templates/admin/base_site.html.
> >
> > > I have no idea where this is supposed to be copied and pasted to.
> >
> > > Any help please?
> >
> > > --
> > > 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<django-users%2bunsubscr...@googlegroups.com>
> <django-users%2bunsubscr...@google­groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
> >
> > --
> > *Praveen Krishna R*- Hide quoted text -
> >
> > - Show quoted text -
>
> --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
*Praveen Krishna R*

-- 
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: Customize the admin look and feel

2011-01-02 Thread Praveen Krishna R
Hi,

Your TEMPLATE_DIRS should contain a path to a folder where you want to keep
your templates. Say if your project is in *D:/myproject* then create a
folder named
template under *D:\myproject*, and in that folder create a folder named *admin
*and then copy and paste base_site.html into the admin folder.

 TEMPLATE_DIRS section should look like the below snippet in settings.py

*
TEMPLATE_DIRS = (
'D:/myproject /templates'
)


*
On Sun, Jan 2, 2011 at 10:04 AM, Anthony Pearce <coden...@gmail.com> wrote:

> I have made it to the "Writing your first Django app, part 2" page
> down to "Customize the admin look and feel", at the bottom.  I'm stuck
> with this paragraph..
>
> Now copy the template admin/base_site.html from within the default
> Django admin template directory in the source code of Django itself
> (django/contrib/admin/templates) into an admin subdirectory of
> whichever directory you're using in TEMPLATE_DIRS. For example, if
> your TEMPLATE_DIRS includes "/home/my_username/mytemplates", as above,
> then copy django/contrib/admin/templates/admin/base_site.html to /home/
> my_username/mytemplates/admin/base_site.html. Don't forget that admin
> subdirectory.
>
> I found the "base_site" at C:/Django-1.2.4/django/contrib/admin/
> templates/admin/base_site.html.
>
> I have no idea where this is supposed to be copied and pasted to.
>
> Any help please?
>
> --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
*Praveen Krishna R*

-- 
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: django-registration custom fields

2010-05-29 Thread Praveen
Hi Pankaj
here you may refer my blog where i explain how you may extend some
fields while registration.

http://praveensunsetpoint.wordpress.com/category/django/django-registration-profile/

Praveen

On May 29, 4:41 pm, Pankaj Singh <singh.pankaj.iitkg...@gmail.com>
wrote:
> I tried extending RegistrationFormUniqueEmail
>
> class CustomRegistrationFormUniqueEmail(RegistrationFormUniqueEmail):
>     first_name = forms.CharField(label=_('First name'),
> max_length=30,required=True)
>     last_name = forms.CharField(label=_('Last name'), max_length=30,
> required=True)
>     def save(self, profile_callback=None):
>         new_user = super(CustomRegistrationFormUniqueEmail,
> self).save(profile_callback=profile_callback)
>         new_user.first_name = self.cleaned_data['first_name']
>         new_user.last_name = self.cleaned_data['last_name']
>         return new_user
>
> then changing view
>
> #       form = form_class(data=request.POST, files=request.FILES)
>         form = CustomRegistrationFormUniqueEmail(data=request.POST,
> files=request.FILES)
>
> but still I am seeing default view containg four fields only ..
>
> help is needed

-- 
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: Get pk before commit

2010-05-29 Thread Praveen
Did you really mean for commit=FALSE or pre_save signal???
Praveen

On May 29, 5:22 pm, Euan Goddard <euan.godd...@2degreesnetwork.com>
wrote:
> Hi,
>
> Could you explain the situation in a little more detail as I don't
> quite follow what you mean. As far as I'm aware if you have something
> like the following:
>
> >>> my_inst = MyModel(foo="bar", ...)
> >>> my_inst.save()
>
> You'll have the pk at this point even if the transaction hasn't been
> committed (providing you haven't specified a custom primary key
> field). So you should be able to do:
>
> >>> my_pk = my_inst.pk
>
> and use this for the other field that you need to set. If the other
> field is a foreign key to my_inst, then you should just be able to do:
>
> >>> other_model_inst.related_object = my_inst
> >>> other_model_inst.save()
>
> I'm not sure how this is affected by transactions. Unless you have a
> really good reason to, I'd let Django handle the transaction
> management for you, then you don't need to worry about save points,
> committing and rolling back.
>
> Euan
>
> On 29 May, 07:56, TheIvIaxx <theivi...@gmail.com> wrote:
>
> > Hello, I am trying to figure out how to get a pk in the middle of a
> > transaction. I need to set a field in the model based on the
> > ID(default pk) to be given.  As far as a i know, this ID should be
> > allocated during the transaction.  So i would imagine it would do the
> > INSERT, then i could get the pk and do what i need to do, then proceed
> > with the commit.
>
> > Is this possible?
>
> > 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-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: VariableDoesNotExist when I go to login page

2010-05-29 Thread Praveen
Error describes well. your request key is not exist while rendering.
are you rendering your 'request' variable to page. and what is the
request here.
Thanks
Praveen

On May 29, 5:37 pm, Victor Fontes <vit...@gmail.com> wrote:
> I get an error in this line:
>
>  class="first">Inicio
>
> Everyting was working just fine and all of a sudden I started to get
> this error:
>
> http://dpaste.com/200702/

-- 
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: Django-registration with django-profile

2010-04-05 Thread Praveen
Here i have done
look at my blog
http://praveensunsetpoint.wordpress.com/category/django/django-registration-profile/

On Apr 5, 1:03 am, Alessandro Ronchi 
wrote:
> 2010/4/3 shacker :
>
> > Cool!  Would be nice to put your solution up on djangosnippets.org or
> > similar for the benefit of others.
>
> It's nothing new. I've copied the default backend for
> django-registration, changed the RegistrationForm and handled
> correctly the form with a view.
> It's simply a matter of choice what pieces are useful to achieve the
> needed registration workflow.
>
> I found that django-profile was unuseful, because it add another
> registration step with a form you can include in registration.
>
> --
> Alessandro Ronchi
>
> http://www.soasi.com
> SOASI - Sviluppo Software e Sistemi Open Source
>
> Hobby & Giochi, l'e-commerce del 
> divertimentohttp://hobbygiochi.comhttp://www.facebook.com/pages/Forli/Hobby-Giochi/185311523755

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

2010-03-10 Thread Praveen
I know i can not directly register a form but i do not have any model
for Email. i just have plain form *forms.Form*
is there any other way to register Form with admin.
Thanks

On Mar 11, 3:03 am, Beres Botond <boton...@gmail.com> wrote:
> You cannot directly register a form with admin, you should be
> registering models
>
> from myapps.forms import MyModelForm
> from myapps.models import MyModel
>
> class MyModelAdmin(admin.ModelAdmin):
>      form = MyModelForm
>
> admin.site.register(MyModel, EmailAdmin)
>
> Also the form should be a ModelForm for that model.
>
> from django.forms import ModelForm
>
> # Create the form class.
> class MyModelForm(ModelForm):
>      class Meta:
>          model = MyModel
>
> Read the docs thoroughly, 
> especially:http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#modelformhttp://docs.djangoproject.com/en/1.1/ref/contrib/admin/#ref-contrib-a...
>
> On Mar 10, 10:28 pm, Praveen <praveen.python.pl...@gmail.com> wrote:
>
> > Hi
> > I have one form in forms.py
>
> > class EmailForm(forms.Form):
> >     recipient = forms.CharField(max_length=14, min_length=12,
> > widget=forms.TextInput(attrs=require))
> >     message = forms.CharField(max_length=140, min_length=1,
> > widget=forms.Textarea(attrs={'cols': 30, 'rows': 5}))
>
> > and my site url is
> > admin.autodiscover()
> > urlpatterns = patterns('',  (r'^admin/(.*)',
> > include(admin.site.urls)),)
>
> > now i want it to be shown on admin interface
>
> > I tried so far
> > First attempt
>
> > from myapps.forms import EmailForm
> > class EmailAdmin(admin.ModelAdmin):
> >      form = EmailForm
> > did not work Exception Value:
> > 'DeclarativeFieldsMetaclass' object is not iterable
>
> > Second attempt
> > and now i 
> > followedhttp://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contri...
> > but could not get help
>
> > class EmailAdmin(admin.ModelAdmin):
> >     def my_view(self,request):
> >         return admin_my_view(request,self)
>
> >     def get_urls(self):
> >         urls = super(SmsAdmin, self).get_urls()
> >         my_urls = patterns('',(r'^my_view/
> > $',self.admin_site.admin_view(self.my_view)))
> >         return my_urls + urls
>
> > def admin_my_view(request, model_admin):
> >     opts = model_admin.model._meta
> >     admin_site = model_admin.admin_site
> >     has_perm = request.user.has_perm(opts.app_label \
> >     + '.' + opts.get_change_permission())
> >     context = {'admin_site': admin_site.name,
> >     'title': "My Custom View",
> >     'opts': opts,
> >     'root_path': '/%s' % admin_site.root_path,
> >     'app_label': opts.app_label,
> >     'has_change_permission': has_perm}
> >     template = 'admin/demo_app/admin_my_view.html'
> >     return render_to_response(template,
> > context,context_instance=RequestContext(request))
> > admin.site.register(EmailForm,EmailAdmin)
>
> > and when i run server and type on browserhttp://localhost:8000/admin
> > and hit enter button
>
> > Exception Value:
> > 'DeclarativeFieldsMetaclass' object is not iterable
>
> > and second time just after first time when i again enter then it show
> > me the admin page but i can't see my EmailAdmin in admin intercae..
>
> > Just help me or suggest me any link.
>
> > 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-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: ModelAdmin

2010-03-10 Thread Praveen


On Mar 11, 3:03 am, Beres Botond <boton...@gmail.com> wrote:
> You cannot directly register a form with admin, you should be
> registering models
I know i can not directly register a form but i do not have any model
for Email. i just have plain form *forms.Form*
is there any other way to register Form with admin.
Thanks
>
> from myapps.forms import MyModelForm
> from myapps.models import MyModel
>
> class MyModelAdmin(admin.ModelAdmin):
>      form = MyModelForm
>
> admin.site.register(MyModel, EmailAdmin)
>
> Also the form should be a ModelForm for that model.
>
> from django.forms import ModelForm
>
> # Create the form class.
> class MyModelForm(ModelForm):
>      class Meta:
>          model = MyModel
>
> Read the docs thoroughly, 
> especially:http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#modelformhttp://docs.djangoproject.com/en/1.1/ref/contrib/admin/#ref-contrib-a...
>
> On Mar 10, 10:28 pm, Praveen <praveen.python.pl...@gmail.com> wrote:
>
> > Hi
> > I have one form in forms.py
>
> > class EmailForm(forms.Form):
> >     recipient = forms.CharField(max_length=14, min_length=12,
> > widget=forms.TextInput(attrs=require))
> >     message = forms.CharField(max_length=140, min_length=1,
> > widget=forms.Textarea(attrs={'cols': 30, 'rows': 5}))
>
> > and my site url is
> > admin.autodiscover()
> > urlpatterns = patterns('',  (r'^admin/(.*)',
> > include(admin.site.urls)),)
>
> > now i want it to be shown on admin interface
>
> > I tried so far
> > First attempt
>
> > from myapps.forms import EmailForm
> > class EmailAdmin(admin.ModelAdmin):
> >      form = EmailForm
> > did not work Exception Value:
> > 'DeclarativeFieldsMetaclass' object is not iterable
>
> > Second attempt
> > and now i 
> > followedhttp://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contri...
> > but could not get help
>
> > class EmailAdmin(admin.ModelAdmin):
> >     def my_view(self,request):
> >         return admin_my_view(request,self)
>
> >     def get_urls(self):
> >         urls = super(SmsAdmin, self).get_urls()
> >         my_urls = patterns('',(r'^my_view/
> > $',self.admin_site.admin_view(self.my_view)))
> >         return my_urls + urls
>
> > def admin_my_view(request, model_admin):
> >     opts = model_admin.model._meta
> >     admin_site = model_admin.admin_site
> >     has_perm = request.user.has_perm(opts.app_label \
> >     + '.' + opts.get_change_permission())
> >     context = {'admin_site': admin_site.name,
> >     'title': "My Custom View",
> >     'opts': opts,
> >     'root_path': '/%s' % admin_site.root_path,
> >     'app_label': opts.app_label,
> >     'has_change_permission': has_perm}
> >     template = 'admin/demo_app/admin_my_view.html'
> >     return render_to_response(template,
> > context,context_instance=RequestContext(request))
> > admin.site.register(EmailForm,EmailAdmin)
>
> > and when i run server and type on browserhttp://localhost:8000/admin
> > and hit enter button
>
> > Exception Value:
> > 'DeclarativeFieldsMetaclass' object is not iterable
>
> > and second time just after first time when i again enter then it show
> > me the admin page but i can't see my EmailAdmin in admin intercae..
>
> > Just help me or suggest me any link.
>
> > 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-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.



ModelAdmin

2010-03-10 Thread Praveen
Hi
I have one form in forms.py

class EmailForm(forms.Form):
recipient = forms.CharField(max_length=14, min_length=12,
widget=forms.TextInput(attrs=require))
message = forms.CharField(max_length=140, min_length=1,
widget=forms.Textarea(attrs={'cols': 30, 'rows': 5}))

and my site url is
admin.autodiscover()
urlpatterns = patterns('',  (r'^admin/(.*)',
include(admin.site.urls)),)

now i want it to be shown on admin interface

I tried so far
First attempt

from myapps.forms import EmailForm
class EmailAdmin(admin.ModelAdmin):
 form = EmailForm
did not work Exception Value:
'DeclarativeFieldsMetaclass' object is not iterable

Second attempt
and now i followed 
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_urls
but could not get help

class EmailAdmin(admin.ModelAdmin):
def my_view(self,request):
return admin_my_view(request,self)

def get_urls(self):
urls = super(SmsAdmin, self).get_urls()
my_urls = patterns('',(r'^my_view/
$',self.admin_site.admin_view(self.my_view)))
return my_urls + urls

def admin_my_view(request, model_admin):
opts = model_admin.model._meta
admin_site = model_admin.admin_site
has_perm = request.user.has_perm(opts.app_label \
+ '.' + opts.get_change_permission())
context = {'admin_site': admin_site.name,
'title': "My Custom View",
'opts': opts,
'root_path': '/%s' % admin_site.root_path,
'app_label': opts.app_label,
'has_change_permission': has_perm}
template = 'admin/demo_app/admin_my_view.html'
return render_to_response(template,
context,context_instance=RequestContext(request))
admin.site.register(EmailForm,EmailAdmin)

and when i run server and type on browser http://localhost:8000/admin
and hit enter button

Exception Value:
'DeclarativeFieldsMetaclass' object is not iterable

and second time just after first time when i again enter then it show
me the admin page but i can't see my EmailAdmin in admin intercae..

Just help me or suggest me any link.

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-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: Record is not saving

2010-01-30 Thread Praveen
Thanks
Actually earlier i was passing instance of Phone
phoneform = PhoneForm(request.POST,instance=Phone.objects.get
(user=request.user))
but at very first time there was no record in Phone table
that is what i was getting the sql query is not matching
so i tried with
try:
userob = Phone.objects.get(user=request.user)
except Exception,e:
userob = None
if request.method == 'POST':
phoneform = form_class(request.POST, instance=userob)

and its working fine:


On Jan 30, 9:22 pm, cootetom <coote...@gmail.com> wrote:
> You are created a PhoneForm but passing it an instance of User. You
> need to pass the form an instance of the model it works on.
>
> - Tom
>
> On Jan 30, 3:45 pm, Praveen <praveen.python.pl...@gmail.com> wrote:
>
> > Hi
>
> > here is my views
> > def phone_register(request, success_url=None,form_class = PhoneForm,
> >                 template_name="phone/phonereg_form.html", 
> > extra_context=None):
> >     userobj = User.objects.get(pk=request.user.id)
> >     if request.method == 'POST':
> >         phoneform = form_class(request.POST, instance=userobj)
> >         if phoneform.is_valid():
> >             phoneformobj = phoneform.save(commit=False)
> >             phoneformobj.user = request.user
> >             phoneformobj.mobile_key = random.randint(1000,1)
> >             phoneformobj.save()
> >             # route_sms(smslane, phoneformobj.phoneno, Your Activation Key
> > is: phoneformobj.mobile_key)
> >             return HttpResponseRedirect(success_url or reverse
> > ('goto_dashboard'))
> >     else:
> >         phoneform = form_class(instance=userobj)
> >     if extra_context is None:
> >         extra_context = {}
> >     context = RequestContext(request)
> >     for key, value in extra_context.items():
> >         context[key] = callable(value) and value() or value
> >     return render_to_response(template_name,
> > {'phoneform':phoneform},context_instance=context)
> > phone_register = login_required(phone_register)
>
> > Here is i have pasted the full codehttp://pastebin.com/m62209f51

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



Record is not saving

2010-01-30 Thread Praveen
Hi

here is my views
def phone_register(request, success_url=None,form_class = PhoneForm,
template_name="phone/phonereg_form.html", extra_context=None):
userobj = User.objects.get(pk=request.user.id)
if request.method == 'POST':
phoneform = form_class(request.POST, instance=userobj)
if phoneform.is_valid():
phoneformobj = phoneform.save(commit=False)
phoneformobj.user = request.user
phoneformobj.mobile_key = random.randint(1000,1)
phoneformobj.save()
# route_sms(smslane, phoneformobj.phoneno, Your Activation Key
is: phoneformobj.mobile_key)
return HttpResponseRedirect(success_url or reverse
('goto_dashboard'))
else:
phoneform = form_class(instance=userobj)
if extra_context is None:
extra_context = {}
context = RequestContext(request)
for key, value in extra_context.items():
context[key] = callable(value) and value() or value
return render_to_response(template_name,
{'phoneform':phoneform},context_instance=context)
phone_register = login_required(phone_register)

Here is i have pasted the full code
http://pastebin.com/m62209f51

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



Enter a valid value while saving fullname during registration

2010-01-16 Thread Praveen
   urls.py

   url(r'^accounts/register/$',register,
{'form_class':RegForm},name='registration_register'),

  form.py
  ---
  from registration.forms import *
  class RegForm(RegistrationForm):
  """
  """
  fullname = forms.RegexField(regex=r'^\w+$',
  max_length=30,
  widget=forms.TextInput
(attrs=attrs_dict),
  label=_(u'fullname'))
  def clean_fullname(self):
  "This function is required to overwrite an inherited
username clean"
  return self.cleaned_data['fullname']'''

 def clean(self):
if not self.errors:
  self.cleaned_data['first_name'] = '%s%s' %
(self.cleaned_data['fullname'].split(' ',1)[0])
  self.cleaned_data['last_name'] = '%s%s' %
(self.cleaned_data['fullname'].split(' ',1)[1])
  super(RegForm, self).clean()
  return self.cleaned_data'''
  views.py
  
  def register(request, success_url=None,
   form_class=RegForm, profile_callback=None,
   template_name='registration/
registration_form.html',
   extra_context=None):
  #pform_class = utils.get_profile_form()
  if request.method == 'POST':
  #profileform = pform_class(data=request.POST,
files=request.FILES)
  form = form_class(data=request.POST,
files=request.FILES)
  if form.is_valid():
  new_user = form.save
(profile_callback=profile_callback)
  #profile_obj = profileform.save(commit=False)
  #profile_obj.user = new_user
  #profile_obj.save()
  return HttpResponseRedirect(success_url or reverse
('registration_complete'))
  else:
  form = form_class()
  #profileform = pform_class()
  if extra_context is None:
  extra_context = {}
  context = RequestContext(request)
  for key, value in extra_context.items():
  context[key] = callable(value) and value() or value
  return render_to_response(template_name,
{ 'form': form},
context_instance=context)

  registration_form.html
  --
  
  Full Name
  
  
  
  {{ form.fullname }}
  {% for error in form.fullname.errors
%}
  {{ error }}
  {% endfor %}
  
  User Name
  
  
  
  {{ form.username }}
  {% for error in form.username.errors
%}
  {{ error }}
  {% endfor %}
  
 Email Address
 
  
  
  {{ form.email }}
  {% for error in form.email.errors %}
  {{ error }}
  {% endfor %}

 Password
  
  
  
  {{ form.password1 }}
  {% for error in
form.password1.errors %}
  {{ error }}
  {% endfor %}

 Confirm Password
 
  
  
  {{ form.password2 }}
  {% for error in
form.password2.errors %}
  {{ error }}
  {% endfor %}
   
  While saving

  Full Name: |_|   Enter a valid value.
-- 
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: How to disable deletion af a model instance

2009-05-10 Thread Praveen

Hi, i do not know how its going to achieve but in my case.
For each payment entry i will add delete button and will disable the
default django admin interface.
Create a separate GroupProfile class
class GroupProfile(models.Model):
name = models.CharField(_('name'), max_length=80, unique=True)
group = models.ManyToManyField(Group, verbose_name=_('group'),
blank=True)
city = models.ForeignKey(city)
user = models.ManyToManyField(User)

class Meta:
verbose_name = _('group')
verbose_name_plural = _('groups')

def __unicode__(self):
return self.name

Create a group for instance do_delete and assign the permission to
delete the entry.
Now create an entry for GroupProfile for instance do_delete_group and
assign the user and do_delete to this group.

in payment view you can write this code

tc = GroupProfile.objects.all().filter(user=use)
gd= {}
for obj in tc:
n = obj.group.all()
for o in n:
 gd[o.name]=o.name
value = gd.values()
render the value to the template and check if the value exist then
show the delete button otherwise do not delete.
Thanks

On May 10, 7:15 am, Margie  wrote:
> I thought that might be the case.  Is that true of the deletes done by
> a formset save as well?  IE, when a formset.save() is done, in some
> cases my delete will be called, and in some cases not?
>
> Margie
>
> On May 9, 4:57 pm, James Bennett  wrote:
>
> > On Sat, May 9, 2009 at 7:49 PM, George Song  wrote:
> > > I think if you want to know definitively if your `delete()` method is
> > > being called or not, your debug statement should go in that method. I
> > > wouldn't be surprised if Django is sending pre and post delete signals
> > > even during bulk deletion.
>
> > It's kind of tricky, really, because there's not any guarantee one way
> > or another -- QuerySet.delete() *may* call delete() methods of
> > individual objects, or it may not. IIRC it mostly comes down to how
> > much of the deletion can be done in a bulk SQL DELETE statement, and
> > how much (due to, e.g., relationships involved) requires fetching the
> > individual objects and deleting them one at a time.
>
> > --
> > "Bureaucrat Conrad, you are technically correct -- the best kind of 
> > correct."
--~--~-~--~~~---~--~~
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: Registration

2009-04-20 Thread Praveen



Before going to answer of your question i am really sure that you have
not read the docs of django-registration and django docs any
way

if you want to make it use django-registration(default) then install
it and write in settings.py 'registration'(below of your appname)
in your site url

 (r'^accounts/', include('registration.urls')),

now you need to create registration_form.html (you go to in
registration packages and see all the views they have mentioned there
required html page)

create a folder named 'registration' and put your
'registration_form.html' inside that.

first create a simple template with only plain html
and write their User name : {{form.user}}
Password : {{form.password1}}

On Apr 20, 4:28 pm, TP  wrote:
> Thanks for the continued help.
>
> I have written the URLS.py now they are as below:
>
> urlpatterns = patterns('',
>                        # Activation keys get matched by \w+ instead of
> the more specific
>                        # [a-fA-F0-9]{40} because a bad activation key
> should still get to the view;
>                        # that way it can return a sensible "invalid
> key" message instead of a
>                        # confusing 404.
>                        url(r'^activate/(?P\w+)/$',
>                            activate,
>                            name='registration_activate'),
>                        url(r'^login/$',
>                            auth_views.login,
>                            {'template_name': 'registration/
> login.html'},
>                            name='auth_login'),
>                        url(r'^logout/$',
>                            auth_views.logout,
>                            {'template_name': 'registration/
> logout.html'},
>                            name='auth_logout'),
>                        url(r'^password/change/$',
>                            auth_views.password_change,
>                            name='auth_password_change'),
>                        url(r'^password/change/done/$',
>                            auth_views.password_change_done,
>                            name='auth_password_change_done'),
>                        url(r'^password/reset/$',
>                            auth_views.password_reset,
>                            name='auth_password_reset'),
>                        url(r'^password/reset/confirm/(?P[0-9A-
> Za-z]+)-(?P.+)/$',
>                            auth_views.password_reset_confirm,
>                            name='auth_password_reset_confirm'),
>                        url(r'^password/reset/complete/$',
>                            auth_views.password_reset_complete,
>                            name='auth_password_reset_complete'),
>                        url(r'^password/reset/done/$',
>                            auth_views.password_reset_done,
>                            name='auth_password_reset_done'),
>                        url(r'^register/$',
>                            register,
>                            name='registration_register'),
>                        url(r'^register/complete/$',
>                            direct_to_template,
>                            {'template': 'registration/
> registration_complete.html'},
>                            name='registration_complete'),
>                        )
>
> I think that is correct.
>
> When I load the HTML page I still cannot see a form and only see:
>
> {% load i18n %}
> {% block header %} {% trans "Home" %} | {% if user.is_authenticated %}
> {% trans "Logged in" %}: {{ user.username }} ({% trans "Log out" %} |
> {% trans "Change password" %}) {% else %} {% trans "Log in" %} {%
> endif %} {% endblock %}
> {% block content %}{% endblock %}
> {% block footer %} {% endblock %}
>
> I think I am quite close to getting this working, just having a hard
> time with linking the HTML.
--~--~-~--~~~---~--~~
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: {{perms}} is not displaying on template

2009-04-17 Thread Praveen

I solved my problem. i was calling wrong template.

On Apr 17, 6:09 pm, Praveen <praveen.python.pl...@gmail.com> wrote:
> def myfunc(request, event_id):
>         context_instance=RequestContext(request)
>         print "Context", context_instance ### Context: [{'perms':
> ,
> 'messages': [], 'user': }, {}]
>         return render_to_response('test.html',
> {'user':request.user},context_instance=RequestContext(request))
>
> in test.html
> 
>
> Permission : {{perms}}
>
> run on browser :
> ---
> Permission : (blank nothing is displayin)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



{{perms}} is not displaying on template

2009-04-17 Thread Praveen

def myfunc(request, event_id):
context_instance=RequestContext(request)
print "Context", context_instance ### Context: [{'perms':
,
'messages': [], 'user': }, {}]
return render_to_response('test.html',
{'user':request.user},context_instance=RequestContext(request))


in test.html


Permission : {{perms}}

run on browser :
---
Permission : (blank nothing is displayin)
--~--~-~--~~~---~--~~
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: how to use email instead of username for user authentication?

2009-04-13 Thread Praveen

You please check the satchmo package there they are using email as
username in satchmo-registration using
user=generate_id(email,firstname)

On Apr 13, 9:44 am, pkenjora  wrote:
> Malcolm,  <- Remembered the 'l' this time!
>
> To keep things simple and avoid fragmenting this discussion into a
> million different dead end tit for tats , I'll try to reign in the
> main points.
>
> 1. The default authentication method in Django should have no inherent
> restrictions.  Such as blocking '@' in the username.  This leaves the
> default framework open and free of workarounds.  This approach would
> not preclude any project specific requirements.
>
> 2. Any authentication method having restrictions should be an opt in
> method.  The current method is a restrictive authentication method,
> one that does not allow email, and should be made optional.
>
> 3. When you boil down the hundreds of specific use cases out there you
> still end up with the above two points.  In which case I would make
> the argument that if you need to block emails as user names then it is
> you who should write a new authentication handler.  In your own words,
> the framework allows this and its only a few lines of code.
>
> Now for the dead end tit for tat... this is really project philosophy
> not framework philosophy... hence I feel like it is circular
> discussion that distracts from the main point...
>
> Authenticating by email does not require me to check my email every
> time I log in.  So if my email is no longer accessible (left my job) I
> can simply log in and change it to a new one.  If changing the
> username requires checking my email then I will have the same problem
> if I use email as my username or not.
>
> You yourself identify the username as mainly an authentication
> mechanism not necessarily a display value.  Thats all the more reason
> to have a robust restriction free out of the box implementation of
> authentication.
>
> Thanks for reading the feedback, I still fail to see how you can
> include project specific requirements in a framework? The
> implementation you are advocating is a subset of the general
> implementation I would like to see bundled out of the box.  Why not
> move it into an optional module?
>
> -Paul
>
> On Apr 11, 4:13 pm, Malcolm Tredinnick 
> wrote:
>
> > On Sat, 2009-04-11 at 07:52 -0700, pkenjora wrote:
> > > Malcom,
>
> > Well, I'm not "Malcom" (sic), but I'll reply anyway.
>
> > >    Google, FaceBook, and LinkedIn have been using email authentication
> > > for how long now?  With the default constraints you've put on Django a
> > > developer would have to "work around" the out of the box code to make
> > > the project behave like the big 3 names on the web.
>
> > There's some assumption there that what they're doing is a good idea.
> > Their systems have the usability problems I've mentioned. It's also not
> > clear their authentication methods are the best around. In any case, as
> > I note below (and have written elsewhere), you're simply not restricted
> > from using this system and can do so without patching Django, if that's
> > the way you want to go. There's no restriction in place here!
>
> > The combined size of forums and social networking sites not pretending
> > that my "handle" is an email address is, I'll wager, larger than
> > Facebook or LinkedIn, certainly. Which has precisely the same small
> > weight as your examples. The point being that there are valid use-cases
> > in both directions and you'll notice that that's never been disputed.
>
> > [...]
>
> > >   As far as your reasons go, I'm fairly sure its just as easy to
> > > change the email as it is the username,
>
> > I'm sorry you feel that way. It's patently false. The username is only
> > used on the site you are creating an account for. Your email address has
> > much wider usage and creating a new one isn't always possible or
> > desirable (signing up to one of the hosted services requires agreeing to
> > T that are often unpleasant). The username when creating a new account
> > on a site has much less currency.
>
> > > I would even argue that my
> > > username (display name) could change but my login credentials should
> > > stay the same.
>
> > You are assuming that the username is the display name. That might be a
> > secondary use for it and it sometimes works well for that. However, the
> > username is primarily the unique identifier for the user within the
> > system. It's the thing that won't change. Having a display name,
> > particularly one that can change is also quite common and it's for
> > extensions like that that user profile exist for.
>
> > Login credentials are not the same as identifier within the system. The
> > login credentials should definitely be permitted to change. Having an
> > account tied to an email address is tragic when that email address is no
> > longer accessible to you (for example, it was a company address and
> > you've since left 

Re: newbie question: django-registration

2009-04-12 Thread Praveen

You should change the site domain name example.com to 127.0.0.1:8000
check in your django-site table.. http://www.example.com/accounts/activate/
637cd08106eea9b1139efd34a0fa79a5d7f90494/  for instance
http://127.0.0.1:8000/accounts/activate/
637cd08106eea9b1139efd34a0fa79a5d7f90494/

On Apr 13, 12:55 am, Angel Cruz  wrote:
> Eh,
> Never mind.  Something is wrong with my root url (fixing the link from the
> email activated the account).
>
> I will fix it.
>
> On Sun, Apr 12, 2009 at 12:21 PM, MrBodjangles wrote:
>
> > Hi Folks and Happy Easter!
>
> > OK, making slow but sure progress on learning Django.
>
> > I am using django-registration, have provided the simple templates
> > required, and am to the point that a user can register (their usename,
> > password, etc. get populated in the auth_user table of the PostgreSQL
> > databae I am using), and receives an email.
>
> > I am stuck on the activation.
>
> > When I check my email and click on the link, I receive the following:
> > "The requested URL /accounts/activate/
> > 637cd08106eea9b1139efd34a0fa79a5d7f90494/ was not found on this
> > server"
>
> > I had assumed that the /accounts/activate/ folder
> > would have been automatically generated?
>
> > I added this line to my URLConf, thinking this was the reason:
> >    (r'^accounts/activate//
> > $','registration.views.activate'),
>
> > What step am I missing?
>
> > Advanced 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
-~--~~~~--~~--~--~---



Re: Registration form and Profile form is not saving

2009-04-12 Thread Praveen

How the current user logging-in first while registration.. you mean to
say after successfully registration the user must login automatically.

On Apr 11, 7:55 pm, Praveen <praveen.python.pl...@gmail.com> wrote:
> Hi all, i am really fed up and have tried number of way. Please read
> my last line which really describe where i am facing problem.
> First Attempt.
> models.py
> -
> class UserProfile(models.Model):
>     user = models.ForeignKey(User, unique=True, verbose_name=_
> ('user'))
>     gender = models.CharField(_('gender'), max_length=1,
> choices=GENDER_CHOICES, blank=True)
>     dob = models.DateField(_('dob'), max_length=10, help_text=_
> ("Should be in date format"), null=True, blank=True)
>     city = models.CharField(_('res_city'), max_length=30,
> choices=CITY_CHOICES, blank=True)
>
> class RegistrationForm(forms.Form):
>     """The basic account registration form."""
>     title = forms.CharField(max_length=30, label=_('Title'),
> required=False)
>     email = forms.EmailField(label=_('Email address'),
>         max_length=75, required=True)
>     password2 = forms.CharField(label=_('Password (again)'),
>         max_length=30, widget=forms.PasswordInput(), required=True)
>     password1 = forms.CharField(label=_('Password'),
>         max_length=30, widget=forms.PasswordInput(), required=True)
>     first_name = forms.CharField(label=_('First name'),
>         max_length=30, required=True)
>     last_name = forms.CharField(label=_('Last name'),
>         max_length=30, required=True)
>     #gender = forms.CharField(label = _('Gender'), widget =
> forms.Select(choices=GENDER_CHOICES,attrs=attrs_dict))
>     #dob = forms.DateTimeField(widget=forms.DateTimeInput(attrs=dict
> (attrs_dict, max_length=75)), label=_(u'date of birth'))
>     #city = forms.CharField(label = _('res_city'), widget =
> forms.Select(choices=CITY_CHOICES,attrs=attrs_dict))
>
>     def __init__(self, *args, **kwargs):
>         self.contact = None
>         super(RegistrationForm, self).__init__(*args, **kwargs)
>
>     newsletter = forms.BooleanField(label=_('Newsletter'),
>         widget=forms.CheckboxInput(), required=False)
>
>     def clean_password1(self):
>         """Enforce that password and password2 are the same."""
>         p1 = self.cleaned_data.get('password1')
>         p2 = self.cleaned_data.get('password2')
>         if not (p1 and p2 and p1 == p2):
>             raise forms.ValidationError(
>                 ugettext("The two passwords do not match."))
>
>         # note, here is where we'd put some kind of custom
>         # validator to enforce "hard" passwords.
>         return p1
>
>     def clean_email(self):
>         """Prevent account hijacking by disallowing duplicate
> emails."""
>         email = self.cleaned_data.get('email', None)
>         if email and User.objects.filter(email=email).count() > 0:
>             raise forms.ValidationError(
>                 ugettext("That email address is already in use."))
>
>         return email
>
>     def save(self, request=None, **kwargs):
>         """Create the contact and user described on the form.  Returns
> the
>         `contact`.
>         """
>         if self.contact:
>             log.debug('skipping save, already done')
>         else:
>             self.save_contact(request)
>         return self.contact
>
>     def save_contact(self, request):
>         print " i am in save_contact "
>         log.debug("Saving contact")
>         data = self.cleaned_data
>         password = data['password1']
>         email = data['email']
>         first_name = data['first_name']
>         last_name = data['last_name']
>         username = data['title']
>         #dob = data['dob']
>         #gender = data['gender']
>         #city = data['city']
>
>         verify = (config_value('SHOP', 'ACCOUNT_VERIFICATION') ==
> 'EMAIL')
>
>         if verify:
>             from registration.models import RegistrationProfile
>             user = RegistrationProfile.objects.create_inactive_user(
>                 username, password, email, send_email=True)
>         else:
>             user = User.objects.create_user(username, email, password)
>
>         user.first_name = first_name
>         user.last_name = last_name
>         user.save()
>
>         # If the user already has a contact, retrieve it.
>         # Otherwise, create a new one.
>         try:
>             contact = Contact.objects.from_request(request,
> create=False)
>        

Registration form and Profile form is not saving

2009-04-11 Thread Praveen

Hi all, i am really fed up and have tried number of way. Please read
my last line which really describe where i am facing problem.
First Attempt.
models.py
-
class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True, verbose_name=_
('user'))
gender = models.CharField(_('gender'), max_length=1,
choices=GENDER_CHOICES, blank=True)
dob = models.DateField(_('dob'), max_length=10, help_text=_
("Should be in date format"), null=True, blank=True)
city = models.CharField(_('res_city'), max_length=30,
choices=CITY_CHOICES, blank=True)

class RegistrationForm(forms.Form):
"""The basic account registration form."""
title = forms.CharField(max_length=30, label=_('Title'),
required=False)
email = forms.EmailField(label=_('Email address'),
max_length=75, required=True)
password2 = forms.CharField(label=_('Password (again)'),
max_length=30, widget=forms.PasswordInput(), required=True)
password1 = forms.CharField(label=_('Password'),
max_length=30, widget=forms.PasswordInput(), required=True)
first_name = forms.CharField(label=_('First name'),
max_length=30, required=True)
last_name = forms.CharField(label=_('Last name'),
max_length=30, required=True)
#gender = forms.CharField(label = _('Gender'), widget =
forms.Select(choices=GENDER_CHOICES,attrs=attrs_dict))
#dob = forms.DateTimeField(widget=forms.DateTimeInput(attrs=dict
(attrs_dict, max_length=75)), label=_(u'date of birth'))
#city = forms.CharField(label = _('res_city'), widget =
forms.Select(choices=CITY_CHOICES,attrs=attrs_dict))

def __init__(self, *args, **kwargs):
self.contact = None
super(RegistrationForm, self).__init__(*args, **kwargs)

newsletter = forms.BooleanField(label=_('Newsletter'),
widget=forms.CheckboxInput(), required=False)

def clean_password1(self):
"""Enforce that password and password2 are the same."""
p1 = self.cleaned_data.get('password1')
p2 = self.cleaned_data.get('password2')
if not (p1 and p2 and p1 == p2):
raise forms.ValidationError(
ugettext("The two passwords do not match."))

# note, here is where we'd put some kind of custom
# validator to enforce "hard" passwords.
return p1

def clean_email(self):
"""Prevent account hijacking by disallowing duplicate
emails."""
email = self.cleaned_data.get('email', None)
if email and User.objects.filter(email=email).count() > 0:
raise forms.ValidationError(
ugettext("That email address is already in use."))

return email

def save(self, request=None, **kwargs):
"""Create the contact and user described on the form.  Returns
the
`contact`.
"""
if self.contact:
log.debug('skipping save, already done')
else:
self.save_contact(request)
return self.contact

def save_contact(self, request):
print " i am in save_contact "
log.debug("Saving contact")
data = self.cleaned_data
password = data['password1']
email = data['email']
first_name = data['first_name']
last_name = data['last_name']
username = data['title']
#dob = data['dob']
#gender = data['gender']
#city = data['city']

verify = (config_value('SHOP', 'ACCOUNT_VERIFICATION') ==
'EMAIL')

if verify:
from registration.models import RegistrationProfile
user = RegistrationProfile.objects.create_inactive_user(
username, password, email, send_email=True)
else:
user = User.objects.create_user(username, email, password)

user.first_name = first_name
user.last_name = last_name
user.save()

# If the user already has a contact, retrieve it.
# Otherwise, create a new one.
try:
contact = Contact.objects.from_request(request,
create=False)
#profile = UserProfile.objects.form_request(request,
create=False)
except Contact.DoesNotExist:
contact = Contact()

contact.user = user
contact.first_name = first_name
contact.last_name = last_name
contact.email = email
contact.role = 'Customer'
contact.title = data.get('title', '')
contact.save()

if 'newsletter' not in data:
subscribed = False
else:
subscribed = data['newsletter']

signals.satchmo_registration.send(self, contact=contact,
subscribed=subscribed, data=data)

def save_profile(self, request):
user_obj = User.objects.get(pk=request.user.id)
#user_obj.first_name = self.cleaned_data['first_name']
#user_obj.last_name = self.cleaned_data['last_name']
try:
profile_obj = request.user.get_profile()

Re: registration and profile must save at a time

2009-04-10 Thread Praveen

Thanks and i tried to do in same fashion as Bennett suggested
but getting errror

def register_handle_form(request, redirect=None):

print "I am in handle form"
form_class = utils.get_profile_form()
if request.method == 'POST':
print "i am in profile post"
profileform = form_class(data=request.POST,
files=request.FILES)
form = RegistrationForm(request.POST)
if form.is_valid():
contact = form.save(request)
profile_obj = profileform.save(commit=False)
profile_obj.user = request.user
profile_obj.save()
if not redirect:
redirect = urlresolvers.reverse
('registration_complete')
return (True, http.HttpResponseRedirect
(urlresolvers.reverse('registration_complete')))
#return HttpResponseRedirect(reverse
('registration_complete'))

else:
initial_data = {}
try:
contact = Contact.objects.from_request(request,
create=False)
initial_data = {
'email': contact.email,
'first_name': contact.first_name,
'last_name': contact.last_name }
except Contact.DoesNotExist:
log.debug("No contact in request")
contact = None

signals.satchmo_registration_initialdata.send(contact,
contact=contact,
initial_data=initial_data)

form = RegistrationForm(initial=initial_data)
profileform = form_class(data=request.POST,
files=request.FILES)
return (False, form, profileform)



def activate(request, activation_key):
from registration.models import RegistrationProfile
activation_key = activation_key.lower()
account = RegistrationProfile.objects.activate_user
(activation_key)

if account:
# ** hack for logging in the user **
# when the login form is posted, user = authenticate
(username=data['username'], password=data['password'])
# ...but we cannot authenticate without password... so we work-
around authentication
account.backend = settings.AUTHENTICATION_BACKENDS[0]
login(request, account)
contact = Contact.objects.get(user=account)
request.session[CUSTOMER_ID] = contact.id
send_welcome_email(contact.email, contact.first_name,
contact.last_name)
signals.satchmo_registration_verified.send(contact,
contact=contact)

context = RequestContext(request, {
'account': account,
'expiration_days': config_value('SHOP',
'ACCOUNT_ACTIVATION_DAYS'),
})
return render_to_response('registration/activate.html', context)


def register(request, redirect=None, template='registration/
registration_form.html'):
"""
Allows a new user to register an account.
"""
print " I am in my register"
ret = register_handle_form(request, redirect)
#ret = register_handle_profile_form(request, redirect)
#form_class = utils.get_profile_form()
#pform = form_class(data=request.POST, files=request.FILES)
print "Ret length :", len(ret)
print "Ret :", ret
#print "Pet :", pform
success = ret[0]
todo = ret[1]
profiledo = ret[2]
#print "Profile object :", profiledo
if len(ret) > 2:
extra_context = ret[2]
#print "If extra context", extra_context
else:
extra_context = {}
#print "Else extra context", extra_context

if success:
return "Successfull"
else:
if config_get_group('NEWSLETTER'):
show_newsletter = True
else:
show_newsletter = False

ctx = {
'form': todo,
'pform': profiledo,
'title' : _('Registration Form'),
'show_newsletter' : show_newsletter
}
print "CTX :", ctx
#if extra_context:
 #   ctx.update(extra_context)

context = RequestContext(request, ctx)
return render_to_response(template, context)

ERROR:
tuple index out of range

profiledo = ret[2]  //in this line
when i go to accounts/register/ at first time and tried to print the
ret
Ret : (False, , ) it
returns me a tuple with 3 elements after clicking on register button
it return me tuple with 2 elements.


On Apr 9, 11:50 am, James Bennett <ubernost...@gmail.com> wrote:
> On Thu, Apr 9, 2009 at 12:27 AM, Praveen <praveen.python.pl...@gmail.com> 
> wrote:
> > Thank you so much Malcolm but to display extra fields on sign up we
> > will have to customize the django.contric.auth.forms then that form is
> > generated from the user models i am so much confused whether i will
> > have to add extra field in user model class or not but i do not want
> > change the structure of auth_user table. ok in a single line i want
> > django-registration

Re: registration and profile must save at a time

2009-04-08 Thread Praveen

Thank you so much Malcolm but to display extra fields on sign up we
will have to customize the django.contric.auth.forms then that form is
generated from the user models i am so much confused whether i will
have to add extra field in user model class or not but i do not want
change the structure of auth_user table. ok in a single line i want
django-registration and django-profile to be mingle in one form. could
you please suggest me link or idea.

On Apr 8, 5:36 pm, Praveen <praveen.python.pl...@gmail.com> wrote:
> hi all i have one very intrested question when we write /accounts/
> register/ then on browser i get 5 field
> username,pwd,cnfpwd,firstname,lastname
> but i want to add two more fields city, age on registration form.
> i know i can use django-profiles to extend User and can save to
> UserProfile
> but i am not worried let the city, age save to UserProfile table.
> i want the user should feel he is registering with site but mechanism
> is we are saving registration and profile at a time.
> if i write on browser
> /accounts/register
>
> User Name : TextField
> First Name : TextField
> Last Name : TextField
> Password   : TextField
> Confirm      : TextField
> City            : TextField
> Age            : DropDown
>
> Click on Register
> last two field is saving to UserProfile table and remain are saving to
> auth_user.
> in settings.py AUTH_PROFILE_MODULE = app_label.UserProfile
> i am very much familiar with django-registration and django-profile
> but it really wiered to display extra fields on Registration Form for
> that we will have to customize the from django.contrib.auth.forms.
>
> 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
-~--~~~~--~~--~--~---



registration and profile must save at a time

2009-04-08 Thread Praveen

hi all i have one very intrested question when we write /accounts/
register/ then on browser i get 5 field
username,pwd,cnfpwd,firstname,lastname
but i want to add two more fields city, age on registration form.
i know i can use django-profiles to extend User and can save to
UserProfile
but i am not worried let the city, age save to UserProfile table.
i want the user should feel he is registering with site but mechanism
is we are saving registration and profile at a time.
if i write on browser
/accounts/register

User Name : TextField
First Name : TextField
Last Name : TextField
Password   : TextField
Confirm  : TextField
City: TextField
Age: DropDown

Click on Register
last two field is saving to UserProfile table and remain are saving to
auth_user.
in settings.py AUTH_PROFILE_MODULE = app_label.UserProfile
i am very much familiar with django-registration and django-profile
but it really wiered to display extra fields on Registration Form for
that we will have to customize the from django.contrib.auth.forms.

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



Database error in Django

2009-04-03 Thread Praveen

def queryset(self, request):
qs = super(EventAdmin, self).queryset(request)
if not request.user.is_superuser:
qs = qs.filter(city=request.user.get_profile().res_city)
return qs

it works fine as but it list out all the city's events

def queryset(self, request):
qs = super(EventAdmin, self).queryset(request)
if request.user.is_superuser:
qs = qs.filter(city=request.user.get_profile().res_city)
return qs

but when i change the if condition it gives error message

Database error

Something's wrong with your database installation. Make sure the
appropriate database tables have been created, and make sure the
database is readable by the appropriate user.


--~--~-~--~~~---~--~~
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: Registration Behavior

2009-02-18 Thread Praveen

Hi could you please tell me more about sorry i could not get you. are
you using django-profiles?

On Feb 19, 8:24 am, timlash  wrote:
> I'm running Python 2.4, Django 1.0.2 and Django_Registration-0.7 on my
> Debian Etch box.  I'm making decent progress on developing my first
> Django web app.  I've got models, tables, views, templates,
> registration has successfully sent Gmail and test users have been
> activated.
>
> My first noob problem: I don't understand how Django and/or
> Registration is controlling the order in which web pages are
> requested.  After logging in a test user on the development server at:
>
>                http://localhost:8000/mysite/accounts/login/
>
> the following page is requested:
>
>                http://localhost:8000/accounts/profile/
>
> Obviously, this throws an error since urls.py only includes references
> to mysite.  This line is also inurls.py:
>
>                 (r'^mysite/accounts/', include('registration.urls')),
>
> I've searched the Django doc and poked through all the registration
> files but I can't find any instructions that tell the web server to go
> (upon successful login) from .../login/ to .../profile/
>
> Any pointers would be greatly appreciated.
>
> Cheers,
>
> Tim
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



POST Method problem with profile

2009-02-18 Thread Praveen

urls.py
---

url(r'^accounts/profile/$', create_profile, { 'profile_callback':
UserProfile.objects.create },name='profiles_create_profile'),
url(r'^accounts/editprofile/$', edit_profile,
name='profiles_edit_profile'),
url(r'^accounts/viewprofile/(?P\w+)/$', profile_detail,
name='profiles_profile_detail'),

views.py


def create_profile(request, form_class=ProfileForm,
success_url=None,template_name='registration/profile.html',
   extra_context=None,profile_callback=None,):
try:
profile_obj = request.user.get_profile()
print "Profile obj : ", profile_obj ## Profile obj
is printing
return HttpResponseRedirect(reverse('profiles_edit_profile'))
except ObjectDoesNotExist:
pass

if success_url is None:
success_url = reverse('profiles_profile_detail',
  kwargs={ 'username':
request.user.username })
if form_class is None:
form_class = utils.get_profile_form()

if request.method == 'POST':
form = form_class(data=request.POST, files=request.FILES)
if form.is_valid():
profile_obj = form.save(request.user)
#profile_obj.user = request.user
#profile_obj.save()
if hasattr(form, 'save_m2m'):
form.save_m2m()
return HttpResponseRedirect(success_url)
else:
form = form_class()

if extra_context is None:
extra_context = {}
context = RequestContext(request)
for key, value in extra_context.items():
context[key] = callable(value) and value() or value

return render_to_response(template_name,
  { 'form': form },
  context_instance=context)
create_profile = login_required(create_profile)

  Edit Profile view ##
def edit_profile(request, form_class=None, success_url=None,
 template_name='registration/edit_profile.html',
 extra_context=None):
try:
profile_obj = request.user.get_profile()
print "edit profile_obj :", profile_obj
except ObjectDoesNotExist:
return HttpResponseRedirect(reverse
('profiles_create_profile'))

if success_url is None:
success_url = reverse('profiles_profile_detail',
  kwargs={ 'username':
request.user.username })
if form_class is None:
form_class = utils.get_profile_form()
if request.method == 'POST':
form = form_class(data=request.POST, files=request.FILES,
instance=profile_obj)
print "Form ; ", form
if form.is_valid():
form.save()
return HttpResponseRedirect(success_url)
else:
form = form_class(instance=profile_obj)

if extra_context is None:
extra_context = {}
context = RequestContext(request)
for key, value in extra_context.items():
context[key] = callable(value) and value() or value

return render_to_response(template_name,
  { 'form': form,
'profile': profile_obj, },
  context_instance=context)
edit_profile = login_required(edit_profile)


#  detail view of profile ##

def profile_detail(request, username, public_profile_field=None,
   template_name='registration/profile_list.html',
   extra_context=None):

user = get_object_or_404(User, username=username)
try:
profile_obj = user.get_profile()
profile_model = utils.get_profile_model()
print "Profile Model :", profile_obj
except ObjectDoesNotExist:
raise Http404
if public_profile_field is not None and \
   not getattr(profile_obj, public_profile_field):
profile_obj = None

if extra_context is None:
extra_context = {}
context = RequestContext(request)
for key, value in extra_context.items():
context[key] = callable(value) and value() or value

return render_to_response(template_name,
  { 'profile_obj': profile_obj },
  context_instance=context)

profile.html




edit_profile.html
-



profile_list.html

 this
work but do not save altered value to database and i tried with this
too
 i get
errors " this field is required"


Very first time if user have not created profile then account/profile
will redirect you to profile.html and will let you to save the
profile. if the user come back or write in browser accounts/profile
then it will redirect you to accounts/editprofile(user have already
profile) with edit_profile.html and all fields display the same value
as he enetered first time while creating the profile now suppose he
change the gender Male to Female and save profile then it takes you to
view profile but in view profile i still get gender female(because
that form is GET 

Re: blank=True on Char/TextFields

2009-02-13 Thread Praveen

Hi Toby, you have not read properly the django docs.

Note that empty string values will always get stored as empty strings,
not as NULL.

only use null=True for non-string fields such as integers, booleans
and dates.

For both types of fields, you will also need to set blank=True if you
wish to permit empty values in forms, as the null parameter only
affects database storage.

Avoid using null on string-based fields such as CharField and
TextField unless you have an excellent reason.

null is purely database-related, whereas blank is validation-related.
If a field has blank=True, validation on Django’s admin site will
allow entry of an empty value. If a field has blank=False, the field
will be required.

but in your case you want to leave the field with no string then go to
back-end and change the value NULL to 'NOT NULL' to that field.

On Feb 12, 8:35 pm, tow  wrote:
> I know this seems to be a constant source of confusion; but I seem to
> have managed to confuse myself:
>
> class TextData(models.Model):
>      text = models.TextField(blank=True)
>
> So I have a model with one textfield, whose value can be empty, and I
> don't want to worry about distinguishing NULLs and empty strings.
> perfect. So far so good according to the documentation.
>
> obj = TextData()
> obj.text = ''
> obj.save()
>
> ... works fine
>
> obj = TextData()
> obj.text = None
> obj.save()
>
> gives me an IntegrityError. Why? I don't care that whether that's
> saved as a Null or an zero-length string, I just want Django to save
> back my data according to whatever convention it's using for this
> field - the docs tell me if I do blank=True, then it'll use an empty
> string and not bother distinguishing nulls; or at least so they imply
> to me. But apparently it is trying to distinguish nulls, because it's
> given me an IntegrityError. I was expecting Django to coerce the None
> to an empty string before saving.
>
> The reason why I'm doing this is because I'm filling up a model object
> (which actually contains lots of fields), based upon a dictionary
> which might be incomplete.
>
> I really want to do something like:
>
> d = incomplete_dictionary()
> obj = MyModel()
> for k in fieldnames;
>     setattr(k, d.get(k))
>
> but I can't; that'll set missing fields to None. What I'm having to do
> instead is special-case all of the string values in order to set them
> to the empty string instead, which is rather more fragile.
>
> Toby
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



sites framework

2009-02-11 Thread Praveen

we have same structure events class in both sites.
Both sites use the same events database, and an events is associated
with one or more sites
It lets the site producers edit all events -- on both sites -- in a
single interface (the Django admin).
so my doubt is:
Is it necessary to write events class in both application and if it is
not then where should i keep events class in which app. if it should
be in both sites then how may i proceed ahead? If i keep events class
in both models.py then i will face this problem No, that would mean
for app a and b you will get tables: a_eventtype and b_eventtype.


myproject
|exposite
|settings.py
|urls.py
|manage.py

|expoapp
|views.py
|models.py
|urls.py
|foodiesite
|settings.py
|urls.py
|manage.py

|foodiesapp
|views.py
|models.py
|urls.py

|eventsapp
|views.py
|models.py
|urls.py

 settings.py
 urls.py
 manage.py

exposite/settings.py
-
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.comments',
'exposite.expoapp',
)
SITE_ID = 1
ROOT_URLCONF = 'myproject.urls'

foodiesite/settings.py
--
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.admindocs',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.comments',
'foodiesite.foodapp',
'registration',
'profiles',
)
SITE_ID = 2
ROOT_URLCONF = 'myproject.urls'

TEMPLATE_DIRS = (
"/home/praveen/DJANGOPRJ/myproject/foodieapp/templates",
)

below one is my structure of site. and i try to keep apps outside the
sites and kept only(settings,urls) but do not know the further
process.

exposite/expoapp/models.py and foodiesite/foodieapp/models.py (SAME
STRUCTURE OF events CLASS IN BOTH)
   --

class events(models.Model):
title = models.CharField(max_length = 50)
summary = models.CharField(max_length = 100)
description = models.CharField(max_length = 300)
event_type = models.ForeignKey(event_type)
start_date = models.DateField()
end_date = models.DateField()
contact_detail = models.CharField(max_length = 100)
booking_url = models.URLField(max_length = 50)
venue = models.CharField(max_length = 100, blank = True)
address = models.CharField(max_length = 100, blank = True)


TEMPLATE_DIRS = (
    "/home/praveen/DJANGOPRJ/myproject/expoapp/templates",
)

so in admin interface i have 3 apps eventsapp, expoapp, and foodapp.
when i write in terminal
:~/DJANGOPRJ/myproject/exposite$/ python manage.py shell
>>from myproject.eventsapp.models import *
Traceback (most recent call last):
  File "", line 1, in ?
ImportError: No module named myproject.eventsapp.models

because i am inside the exposite. i think we can keep the eventapp on
Django python path and may call any where. but i do not know how may i
keep..
--~--~-~--~~~---~--~~
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: Associating content with multiple sites

2009-02-11 Thread Praveen

http://pastebin.com/m78d7486f

http://docs.djangoproject.com/en/dev/ref/contrib/sites/ i have
reffered this link but i have doubt shall i keep Article model's
class
in both site.

On Feb 11, 7:37 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Wed, Feb 11, 2009 at 2:11 AM, Praveen 
> <praveen.python.pl...@gmail.com>wrote:
>
>
>
>
>
>
>
> > lets assume all in lowercase
>
> > expo/expoapp/models.py
> > 
>
> > class events(models.Model):
> >    title = models.CharField(max_length = 50)
> >    summary = models.CharField(max_length = 100)
> >    description = models.CharField(max_length = 300)
> >    event_type = models.ForeignKey(event_type)
> >    start_date = models.DateField()
> >    end_date = models.DateField()
> >    contact_detail = models.CharField(max_length = 100)
> >    booking_url = models.URLField(max_length = 50)
> >    venue = models.CharField(max_length = 100, blank = True)
> >    address = models.CharField(max_length = 100, blank = True)
>
> > foodie/foodieapp/models.py
> > 
>
> > class events(models.Model):
> >    title = models.CharField(max_length = 50)
> >    summary = models.CharField(max_length = 100)
> >    description = models.CharField(max_length = 300)
> >    event_type = models.ForeignKey(event_type)
> >    start_date = models.DateField()
> >    end_date = models.DateField()
> >    contact_detail = models.CharField(max_length = 100)
> >    booking_url = models.URLField(max_length = 50)
> >    venue = models.CharField(max_length = 100, blank = True)
> >    address = models.CharField(max_length = 100, blank = True)
>
> > we have same structure events class in both sites.
> > Both sites use the same events database, and an events is associated
> > with one or more sites
> > It lets the site producers edit all events -- on both sites -- in a
> > single interface (the Django admin).
> > so my doubt is:
> > Is it necessary to write events class in both application and if it is
> > not then where should i keep events class in which app. if it should
> > be in both sites then how may i proceed ahead?
> > If i keep events class in both models.py then i will face this problem
> > No, that would mean for app a and b you will get tables: a_eventtype
> > and b_eventtype.
>
> Take a look at the sites 
> framework:http://docs.djangoproject.com/en/dev/ref/contrib/sites/?from=olddocs
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



  1   2   >