I have a react function that calculates the ETD and i have same function in django but it is giving me a different value

2023-08-14 Thread Helly Modi
ETDtime( props.equipment.performed, props.equipment.standard_seconds, 
props.equipment.paused_seconds ) calulate ETD = start time + standard 
seconds +total puash export function ETDtime(date, standard_seconds, 
pause_seconds) { if (date) { let getdate = new Date(date); let 
get_standard_seconds = Math.floor(standard_seconds % 60); let 
get_pause_seconds = Math.floor((pause_seconds / 1000) % 60); 
getdate.setSeconds( getdate.getSeconds() + get_standard_seconds + 
get_pause_seconds ); var newdate = new Date(getdate); newdate = new Date( 
new Date(date).getTime() + standard_seconds * 1000 + pause_seconds * 1000 
); var get_date = newdate.getDate(); return ( (get_date >= 10 ? get_date : 
'0' + get_date) + '-' + (newdate.getMonth() + 1) + '-' + 
newdate.getFullYear() + ' ' + (newdate.getHours() >= 10 ? 
newdate.getHours() : '0' + newdate.getHours()) + ':' + 
(newdate.getMinutes() >= 10 ? newdate.getMinutes() : '0' + 
newdate.getMinutes()) ); } else { return ''; } } now if i am converting 
same function in django i am not getting that same value 

import datetime
from datetime import datetime, timedelta

def ETDtime(date, standard_seconds, pause_seconds):
if date:
getdate = datetime.strptime(date, '%Y-%m-%d %H:%M:%S')
get_standard_seconds = int(standard_seconds % 60)
get_pause_seconds = int((pause_seconds / 1000) % 60)
getdate += timedelta(seconds=get_standard_seconds + get_pause_seconds)
newdate = getdate + timedelta(seconds=standard_seconds + pause_seconds / 
1000)
get_date = newdate.day
return (
f'{get_date:02d}-'
f'{newdate.month:02d}-'
f'{newdate.year} '
f'{newdate.hour:02d}:'
f'{newdate.minute:02d}'
)
else:
return ''

# Given inputs
start_time = '2023-08-09 10:03:00'
paused_seconds = 30626
standard_seconds = 1200

# Calculate and print the output
output = ETDtime(start_time, standard_seconds, paused_seconds)
print(output)please help me what is wrong with my django function

-- 
You received this message because you are subscribed to the Google Groups 
"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/356b437b-ab01-4f6c-821d-d7c3b86c8fe7n%40googlegroups.com.


Re: group by "project"

2023-05-24 Thread Helly Modi
TRY THIS
from django.db.models import Count

def list(self, request, *args, **kwargs):
project_id = self.request.query_params.get('project_id')
if project_id:
queryset = RegistrationDatesSlots.objects.values('project', 
'date').annotate(count=Count('project')).filter(project=project_id)
else:
queryset = RegistrationDatesSlots.objects.values('project', 'date')

serialized_data = []
for item in queryset:
serialized_item = {
'date': item['date'],
'project': item['project']
}
serialized_data.append(serialized_item)
return Response(serialized_data)

On Thursday, May 25, 2023 at 7:05:38 AM UTC+5:30 Muhammad Juwaini Abdul 
Rahman wrote:

> Do you realize what 'Count' do?
>
> On Thu, 25 May 2023 at 09:20, 'Mohamed Yahiya Shajahan' via Django users <
> django...@googlegroups.com> wrote:
>
>> def list(self, request, *args, **kwargs):
>> project_id = self.request.query_params.get('project_id')
>> if project_id:
>> queryset = RegistrationDatesSlots.objects.values('date').
>> annotate(project=Count('project')).filter(project=project_id)
>> # queryset = 
>> RegistrationDatesSlots.objects.filter(project=project_id).query.group_by=['project']
>> else:
>> queryset = RegistrationDatesSlots.objects.all().values(
>> 'project', 'date')
>>
>> serialized_data = []
>> for item in queryset:
>> serialized_item = {
>> 'date': item['date'],
>> 'project': item['project']
>> }
>> serialized_data.append(serialized_item)
>> return Response(serialized_data)
>>
>>
>> this is my views i want to group by "project" but shows only one record,
>> i know there are multiple records there 
>>
>>
>>
>>  The content of this email is confidential and intended for the 
>> recipient specified in message only. It is strictly forbidden to share any 
>> part of this message with any third party, without a written consent of the 
>> sender. If you received this message by mistake, please reply to this 
>> message and follow with its deletion, so that we can ensure such a mistake 
>> does not occur in the future.
>>
>> SAVE PAPER | Good for your planet | Good for your Business
>>
>> -- 
>> You received this message because you are subscribed 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/016aad73-74fc-49c3-80e7-c8d68ea0a6ddn%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/28b321b8-4e3b-4fee-a94b-177ab1ba76f0n%40googlegroups.com.


Re: chatbot project

2023-05-24 Thread Helly Modi
There is a playlist in django where you will learn to create chatbot.Here 
is the linkhttps://youtu.be/0QdvjF83x7A.check this.It will be great help to 
you.

On Thursday, May 25, 2023 at 6:51:21 AM UTC+5:30 Anish Kumar wrote:

> can some one help me with source code i am a final year student and i 
> resgistered my name for python django chatbot project but i am a fresher so 
> i am have some problem in django chatbot project

-- 
You received this message because you are subscribed to the Google Groups 
"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/61ee59c8-1177-4f26-a117-a742b349485cn%40googlegroups.com.


Re: Dynamic Table

2023-05-24 Thread Helly Modi
worked on this option only .even tried dynamic django models but didn't 
work because of sustainable.if someone have the options or way to handle 
then please give


On Wednesday, May 24, 2023 at 11:06:23 AM UTC+5:30 Anh Nguyen wrote:

> Even your migrate works fine but you have to reload your runtime to apply 
> new codebase to de-encode data. So go back and find another solution.
>
> On Wed, 24 May 2023 at 12:22 Helly Modi  wrote:
>
>> I have to create dynamic table at runtime where user enters the details 
>> of table name,table column,table fields,constraints.take this input in 
>> backend and create table dynamically without creating schemas of tables as 
>> tables are created at runtime .first approach is that we will create one 
>> table where all the fields are mentioned where primary key,secondary 
>> key,unique,not niull and all the constraints are mentioned in horizontal 
>> column.now we have to create table 2 where user will select whild field id 
>> he want to select .suppose if user wants to create primary key then it will 
>> select field 1 in second table so it is refered from main table.and then 
>> table is created do you know how this works in django from backend side
>>
>> -- 
>> You received this message because you are subscribed 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/24b3cec9-f614-4592-a1de-e69f2a71bc3fn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/24b3cec9-f614-4592-a1de-e69f2a71bc3fn%40googlegroups.com?utm_medium=email&utm_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/104d78f3-3aa0-4962-a640-d4a59eca717fn%40googlegroups.com.


Dynamic Table

2023-05-23 Thread Helly Modi
I have to create dynamic table at runtime where user enters the details of 
table name,table column,table fields,constraints.take this input in backend 
and create table dynamically without creating schemas of tables as tables 
are created at runtime .first approach is that we will create one table 
where all the fields are mentioned where primary key,secondary 
key,unique,not niull and all the constraints are mentioned in horizontal 
column.now we have to create table 2 where user will select whild field id 
he want to select .suppose if user wants to create primary key then it will 
select field 1 in second table so it is refered from main table.and then 
table is created do you know how this works in django from backend side

-- 
You received this message because you are subscribed to the Google Groups 
"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/24b3cec9-f614-4592-a1de-e69f2a71bc3fn%40googlegroups.com.


Re: dynamic django tables

2023-05-22 Thread Helly Modi
I have to create api where user can select the column and type and other 
argument and it will create table in database in django.now here we can't 
use models .so we have to create tables dynamically at run time.so first i 
use django dynamic model in order to create table .it created table in 
database but when we try to do other operation such as getting all the 
details of table .it is not working.for fetching the data i have used Get 
method by providing table name from user in api but in the output it shows 
table does not exist even if table is present.sometime it shows table but 
sometime it desn't show.Is there any other approach.please help

from django.db import models, connection
from django.http import JsonResponse
from rest_framework.views import APIView
from rest_framework.response import Response
from django.apps import apps
from.serializers import CreateTableSerializer

FIELD_TYPE = {
'char': models.CharField,
'integer': models.IntegerField,
'boolean': models.BooleanField,
'email': models.EmailField,
'text': models.TextField,
'float': models.FloatField,
'file': models.FileField,
'date': models.DateTimeField
}


class CreateTableAPIView(APIView):
def post(self, request):
serializer = CreateTableSerializer(data=request.data)
serializer.is_valid(raise_exception=True)

table_name = serializer.validated_data['table_name']
fields = serializer.validated_data['fields']
primary_key_field = serializer.validated_data.get('primary_key') # Retrieve 
the primary key field name

# Create a dynamic model class
dynamic_model_attrs = {'__module__': __name__}
dynamic_model_fields = {}

for field in fields:
field_name = field['name']
field_type = field['type']
max_length = field.get('max_length', 255)

if field_type in FIELD_TYPE:
field_class = FIELD_TYPE[field_type](max_length=max_length)
dynamic_model_fields[field_name] = field_class

if primary_key_field:
# Check if the specified primary key field exists in the fields list
if primary_key_field in dynamic_model_fields:
dynamic_model_fields[primary_key_field].primary_key = True
else:
return Response(f'The specified primary key field "{primary_key_field}" 
does not exist in the fields list.')

dynamic_model_attrs.update(dynamic_model_fields)
dynamic_model = type(table_name, (models.Model,), dynamic_model_attrs)

# Create the database table for the dynamic model
with connection.schema_editor() as schema_editor:
schema_editor.create_model(dynamic_model)

# Register the dynamic model with the app
apps.all_models['Tables'][table_name] = dynamic_model

return Response(f'Table "{table_name}" created successfully!')


class GetTableDataAPIView(APIView):
def get(self, request, table_name):
try:
# Get the dynamic model class
dynamic_model = apps.get_model('Tables', table_name)
print(table_name)
except LookupError:
return JsonResponse({'message': f'Table "{table_name}" does not exist.'}, 
status=404)

# Retrieve all data from the dynamic table
table_data = dynamic_model.objects.all().values()
print(table_data)

return JsonResponse({'table_name': table_name, 'data': list(table_data)})

On Monday, May 22, 2023 at 11:37:52 AM UTC+5:30 Sebastian Jung wrote:

Hello,

I take everytime a EAV implementation for this task. Hete a manual: 
https://django-eav2.readthedocs.io/en/latest/

I hope this helps you

Helly Modi  schrieb am Fr., 19. Mai 2023, 14:59:

How to create dynamic models in django rest framework?

Is there any chance to create dynamic models with APIs

 

Any examples please send me thanks in advance..

 

1) Requirement is need create table name and fields in frontend

2) we are  getting the data and store in to the db create db structure

3) get the table name and fields create table in backend &postgresql store 
to

4)this code don't update or add into the models 

5)store the data into the tables 

-- 

You received this message because you are subscribed 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/72d09483-5129-43e1-bdbb-7b92969d97c4n%40googlegroups.com
 
<https://groups.google.com/d/msgid/django-users/72d09483-5129-43e1-bdbb-7b92969d97c4n%40googlegroups.com?utm_medium=email&utm_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/6d8d453a-0dbd-4b66-a8aa-fa78a3718febn%40googlegroups.com.


Re: dynamic django tables

2023-05-21 Thread Helly Modi
This is my code and it worked in creating tables but here django provides
26 fields and many relation how can i include all ? If else become too
complex .Is there any other way to do this

On Mon, May 22, 2023 at 10:49 AM Helly Modi  wrote:

> class CreateTableAPIView(APIView):
> def post(self, request):
> serializer = CreateTableSerializer(data=request.data)
> serializer.is_valid(raise_exception=True)
>
> table_name = serializer.validated_data['table_name']
> fields = serializer.validated_data['fields']
>
> # Create a dynamic model class
> dynamic_model_attrs = {'__module__': __name__}
> for field in fields:
> field_name=field['name']
> field_type=field['type']
> max_length=field.get('max_length',255)
>
> if field_type=='char':
> field_class=models.CharField(max_length=max_length)
> elif field_type== 'integer':
> field_class=models.IntegerField()
> elif field_type=='boolean':
> field_class=models.BooleanField()
> else:
> field_class=models.EmailField()
> dynamic_model_attrs[field_name]=field_class
>
>
> dynamic_model = type(table_name, (models.Model,), dynamic_model_attrs)
>
> # Create the database table for the dynamic model
> with connection.schema_editor() as schema_editor:
> schema_editor.create_model(dynamic_model)
>
> # Register the dynamic model with the app
> apps.all_models['dynamic_tables_app'][table_name] = dynamic_model
>
> return Response(f'Table "{table_name}" created successfully!')
>
>
> On Fri, May 19, 2023 at 6:40 PM Brian Gitau 
> wrote:
>
>> which code do you have or you want the code example explaining everything?
>>
>>
>> On Fri, May 19, 2023 at 3:59 PM Helly Modi  wrote:
>>
>>> How to create dynamic models in django rest framework?
>>>
>>> Is there any chance to create dynamic models with APIs
>>>
>>>
>>>
>>> Any examples please send me thanks in advance..
>>>
>>>
>>>
>>> 1) Requirement is need create table name and fields in frontend
>>>
>>> 2) we are  getting the data and store in to the db create db structure
>>>
>>> 3) get the table name and fields create table in backend &postgresql
>>> store to
>>>
>>> 4)this code don't update or add into the models
>>>
>>> 5)store the data into the tables
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "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/72d09483-5129-43e1-bdbb-7b92969d97c4n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/72d09483-5129-43e1-bdbb-7b92969d97c4n%40googlegroups.com?utm_medium=email&utm_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/CAMJ3z%3D3Qn0n%2BHVefJg_B6R9RQABA88C4whqbn0g3ygo4k0gkMw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAMJ3z%3D3Qn0n%2BHVefJg_B6R9RQABA88C4whqbn0g3ygo4k0gkMw%40mail.gmail.com?utm_medium=email&utm_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/CAO-ToNUai69i86uMD6-Z%2BSZha9DpjHSSbNFBGcwpf19N4eEtnw%40mail.gmail.com.


Re: dynamic django tables

2023-05-21 Thread Helly Modi
class CreateTableAPIView(APIView):
def post(self, request):
serializer = CreateTableSerializer(data=request.data)
serializer.is_valid(raise_exception=True)

table_name = serializer.validated_data['table_name']
fields = serializer.validated_data['fields']

# Create a dynamic model class
dynamic_model_attrs = {'__module__': __name__}
for field in fields:
field_name=field['name']
field_type=field['type']
max_length=field.get('max_length',255)

if field_type=='char':
field_class=models.CharField(max_length=max_length)
elif field_type== 'integer':
field_class=models.IntegerField()
elif field_type=='boolean':
field_class=models.BooleanField()
else:
field_class=models.EmailField()
dynamic_model_attrs[field_name]=field_class


dynamic_model = type(table_name, (models.Model,), dynamic_model_attrs)

# Create the database table for the dynamic model
with connection.schema_editor() as schema_editor:
schema_editor.create_model(dynamic_model)

# Register the dynamic model with the app
apps.all_models['dynamic_tables_app'][table_name] = dynamic_model

return Response(f'Table "{table_name}" created successfully!')


On Fri, May 19, 2023 at 6:40 PM Brian Gitau  wrote:

> which code do you have or you want the code example explaining everything?
>
>
> On Fri, May 19, 2023 at 3:59 PM Helly Modi  wrote:
>
>> How to create dynamic models in django rest framework?
>>
>> Is there any chance to create dynamic models with APIs
>>
>>
>>
>> Any examples please send me thanks in advance..
>>
>>
>>
>> 1) Requirement is need create table name and fields in frontend
>>
>> 2) we are  getting the data and store in to the db create db structure
>>
>> 3) get the table name and fields create table in backend &postgresql
>> store to
>>
>> 4)this code don't update or add into the models
>>
>> 5)store the data into the tables
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "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/72d09483-5129-43e1-bdbb-7b92969d97c4n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/72d09483-5129-43e1-bdbb-7b92969d97c4n%40googlegroups.com?utm_medium=email&utm_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/CAMJ3z%3D3Qn0n%2BHVefJg_B6R9RQABA88C4whqbn0g3ygo4k0gkMw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMJ3z%3D3Qn0n%2BHVefJg_B6R9RQABA88C4whqbn0g3ygo4k0gkMw%40mail.gmail.com?utm_medium=email&utm_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/CAO-ToNXbuBKUJ0uVeRSnUNv4NUFMPCT3bZ-y86zVMcVFa5oYrg%40mail.gmail.com.


dynamic django tables

2023-05-19 Thread Helly Modi


How to create dynamic models in django rest framework?

Is there any chance to create dynamic models with APIs

 

Any examples please send me thanks in advance..

 

1) Requirement is need create table name and fields in frontend

2) we are  getting the data and store in to the db create db structure

3) get the table name and fields create table in backend &postgresql store 
to

4)this code don't update or add into the models 

5)store the data into the tables 

-- 
You received this message because you are subscribed to the Google Groups 
"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/72d09483-5129-43e1-bdbb-7b92969d97c4n%40googlegroups.com.


Re: Django tutorial part 3: Always shows raw HTML

2012-09-17 Thread Helly
I am SO SORRY, and in the future I promise to wait at least a week before 
posting my problems to see if I can figure it out in the meantime. I fixed 
this by saving the file in TextWrangler instead of TextEdit, and now it 
interprets the HTML properly. If anyone knows *why* this fixes the problem, 
I would still appreciate your insight, but it appears that I have fixed the 
main issue for now.

On Monday, September 17, 2012 3:02:20 PM UTC-4, Helly wrote:
>
> I'm currently going through the Django tutorial, and everything was going 
> perfectly smoothly until the template part. This is what I always get for 
> the polls/index.html:
>
> http://pastebin.com/ng9iGNRp
>
> I noticed that it gets everything right (the {{ poll.id }} is 1, there's 
> no other error) but just doesn't seem to "understand" html.
>
> The only answer I found related to this problem mentioned autoescaping.
>
> So I added the {% autoescape off %} {% endautoescape %} tags to the 
> index.html template (this is my polls/index.html, btw):
>  
> http://pastebin.com/tzzamJSf
>
> But, it didn't fix the problem. I have tried this template without those 
> tags, with autoescape on, and with the tags in various different positions. 
> Changing the tags around moves the text around a little bit, does nothing, 
> or produces a syntax error. I also tried it with the render_to_response() 
> shortcut, and it still displayed the same, raw HTML.
>
> When I Google this, other answers mostly regard what to do if you do want 
> the raw html to show up. Also, it doesn't really make sense for the default 
> to be leaving my HTML hanging out for everyone to see.
>
> This is my views.py: http://pastebin.com/74t5PMgj
>
> urls.py: http://pastebin.com/BSRXUWpH
>
> I didn't experiment at all. They are exactly what is written in the 
> tutorial. I am on Mac OS X 10.7.4, Django 1.4.1, Python 2.7.1. I am just 
> doing the tutorial on my localhost (127.0.0.1:8000). What is going on? 
> Normally, I can load HTML to my browser just fine. I'm very new to this so 
> I could absolutely be missing something totally obvious. Any help would be 
> greatly appreciated! In the meantime, I will keep trying at this.
>

-- 
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/-/pPpt3enw-bwJ.
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 tutorial part 3: Always shows raw HTML

2012-09-17 Thread Helly
I'm currently going through the Django tutorial, and everything was going 
perfectly smoothly until the template part. This is what I always get for 
the polls/index.html:

http://pastebin.com/ng9iGNRp

I noticed that it gets everything right (the {{ poll.id }} is 1, there's no 
other error) but just doesn't seem to "understand" html.

The only answer I found related to this problem mentioned autoescaping.

So I added the {% autoescape off %} {% endautoescape %} tags to the 
index.html template (this is my polls/index.html, btw):
 
http://pastebin.com/tzzamJSf

But, it didn't fix the problem. I have tried this template without those 
tags, with autoescape on, and with the tags in various different positions. 
Changing the tags around moves the text around a little bit, does nothing, 
or produces a syntax error. I also tried it with the render_to_response() 
shortcut, and it still displayed the same, raw HTML.

When I Google this, other answers mostly regard what to do if you do want 
the raw html to show up. Also, it doesn't really make sense for the default 
to be leaving my HTML hanging out for everyone to see.

This is my views.py: http://pastebin.com/74t5PMgj

urls.py: http://pastebin.com/BSRXUWpH

I didn't experiment at all. They are exactly what is written in the 
tutorial. I am on Mac OS X 10.7.4, Django 1.4.1, Python 2.7.1. I am just 
doing the tutorial on my localhost (127.0.0.1:8000). What is going on? 
Normally, I can load HTML to my browser just fine. I'm very new to this so 
I could absolutely be missing something totally obvious. Any help would be 
greatly appreciated! In the meantime, I will keep trying at this.

-- 
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/-/nMbN_S0NvocJ.
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: Newbie, trying [read: failing] to set up Django

2012-09-16 Thread Helly

wow

I'm really glad I embarrassed myself on the whole internet.

Thanks for answering with zero condescension. I am going to try to install 
this today.

-- 
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/-/0DICy1u6SmMJ.
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.



Newbie, trying [read: failing] to set up Django

2012-09-15 Thread Helly
Hello all,

I've been trying to set up Django for quite some time now. I'm on Mac OS X 
Lion 10.7.4. As to my level of expertise, let's just say I'm pretty new 
to...computers. I guess I figured I'd just stumble around until it worked. 
How hard could it be right? Wrong. It seems like you all don't mind helping 
out newbies though, so I thought I'd give this a shot.

I'm running into problems with synchronizing Django with my database. I 
installed MySQL and MySQLdb. I created a database and edited the 
settings.py file according to instructions in the tutorial. However, I 
couldn't get it to work with the python manage.py syncdb command due to an 
"architecture" error. Keep in mind that I had, at this point, spent a 
really long time trying to set these babies up, and this is what finally 
stumped me.

So, I told MySQL and MySQLdb that I was taking my ball home if that's how 
they wanted to play. I downloaded and installed Homebrew, Macports, and 
postgreSQL (through Homebrew) with minimal fumbling. There was one error 
with my PATH but I fixed it in my .bash_profile. As per the advice of the 
internet and Homebrew's brew doctor, I amended "PATH so that 
/usr/local/bin occurs before /usr/bin." This allowed me to start up psql 
and create a database - at least it seemed like it worked, there was no 
satisfying little message about its dimensions like in MySQL.

Anyhoo, now when I do python manage.py runserver or python manage.py syncdb 
it tells me lots of stuff and "ImportError: No module named 
psycopg2.extensions." What does this mean, and how do I fix it? I am 
totally at a loss.

I'm sorry if the way I posed the question is long/confusing, but I wasn't 
really sure what information would be important. I can post the whole 
output from the terminal if it's helpful. It's really long though, and I 
had a hunch the last part is the important part. Any help would be greatly 
appreciated.

Thanks

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