DJANGO app loose path from batch file

2017-11-06 Thread Xristos Xristoou


I try to learn more about Django celery and rabbitmq to create some async 
tasks and I have some question.

Some programs can provide PYTHON API to can some development to use modules 
from this program in python.

one most way to take that PYTHON API from this program is to use batch file 
like this :

@echo off
SET PROGRAM_ROOT=C:\main-folder
call "%PROGRAM_ROOT%"\bin\some-batch-file.bat

SET PYCHARM="C:\Program Files\JetBrains\PyCharm 2017.1.5\bin\pycharm64.exe"

set PYTHONPATH=%PYTHONPATH%;%PROGRAM_ROOT%\python;
set PYTHONPATH=%PYTHONPATH%;%PROGRAM_ROOT%\site-packages;


start "PyCharm aware of PROGRAM" /B %PYCHARM% %*

if I run this batch file can I use all imports and modules from this 
program.

that to release if add celery in my app and broker url rabbitmq server then 
if i use some module or some import from this python api then I take error 
message : no module name some_module_from_program (for all other modules 
celery and rabbitmq app work fine).

that mean in celery and rabbitmq server loose that paths from batch file 
and I take this error.

my question how to can define rabbitmq server to start server with that 
paths like batch file before to avoid this error?

-- 
You received this message because you are subscribed to the Google Groups 
"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/8205be0a-6a15-4ce1-8347-fbaed9fe7989%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO app loose path from batch file

2017-11-06 Thread Xristos Xristoou


i am windows user

-- 
You received this message because you are subscribed to the Google Groups 
"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/007d0f8d-d6f0-4c3e-9245-ad7a72b15551%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


geodjango error

2016-06-16 Thread Xristos Xristoou
hello i want to use geos for one project.
i have install successful gdal and leaflet and djgeojson.
i try to open manage.py and show me that error :

point import sqlite3_create_function_v2 not
find in library dynamic connection c:programs files 
(x86)\GDAL\spatialite.dll



any idea ?

-- 
You received this message because you are subscribed to the Google Groups 
"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/64fe1229-5007-4ddf-a47c-9b570eb7e609%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: geodjango error

2016-06-16 Thread Xristos Xristoou


Τη Πέμπτη, 16 Ιουνίου 2016 - 11:52:55 μ.μ. UTC+3, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello i want to use geos for one project.
> i have install successful gdal and leaflet and djgeojson.
> i try to open manage.py and show me that error :
>
> point import sqlite3_create_function_v2 not
> find in library dynamic connection c:programs files 
> (x86)\GDAL\spatialite.dll
>
> INSTALLED_APPS = [
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'django.contrib.gis',
> 'leaflet',
> 'djgeojson'
>
>
>
> any idea ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/2e1228b3-aac3-486b-8d50-9fc295e5a7e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


choices field language

2016-06-20 Thread Xristos Xristoou
hello i want to use choices in my field but not work if i write in my 
language(greek) only work in the england language.
if i writing choices in my language show me error message in the admin mode 
(this choose is not valid),any idea how to fix that ?i have python 2.7

-- 
You received this message because you are subscribed to the Google Groups 
"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/5bfdb5b9-e286-40e1-aa8b-2a0e68878204%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


DJANGO images(upload/download)

2017-02-02 Thread Xristos Xristoou


who is the better method to take images from uses(visitors)on the fly on my 
web site and to return the new images(with some processing) back to users 
using DJANGO?

i am new i dont know how to connect my python script with the html 
templates to take the images and how to return. 

for example my script take images paths to processing new images with new 
paths. a simple image classification with GDAL :


# Input file name (thermal image)
src = "thermal.tif"
# Output file name
tgt = "classified.jpg"
# Load the image into numpy using gdal
srcArr = gdalnumeric.LoadFile(src)
# Split the histogram into 20 bins as our classes
classes = gdalnumeric.numpy.histogram(srcArr, bins=20)[1]
# Color look-up table (LUT) - must be len(classes)+1.# Specified as R,G,B 
tuples 
lut = 
[[255,0,0],[191,48,48],[166,0,0],[255,64,64],[255,115,115],[255,116,0],[191,113,48],[255,178,115],[0,153,153],[29,115,115],[0,99,99],[166,75,0],[0,204,0],[51,204,204],[255,150,64],[92,204,204],[38,153,38],
\ [0,133,0],[57,230,57],[103,230,103],[184,138,0]]
# Starting value for classification
start = 1
# Set up the RGB color JPEG output image
rgb = gdalnumeric.numpy.zeros((3, srcArr.shape[0],
srcArr.shape[1],), gdalnumeric.numpy.float32)
# Process all classes and assign colorsfor i in range(len(classes)):
mask = gdalnumeric.numpy.logical_and(start <= \
 srcArr, srcArr <= classes[i])
for j in range(len(lut[i])):
  rgb[j] = gdalnumeric.numpy.choose(mask, (rgb[j], \ lut[i][j]))
start = classes[i]+1 
# Save the image
gdalnumeric.SaveArray(rgb.astype(gdalnumeric.numpy.uint8), \
tgt, format="JPEG")


This script takes image input src a take new image with classification. but i 
dont know how to programming the post,get and image output from the python 
script in html form template .

i know to change python script in Django to can run i html template maybe for 
the input like this variable = request.POST.get('variable', False) and the 
output image like this return render_to_response ('blog/calc.html', {'variable' 
:variable,

but i dont have experience with this and i dont know if this method is better 
or no.


can i have django form without files upload to save samoe path ?


-- 
You received this message because you are subscribed to the Google Groups 
"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/12569464-369a-4918-9729-db6380439440%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


take select request from django from

2017-04-16 Thread Xristos Xristoou
 

hello i have create a select django form with list of images for per user.

How to take that select request in my views.py ?

i have success only to create correct that select list but i need take that 
select request but i dont know how.

models.py

class MyModel(models.Model):
user = models.ForeignKey(User, unique=True)
upload = models.ImageField(upload_to='upload')

views.py

   @login_required(login_url="login/")
def carlist(request):
Myform = MyModelForm(user=request.user)
return render(request,'about.html',{'Myform':Myform})

select django form :

class MyModelForm(ModelForm):
def __init__(self, *args, **kwargs):
# extract "user" from kwrags (passed upon form init)
if 'user' in kwargs:
self.user = kwargs.pop('user')
super(MyModelForm, self).__init__(*args, **kwargs)
# generate the choices as (display, value). 
# Display is the one that'll be shown to user, value is 
# the one that'll be sent upon submitting 
# (the "value" attribute of )
choices = MyModel.objects.filter(user=self.user).values_list('upload', 
'id')
self.fields['upload'].widget = Select(choices=choices)

class Meta:
model = MyModel
fields = ('upload',)

html :

{% 
csrf_token %}
  {{ Myform}}

for example Myform now have a list of user images that is correct but after 
from that i need the select images from the form.

can do it that with my code or not ?

-- 
You received this message because you are subscribed to the Google Groups 
"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/f9238e66-6174-4ca4-bcae-ae83dd9e7e74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django project avoid reload page where work algorithm

2017-10-08 Thread Xristos Xristoou


hello

i need some help
I have a website where the user can be put three numbers on my html 
template and get some results from my personal mathematical algorithm. the 
result save at user personal table on my database and can see in specific 
tab in my website.

my problem is where the algorithm to calculate result maybe take time 
between 5-10 minutes in this time the browser stay on reload. if user 
change tab or close browser or maybe have problem with internet connection 
then loose that request and need again to put the numbers and again wait 
for results.

I want after the user request from my form in html to keep this request and 
work my algorithm without reload the page and where the algorithm finish 
then to send the user some email or message or just need the user visit the 
tab of results to see new results.

that I want to avoid the problems where the algorithm is in running and 
user loose data or request or time.

is easy to do that using suproccess,celery or RabbitMQ ?

any idea ?

here the code


views.py

def math_alg(request):
if request.method == "POST":
test = request.POST.get('no1')
test = request.POST.get('no3')
test = request.POST.get('no3')
#start algorith
calc_math(no1,no1,no3,result)
instance = rmodel.objects.create(user=request.user,rfield=result)
instance.save
return render(request, 'page.html', {'result': result})

html :

{% csrf_token %}
  op math calculate:
  
  
  

  
{{result }}


-- 
You received this message because you are subscribed to the Google Groups 
"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/86fc72c5-6dcc-4734-8f1d-1e187b1d93f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django project avoid reload page where work algorithm

2017-10-08 Thread Xristos Xristoou
how first to can avoid long reload ?

Τη Κυριακή, 8 Οκτωβρίου 2017 - 4:09:37 μ.μ. UTC+3, ο χρήστης Jani Tiainen 
έγραψε:
>
> Hi.
>
> For long running operatios celery tasks are pretty good choice. Celery can 
> use rabbitmq as messaging queue so those two aren't mutually exclusive.
>
> Once you have task running it is possible to use for example ajax polling 
> to query status of the task and once complete inform end user that task is 
> complete.
>
> Or you can send email at the end of the task.
>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"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/ef60530e-92c5-48a9-8f0f-266a5942a6f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django project avoid reload page where work algorithm

2017-10-08 Thread Xristos Xristoou




> In the background celery worker picks your task and executes it. It 
> doesn't matter how long that takes. Once task is completed worker waits for 
> next task.
>
> Every task gets id which you can return to frontend and then for example 
> using ajax call you could query if task is ready and inform user about 
> progress or completition.
>
>
>> can you show some example with my code ?is easy to bulid ? 

-- 
You received this message because you are subscribed to the Google Groups 
"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/3b5700e0-1c55-42e6-9970-df01c02e30c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django-embed-video error Unresolved tag 'video'

2016-01-15 Thread Xristos Xristoou

0down votefavorite 


i want to create a video from youtube url in the django using embed-video
1.step install embed-video

pip install django-embed-video


   1. step

Add embed_video to INSTALLED_APPS in your Django settings.

TEMPLATE_CONTEXT_PROCESSORS = (...'django.core.context_processors.request',)

3.step my model.py

from django.db import modelsfrom embed_video.fields import EmbedVideoField
class Item(models.Model):
video = EmbedVideoField()  # same like models.URLField()

4.step admin .py

class MyModelAdmin(AdminVideoMixin, admin.ModelAdmin):
pass

admin.site.register(MyModelAdmin)

5.step html tags

{% load embed_video_tags %}
the video tag:{% video item.video as my_video %}
  URL: {{ my_video.url }}
  Thumbnail: {{ my_video.thumbnail }}
  Backend: {{ my_video.backend }}

  {% video my_video "large" %}{% endvideo %}

in the 5 step show me error Unresolved tag 'video'

why have error ? i follow the docs embed-video

-- 
You received this message because you are subscribed to the Google Groups 
"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/61be42eb-e98a-407c-82ba-6414d8517a7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-embed-video error Unresolved tag 'video'

2016-01-15 Thread Xristos Xristoou
yeah i thing so using django 1.9 help me pls

Τη Παρασκευή, 15 Ιανουαρίου 2016 - 8:25:14 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
>
> 0down votefavorite 
> <http://stackoverflow.com/questions/34780182/django-embed-video-error-unresolved-tag-video#>
>
> i want to create a video from youtube url in the django using embed-video
> 1.step install embed-video
>
> pip install django-embed-video
>
>
>1. step
>
> Add embed_video to INSTALLED_APPS in your Django settings.
>
> TEMPLATE_CONTEXT_PROCESSORS = (...'django.core.context_processors.request',)
>
> 3.step my model.py
>
> from django.db import modelsfrom embed_video.fields import EmbedVideoField
> class Item(models.Model):
> video = EmbedVideoField()  # same like models.URLField()
>
> 4.step admin .py
>
> class MyModelAdmin(AdminVideoMixin, admin.ModelAdmin):
> pass
>
> admin.site.register(MyModelAdmin)
>
> 5.step html tags
>
> {% load embed_video_tags %}
> the video tag:{% video item.video as my_video %}
>   URL: {{ my_video.url }}
>   Thumbnail: {{ my_video.thumbnail }}
>   Backend: {{ my_video.backend }}
>
>   {% video my_video "large" %}{% endvideo %}
>
> in the 5 step show me error Unresolved tag 'video'
>
> why have error ? i follow the docs embed-video
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/44ecce45-b2fe-4fd6-bb6c-a0d8eb20ee1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-embed-video error Unresolved tag 'video'

2016-01-15 Thread Xristos Xristoou
now if i  delete  {% video my_video "large" %} not show me error again but 
nor show me and video is empty for my template .
and again show me this 


django 1.8.7 finaly that my version.

>

-- 
You received this message because you are subscribed to the Google Groups 
"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/b8f496dd-2307-4c59-9b81-c6bd6fc1179e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-embed-video error Unresolved tag 'video'

2016-01-15 Thread Xristos Xristoou

>
> and i have DEBUG toolbar if you help you 
>

SettingValueABSOLUTE_URL_OVERRIDES{}ADMINS()ALLOWED_HOSTS[]
ALLOWED_INCLUDE_ROOTS()APPEND_SLASHTrueAUTHENTICATION_BACKENDS
('django.contrib.auth.backends.ModelBackend',)AUTH_USER_MODEL'auth.User'
BASE_DIR'C:\\Users\\LG\\PycharmProjects\\new'CACHES{'default': {'BACKEND': 
'django.core.cache.backends.locmem.LocMemCache'}}CACHE_MIDDLEWARE_ALIAS
'default'CACHE_MIDDLEWARE_KEY_PREFIX''
CACHE_MIDDLEWARE_SECONDS600CONFIG_DEFAULTS{'RESULTS_CACHE_SIZE': 3, 
'SHOW_COLLAPSED': True, 'SQL_WARNING_THRESHOLD': 100}CSRF_COOKIE_AGE31449600
CSRF_COOKIE_DOMAINNoneCSRF_COOKIE_HTTPONLYFalseCSRF_COOKIE_NAME'csrftoken'
CSRF_COOKIE_PATH'/'CSRF_COOKIE_SECUREFalseCSRF_FAILURE_VIEW
'django.views.csrf.csrf_failure'DATABASES{'default': {'ATOMIC_REQUESTS': 
False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 
'django.db.backends.sqlite3', 'HOST': '', 'NAME': 
'C:\\Users\\LG\\PycharmProjects\\new\\db.sqlite3', 'OPTIONS': {}, 
'PASSWORD': '', 'PORT': '', 'TEST': {'CHARSET': None, 
'COLLATION': None, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': 'UTC', 
'USER': ''}}DATABASE_ROUTERS[]DATETIME_FORMAT'N j, Y, P'
DATETIME_INPUT_FORMATS('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f', 
'%Y-%m-%d %H:%M', '%Y-%m-%d', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', 
'%m/%d/%Y %H:%M', '%m/%d/%Y', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', 
'%m/%d/%y %H:%M', '%m/%d/%y')DATE_FORMAT'N j, Y'DATE_INPUT_FORMATS('%Y-%m-%d', 
'%m/%d/%Y', '%m/%d/%y', '%b %d %Y', '%b %d, %Y', '%d %b %Y', '%d %b, %Y', 
'%B %d %Y', '%B %d, %Y', '%d %B %Y', '%d %B, %Y')DEBUGTrue
DEBUG_PROPAGATE_EXCEPTIONSFalseDEBUG_TOOLBAR_PANELS['debug_toolbar.panels.versions.VersionsPanel',
 
'debug_toolbar.panels.timer.TimerPanel', 
'debug_toolbar.panels.settings.SettingsPanel', 
'debug_toolbar.panels.headers.HeadersPanel', 
'debug_toolbar.panels.request.RequestPanel', 
'debug_toolbar.panels.sql.SQLPanel', 
'debug_toolbar.panels.staticfiles.StaticFilesPanel', 
'debug_toolbar.panels.templates.TemplatesPanel', 
'debug_toolbar.panels.cache.CachePanel', 
'debug_toolbar.panels.signals.SignalsPanel', 
'debug_toolbar.panels.logging.LoggingPanel', 
'debug_toolbar.panels.redirects.RedirectsPanel']DEBUG_TOOLBAR_PATCH_SETTINGS
TrueDECIMAL_SEPARATOR'.'DEFAULT_CHARSET'utf-8'DEFAULT_CONTENT_TYPE
'text/html'DEFAULT_EXCEPTION_REPORTER_FILTER
'django.views.debug.SafeExceptionReporterFilter'DEFAULT_FILE_STORAGE
'django.core.files.storage.FileSystemStorage'DEFAULT_FROM_EMAIL
'webmaster@localhost'DEFAULT_INDEX_TABLESPACE''DEFAULT_TABLESPACE''
DISALLOWED_USER_AGENTS()EMAIL_BACKEND
'django.core.mail.backends.smtp.EmailBackend'EMAIL_HOST'localhost'
EMAIL_HOST_PASSWORD''EMAIL_HOST_USER''EMAIL_PORT25
EMAIL_SSL_CERTFILENoneEMAIL_SSL_KEYFILE''
EMAIL_SUBJECT_PREFIX'[Django] 'EMAIL_TIMEOUTNoneEMAIL_USE_SSLFalse
EMAIL_USE_TLSFalseFILE_CHARSET'utf-8'FILE_UPLOAD_DIRECTORY_PERMISSIONSNone
FILE_UPLOAD_HANDLERS('django.core.files.uploadhandler.MemoryFileUploadHandler', 
'django.core.files.uploadhandler.TemporaryFileUploadHandler')
FILE_UPLOAD_MAX_MEMORY_SIZE2621440FILE_UPLOAD_PERMISSIONSNone
FILE_UPLOAD_TEMP_DIRNoneFIRST_DAY_OF_WEEK0FIXTURE_DIRS()FORCE_SCRIPT_NAME
NoneFORMAT_MODULE_PATHNoneIGNORABLE_404_URLS()INSTALLED_APPS('django.contrib.admin',
 
'django.contrib.auth', 'django.contrib.contenttypes', 
'django.contrib.sessions', 'django.contrib.messages', 
'django.contrib.staticfiles', 'django_markdown', 'blog', 'embed_video', 
'debug_toolbar')INTERNAL_IPS('127.0.0.1',)LANGUAGES(('af', 'Afrikaans'), 
('ar', 'Arabic'), ('ast', 'Asturian'), ('az', 'Azerbaijani'), ('bg', 
'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'), ('br', 'Breton'), 
('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), 
('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), 
('en-au', 'Australian English'), ('en-gb', 'British English'), ('eo', 
'Esperanto'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), 
('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('es-ve', 
'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 
'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'), ('ga', 
'Irish'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 
'Croatian'), ('hu', 'Hungarian'), ('ia', 'Interlingua'), ('id', 
'Indonesian'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), 
('ja', 'Japanese'), ('ka', 'Georgian'), ('kk', 'Kazakh'), ('km', 'Khmer'), 
('kn', 'Kannada'), ('ko', 'Korean'), ('lb', 'Luxembourgish'), ('lt', 
'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 
'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'), 
('nb', 'Norwegian Bokmal'), ('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 
'Norwegian Nynorsk'), ('os', 'Ossetic'), ('pa', 'Punjabi'), ('pl', 
'Polish'), ('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'), ('ro', 
'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'),

post view and categories views

2016-01-16 Thread Xristos Xristoou
i want to create one view only with *post list* and *categories list* on my 
main page template html.
the categories is a new class with colum title and is many to many 
relatioship to my *post class.*






*class Category(models.Model):cattitle = 
models.CharField(max_length=1,choices=CATEGORY_CHOICES)class 
Movies(models.Model):Title = 
models.CharField(max_length=100,blank=True)category = 
models.ManyToManyField(Category)*
can somebody to help with an example

and i want to use for that generic display views,list views and details 
views but is option not necerery

-- 
You received this message because you are subscribed to the Google Groups 
"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/fe80ea06-46c0-4397-a35a-dca9f0e111b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django categories views(error page not found)

2016-01-18 Thread Xristos Xristoou


my task is to create on main page of my web site two list one list for my 
post and second list categories titles which belong my post. i create that 
and work fine,and i create post details connect and again work fine. but i 
cant to work category details if i want to see list from my post which 
belong specific category i cant show me error page not found.


my code


my model

class Category(models.Model):
 categorytitle =models.CharField(max_length=1,choices=CAT_CHOICES,unique=True)
 slug= models.SlugField()

class Posts(models.Model):
Title = models.CharField(max_length=100,blank=True)
slug= models.SlugField()
category = models.ManyToManyField(Category)


my view category


def view_category(request, slug):
category = get_object_or_404(Category, slug=slug)return 
render_to_response('blog/view_category.html', {
'category': category,
'posts': Posts.objects.filter(category=category)})


my urls category


url(r'^(?P[^\.]+)/$', views.view_category, name='view_category'),

-- 
You received this message because you are subscribed to the Google Groups 
"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/b206b8e0-3fd5-47ab-80e2-99a06806ad97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django categories views(error page not found)

2016-01-18 Thread Xristos Xristoou


> my task is to create on main page of my web site two list one list for my 
> post and second list categories titles which belong my post. i create that 
> and work fine,and i create post details connect and again work fine. but i 
> cant to work category details if i want to see list from my post which 
> belong specific category i cant show me error page not found.
>
>
> my code
>
>
> my model
>
> class Category(models.Model):
>  categorytitle =models.CharField(max_length=1,choices=CAT_CHOICES,unique=True)
>  slug= models.SlugField()
>
> class Posts(models.Model):
> Title = models.CharField(max_length=100,blank=True)
> slug= models.SlugField()
> category = models.ManyToManyField(Category)
>
>
> my view category
>
>
> def view_category(request, slug):
> category = get_object_or_404(Category, slug=slug)return 
> render_to_response('blog/view_category.html', {
> 'category': category,
> 'posts': Posts.objects.filter(category=category)})
>
>
> my urls category
>
>
> url(r'^(?P[^\.]+)/$', views.view_category, name='view_category'),
>
>

{% for category in categories %}
{{ category.categorytitle }}

{% endfor %} 

-- 
You received this message because you are subscribed to the Google Groups 
"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/6a7d043e-a53d-42af-88bc-c56483469686%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django categories views(error page not found)

2016-01-18 Thread Xristos Xristoou
Page not found (404)Request Method:GETRequest URL:
http://127.0.0.1:8000/category1/Raised by:blog.views.view_post

No Movies matches the given query.

-- 
You received this message because you are subscribed to the Google Groups 
"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/2787d34e-bcd3-44be-816d-46d0cbc87411%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


regular expression confusion

2016-01-19 Thread Xristos Xristoou
hello,

i have a regular expression confusion error i cant work my app with 
together 2 and 3 line from *my blog/**urls *if i work regardless that lines 
work fine
but i need together for my project.

*my mysite/urls*

url(r'^admin/', include(admin.site.urls)),
url(r'', include('blog.urls')),


*my blog/urls*


1  url(r'^$', views.index, name='index'),
2  url(r'^(?P[^\.]+)/$', views.view_post, name='view_post'),
3  url(r'^(?P[\w-]+)/$', views.view_category, name='view_category')




-- 
You received this message because you are subscribed to the Google Groups 
"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/11ac4eac-af33-4d5b-96e5-6b57826a06b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: regular expression confusion

2016-01-19 Thread Xristos Xristoou

>
> yeah but now must to change my template tags ? for exable 
>
>
 my first template tags

 {{*posts*.Title}}
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/d4f6aa5d-c1e9-4633-b6aa-b2de16ac4e82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: regular expression confusion

2016-01-19 Thread Xristos Xristoou

>
> yeah but now must be change mt template tags ?
>
>  

> *for example*
>
>
my first template tags from the main page to the view page

 {{movies.Title}} 

-- 
You received this message because you are subscribed to the Google Groups 
"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/7f8dbf1b-ce7a-4b38-a128-1859683d5b74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: regular expression confusion

2016-01-19 Thread Xristos Xristoou
i find it thnx for the help

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/415764cb-467f-4207-bb85-40887d1d3858%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


like query django

2016-01-19 Thread Xristos Xristoou
hello,


i want to create a query for likes in my post details

my html tags

{{movies.likes}} peaple liked this article
Like


my urls


url(r'^view/(?P[^\.]+)/$', views.view_post, name='view_post'),

url(r'^(?P[0−9]+)/$', views.like_post, name='like_post'),


my view


def like_post(request,pk=1):
 a=Movies.objects.get(pk=pk)
 count=a.likes
 count+=1
 a.likes=count
 a.save()
 return HttpResponseRedirect ( '/posts/view/%s' % pk)


but i have error not work


Page not found (404)Request Method:GETRequest URL:http://127.0.0.1:8000/like/1/

Using the URLconf defined in categories1.urls,  Django tried these URL 
patterns, in this order:   

   1. ^admin/   
   2. ^$ [name='index']   
   3. ^view/(?P[^\.]+)/$[name='view_post']   
   4. ^category/(?P[\w-]+)/$[name='view_category']   
   5. ^(?P[0−9]+)/$ [name='like_post']   
   6.  ^media\/(?P.*)$   

The current URL, like/1/, didn't match any of these.



any idea ?

-- 
You received this message because you are subscribed to the Google Groups 
"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/bd58b974-1c93-498b-a9b3-30503e209e51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: like query django

2016-01-19 Thread Xristos Xristoou
not work again florian same error again

Τη Τρίτη, 19 Ιανουαρίου 2016 - 5:35:09 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i want to create a query for likes in my post details
>
> my html tags
>
> {{movies.likes}} peaple liked this article
> Like
>
>
> my urls
>
>
> url(r'^view/(?P[^\.]+)/$', views.view_post, name='view_post'),
>
> url(r'^(?P[0−9]+)/$', views.like_post, name='like_post'),
>
>
> my view
>
>
> def like_post(request,pk=1):
>  a=Movies.objects.get(pk=pk)
>  count=a.likes
>  count+=1
>  a.likes=count
>  a.save()
>  return HttpResponseRedirect ( '/posts/view/%s' % pk)
>
>
> but i have error not work
>
>
> Page not found (404)Request Method:GETRequest 
> URL:http://127.0.0.1:8000/like/1/
>
> Using the URLconf defined in categories1.urls,  Django tried these URL 
> patterns, in this order:   
>
>1. ^admin/   
>2. ^$ [name='index']   
>3. ^view/(?P[^\.]+)/$[name='view_post']   
>4. ^category/(?P[\w-]+)/$[name='view_category']  
>  
>5. ^(?P[0−9]+)/$ [name='like_post']   
>6.  ^media\/(?P.*)$   
>
> The current URL, like/1/, didn't match any of these.
>
>
>
> any idea ?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/d649cb3c-63cc-4793-ac08-5ac8af7951ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: like query django

2016-01-19 Thread Xristos Xristoou
i follow you not work again first i cant use {% url %} show me template 
error,i thing so i am is very noob
must necesery tu urls for that ?
Τη Τρίτη, 19 Ιανουαρίου 2016 - 5:35:09 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i want to create a query for likes in my post details
>
> my html tags
>
> {{movies.likes}} peaple liked this article
> Like
>
>
> my urls
>
>
> url(r'^view/(?P[^\.]+)/$', views.view_post, name='view_post'),
>
> url(r'^(?P[0−9]+)/$', views.like_post, name='like_post'),
>
>
> my view
>
>
> def like_post(request,pk=1):
>  a=Movies.objects.get(pk=pk)
>  count=a.likes
>  count+=1
>  a.likes=count
>  a.save()
>  return HttpResponseRedirect ( '/posts/view/%s' % pk)
>
>
> but i have error not work
>
>
> Page not found (404)Request Method:GETRequest 
> URL:http://127.0.0.1:8000/like/1/
>
> Using the URLconf defined in categories1.urls,  Django tried these URL 
> patterns, in this order:   
>
>1. ^admin/   
>2. ^$ [name='index']   
>3. ^view/(?P[^\.]+)/$[name='view_post']   
>4. ^category/(?P[\w-]+)/$[name='view_category']  
>  
>5. ^(?P[0−9]+)/$ [name='like_post']   
>6.  ^media\/(?P.*)$   
>
> The current URL, like/1/, didn't match any of these.
>
>
>
> any idea ?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/24bb10c8-98a2-445d-8de2-5abf0f5a618e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Filter object by calculating duration from start and end time

2016-01-19 Thread Xristos Xristoou
can used this and for the dates fields ?

Τη Τρίτη, 19 Ιανουαρίου 2016 - 8:01:36 μ.μ. UTC+2, ο χρήστης Steven Nash 
έγραψε:
>
> Hi,
>
> Given an object such as:
>
> class Entry(models.Model):
>   start = models.TimeField()
>   end = models.TimeField()
>
> I'd like to be able to say something like:
>
> Entry.objects.filter(F('end')-F('start')__gt=time_in_minutes)
>
> Is there a way of doing this without implementing a separate duration 
> field and having a setter for start and end update it?
>
> Cheers,
> Steve
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/9c7f2727-e501-4e40-9686-1bc125aa8559%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: like query django

2016-01-22 Thread Xristos Xristoou
look my version django cant not be use url 'like_post' because show me 
errow only 1.5 version django can use that

Τη Τρίτη, 19 Ιανουαρίου 2016 - 5:35:09 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i want to create a query for likes in my post details
>
> my html tags
>
> {{movies.likes}} peaple liked this article
> Like
>
>
> my urls
>
>
> url(r'^view/(?P[^\.]+)/$', views.view_post, name='view_post'),
>
> url(r'^(?P[0−9]+)/$', views.like_post, name='like_post'),
>
>
> my view
>
>
> def like_post(request,pk=1):
>  a=Movies.objects.get(pk=pk)
>  count=a.likes
>  count+=1
>  a.likes=count
>  a.save()
>  return HttpResponseRedirect ( '/posts/view/%s' % pk)
>
>
> but i have error not work
>
>
> Page not found (404)
> Request Method: GET
> Request URL: http://127.0.0.1:8000/like/1/
>
> Using the URLconf defined in categories1.urls,  Django tried these URL 
> patterns, in this order:   
>
>1. ^admin/   
>2. ^$ [name='index']   
>3. ^view/(?P[^\.]+)/$[name='view_post']   
>4. ^category/(?P[\w-]+)/$[name='view_category']  
>  
>5. ^(?P[0−9]+)/$ [name='like_post']   
>6.  ^media\/(?P.*)$   
>
> The current URL, like/1/, didn't match any of these.
>
>
>
> any idea ?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/c9b86b2e-ca01-4a52-ad8a-65849dba5d7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how many visitors has view my posts and how many visitors view my site

2016-01-22 Thread Xristos Xristoou
hello,


i want to know  how many people view my site and how many view one to one 
my posts specific.
my site is simple i have two templates one with all my post and one with 
post details.
but i dont know how to do that i am new in django.


the start is to add a new field in my class

view = models.IntegerField(default=0)


any idea ?any documentation to help 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 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/50bcbc55-107b-4fec-b67b-9217aec5082d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how many visitors has view my posts and how many visitors view my site

2016-01-22 Thread Xristos Xristoou
but i can the show how many people to view in my html template ?

Τη Παρασκευή, 22 Ιανουαρίου 2016 - 5:02:46 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i want to know  how many people view my site and how many view one to one 
> my posts specific.
> my site is simple i have two templates one with all my post and one with 
> post details.
> but i dont know how to do that i am new in django.
>
>
> the start is to add a new field in my class
>
> view = models.IntegerField(default=0)
>
>
> any idea ?any documentation to help 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 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/9c4d10b5-b7db-4ba4-9856-9ec4a61e8b2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: like query django

2016-01-23 Thread Xristos Xristoou
i have 1.8 version

Τη Τρίτη, 19 Ιανουαρίου 2016 - 5:35:09 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i want to create a query for likes in my post details
>
> my html tags
>
> {{movies.likes}} peaple liked this article
> Like
>
>
> my urls
>
>
> url(r'^view/(?P[^\.]+)/$', views.view_post, name='view_post'),
>
> url(r'^(?P[0−9]+)/$', views.like_post, name='like_post'),
>
>
> my view
>
>
> def like_post(request,pk=1):
>  a=Movies.objects.get(pk=pk)
>  count=a.likes
>  count+=1
>  a.likes=count
>  a.save()
>  return HttpResponseRedirect ( '/posts/view/%s' % pk)
>
>
> but i have error not work
>
>
> Page not found (404)
> Request Method: GET
> Request URL: http://127.0.0.1:8000/like/1/
>
> Using the URLconf defined in categories1.urls,  Django tried these URL 
> patterns, in this order:   
>
>1. ^admin/   
>2. ^$ [name='index']   
>3. ^view/(?P[^\.]+)/$[name='view_post']   
>4. ^category/(?P[\w-]+)/$[name='view_category']  
>  
>5. ^(?P[0−9]+)/$ [name='like_post']   
>6.  ^media\/(?P.*)$   
>
> The current URL, like/1/, didn't match any of these.
>
>
>
> any idea ?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/45b26eff-7d76-4961-b605-ab7d8481b2da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


views and urls

2016-01-25 Thread Xristos Xristoou
hello,


i have three pages(views,urls,templates) one with artist list with all 
posts one with artist details from the main list.
first and second pages work fine,but i have problem on the third page i 
want from the artists details to go the third
page and i take more details for the director where is a foreign key on the 
artist.
but not work and dont show me error if i click on the director then go me 
on the top from my artist details
if i written on my browser 127/./dir/1 then go me on the third page but 
i cant go from the second page template tag..

that my code


my model


class artist(models.Model):

director = models.ForeignKey('Director')

..


class Director(models.Model):
Name = models.CharField(max_length=100,blank=True)

..


my view



def view_dir(request, pk):
post = get_object_or_404(Director, pk=pk)
return render_to_response('blog/director_details.html', {
'post': post
})


my urls

url(r'^view/(?P[^\.]+)/$', views.view_post, name='view_post'), #artists 
details

url(r'^dir/(?P\d+)/$', views.view_dir, name='view_dir'),


template tag in the artist details


{{post.director}} #artists details

-- 
You received this message because you are subscribed to the Google Groups 
"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/c9bd9980-a2ab-4bea-9c28-a1fff2d1ca1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django pagination

2016-01-25 Thread Xristos Xristoou
i want to using Paginator in my main page for my post list. i see docs and 
examples for that but i thing my problem is a specific, because on my view 
i have two Querys not one.


def index(request):
return render_to_response("blog/posts_list.html", {
'categories': Category.objects.all(),
'posts': 
Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
})


any idea how to use Paginator on my 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/8e0b5497-e3b3-4e62-b698-180f68e46a56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread Xristos Xristoou
can you show me one examples with my view ?

Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> i want to using Paginator in my main page for my post list. i see docs and 
> examples for that but i thing my problem is a specific, because on my view 
> i have two Querys not one.
>
>
> def index(request):
> return render_to_response("blog/posts_list.html", {
> 'categories': Category.objects.all(),
> 'posts': 
> Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
> })
>
>
> any idea how to use Paginator on my 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/12b31dc3-77ca-4e32-b340-8d0019b9f580%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread Xristos Xristoou
if i use {autopagination} i dont need quyre on my view ?

Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> i want to using Paginator in my main page for my post list. i see docs and 
> examples for that but i thing my problem is a specific, because on my view 
> i have two Querys not one.
>
>
> def index(request):
> return render_to_response("blog/posts_list.html", {
> 'categories': Category.objects.all(),
> 'posts': 
> Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
> })
>
>
> any idea how to use Paginator on my 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/6ec5fa3d-9f45-4a0a-8ee6-3ef44893a24d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread Xristos Xristoou
one more question how to install this ?autopagination ?i dont see anything

Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> i want to using Paginator in my main page for my post list. i see docs and 
> examples for that but i thing my problem is a specific, because on my view 
> i have two Querys not one.
>
>
> def index(request):
> return render_to_response("blog/posts_list.html", {
> 'categories': Category.objects.all(),
> 'posts': 
> Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
> })
>
>
> any idea how to use Paginator on my 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/20c91b88-4893-4bb1-82a0-c14ddf0b0050%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread Xristos Xristoou
thnx you i try to use that now

Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> i want to using Paginator in my main page for my post list. i see docs and 
> examples for that but i thing my problem is a specific, because on my view 
> i have two Querys not one.
>
>
> def index(request):
> return render_to_response("blog/posts_list.html", {
> 'categories': Category.objects.all(),
> 'posts': 
> Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
> })
>
>
> any idea how to use Paginator on my 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/975e3703-a73a-4057-aaf4-341c7ae724d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread Xristos Xristoou
i follow the simpe steps but i take error invalid syntax 
(pagination_tags.py, line 225)

Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> i want to using Paginator in my main page for my post list. i see docs and 
> examples for that but i thing my problem is a specific, because on my view 
> i have two Querys not one.
>
>
> def index(request):
> return render_to_response("blog/posts_list.html", {
> 'categories': Category.objects.all(),
> 'posts': 
> Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
> })
>
>
> any idea how to use Paginator on my 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/e77feb8e-adfd-4468-ab84-80a5d9523c5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread Xristos Xristoou
that method is Confusing,i try to understand,i create new view or i work 
with current?i not understand it the using 'people' and object on they view

Τη Δευτέρα, 25 Ιανουαρίου 2016 - 4:16:31 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> i want to using Paginator in my main page for my post list. i see docs and 
> examples for that but i thing my problem is a specific, because on my view 
> i have two Querys not one.
>
>
> def index(request):
> return render_to_response("blog/posts_list.html", {
> 'categories': Category.objects.all(),
> 'posts': 
> Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
> })
>
>
> any idea how to use Paginator on my 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/e4b4344d-5e96-47c7-aff1-74e81b7eb374%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread Xristos Xristoou
i foolow the steps but i have again error my new view :

def index(request):
try:
page = request.GET.get('page', 1),
except PageNotAnInteger:
page = 1,
objects = ['john', 'edward', 'josh', 'frank']
p = Paginator(objects,request=request)
people = p.page(page)
return render_to_response("blog/movies_list.html", {
'ranking' : Movies.objects.all().order_by('-rating')[:3],
'likes': Movies.objects.all().order_by('-like')[:3],
'categories': Category.objects.all(),
'people':people,
'posts': 
Movies.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
})


first i dont understand how is the objects

the show error in the line :p = Paginator(objects,request=request) any idea ?

-- 
You received this message because you are subscribed to the Google Groups 
"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/b914061b-bf4a-4a36-a3df-ca97a5ed1473%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django pagination

2016-01-26 Thread Xristos Xristoou
i find solutio 
using https://docs.djangoproject.com/en/1.9/topics/pagination/ thnX

Τη Τρίτη, 26 Ιανουαρίου 2016 - 3:10:06 μ.μ. UTC+2, ο χρήστης pa xapy έγραψε:
>
> you want to paginate both querysets at the same page? 
> i believe it's a pretty strange idea and if so, you should think how to 
> refactor it
> if you want only paginate posts, i'll recommend you to use 
> django-pagination app of some sort, it's can be used in template
>
> On Monday, January 25, 2016 at 5:16:31 PM UTC+3, Xristos Xristoou wrote:
>>
>> i want to using Paginator in my main page for my post list. i see docs 
>> and examples for that but i thing my problem is a specific, because on my 
>> view i have two Querys not one.
>>
>>
>> def index(request):
>> return render_to_response("blog/posts_list.html", {
>> 'categories': Category.objects.all(),
>> 'posts': 
>> Posts.objects.filter(publisheddate__lte=timezone.now()).order_by('-publisheddate')
>> })
>>
>>
>> any idea how to use Paginator on my 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/58103c46-0740-48c8-8340-0a957c60c4da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


stupid error embed video

2016-01-26 Thread Xristos Xristoou
hello i have use the embed video tools to using dynamic youtube urls for 
trailers but i have a stupid error.
if i import on admin in the field video urls one video url from youtube and 
i see url for that is correct i save it in my post,
but on my site if i run the server show me else video some video for all my 
post but i not have that video.
all my post they have some url video not this i define before

models.py

video = EmbedVideoField()


template tag


http://www.youtube.com/v/v1gTI4BOPUw?version=3"; 
type="application/x-shockwave-flash" allowfullscreen="true" 
allowScriptAccess="always" width="550" height="300">


# post.video.url because in the post details

-- 
You received this message because you are subscribed to the Google Groups 
"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/1eac21b7-9a26-495f-b91b-5a295d7c87d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


search page

2016-01-26 Thread Xristos Xristoou
hello,


i want to an easy way to create search page on my site to searching only 
the titles.
who is the better and easy way for to doa that ?
mayde some tools to install ?
any idea ?

-- 
You received this message because you are subscribed to the Google Groups 
"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/210c4e3a-41f0-4981-8324-c654d0e08cc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: help with ManyToMany

2016-01-27 Thread Xristos Xristoou
your code is correct,where are the problem ?in the admin first add Studio 
and sfter this select on the field studio from class studiogroup one or 
more entries from the class studio so simple,

christos

Τη Τετάρτη, 27 Ιανουαρίου 2016 - 5:50:21 μ.μ. UTC+2, ο χρήστης dave.l 
έγραψε:
>
> Hi,
>
> I have recently returned to a Django project after a few years and I'm a 
> little rusty on ManyToMany fields.
>
> Here's my very simple models:
>
>
> class Studio(models.Model):
> name = models.CharField(max_length=255, unique=True)
>
> class StudioGroup(models.Model):
> description = models.CharField(max_length=255, unique=True)
> studio = models.ManyToManyField(Studio)
>
>
> So a bunch of Studio(), which can be in multiple StudioGroups()
>
> Given a single instance of a Studio(), I would like a single list of all 
> other studios in all other groups.
>
> so if Group1 is A,B,C and Group2 is A,D,E
>
> I would like to return B,C,D,E for A.
>
> My current solution is entirely in Python (which works), but I'd like a 
> more Django-esque solultion of possible!
>
> Thank you,
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8b2e5699-8365-4827-8803-59160e746b18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding a field to a model after initial migration

2016-01-27 Thread Xristos Xristoou
no the problem is your new field affect models rules...try the new field to 
have null=True or default=somathing and then run on mynage.py makemigration 
yourapp and after migrate yourapp

christos

Τη Τετάρτη, 27 Ιανουαρίου 2016 - 9:21:16 μ.μ. UTC+2, ο χρήστης ofeyofey 
έγραψε:
>
> Hi,
> I forgot to add a field to a model and wish to add it now.
> I added the line to models.py but makemigrations and migrate aren't 
> working now.
> Is this possible in Django or do i need to go directly tp the sqlite DB 
> and do it using SQL?
> Thanks
> Currently following this tutorial 
> https://www.youtube.com/watch?v=g0tvJsUAx7g
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/89327473-cf28-4aed-bee6-56f534136463%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding a field to a model after initial migration

2016-01-27 Thread Xristos Xristoou
work now ?

Τη Τετάρτη, 27 Ιανουαρίου 2016 - 9:21:16 μ.μ. UTC+2, ο χρήστης ofeyofey 
έγραψε:
>
> Hi,
> I forgot to add a field to a model and wish to add it now.
> I added the line to models.py but makemigrations and migrate aren't 
> working now.
> Is this possible in Django or do i need to go directly tp the sqlite DB 
> and do it using SQL?
> Thanks
> Currently following this tutorial 
> https://www.youtube.com/watch?v=g0tvJsUAx7g
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/c9935dfd-ebdb-4f8a-849e-4e81027468c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding a field to a model after initial migration

2016-01-27 Thread Xristos Xristoou
you add your app name after the run makemigration and migrate ?if your app 
name is a blog then you run* makemigration blog *and *migrate blog*

Τη Τετάρτη, 27 Ιανουαρίου 2016 - 9:21:16 μ.μ. UTC+2, ο χρήστης ofeyofey 
έγραψε:
>
> Hi,
> I forgot to add a field to a model and wish to add it now.
> I added the line to models.py but makemigrations and migrate aren't 
> working now.
> Is this possible in Django or do i need to go directly tp the sqlite DB 
> and do it using SQL?
> Thanks
> Currently following this tutorial 
> https://www.youtube.com/watch?v=g0tvJsUAx7g
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/287b857b-3097-49eb-a54a-d71bd04058c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding a field to a model after initial migration

2016-01-27 Thread Xristos Xristoou
i dont know why sorry..try default value

Τη Τετάρτη, 27 Ιανουαρίου 2016 - 9:21:16 μ.μ. UTC+2, ο χρήστης ofeyofey 
έγραψε:
>
> Hi,
> I forgot to add a field to a model and wish to add it now.
> I added the line to models.py but makemigrations and migrate aren't 
> working now.
> Is this possible in Django or do i need to go directly tp the sqlite DB 
> and do it using SQL?
> Thanks
> Currently following this tutorial 
> https://www.youtube.com/watch?v=g0tvJsUAx7g
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/b12e839f-908e-4235-894f-0d75e3b03124%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Animate.css on django

2016-01-29 Thread Xristos Xristoou
hello 


has work somebody with this animate.css 
 ?and somebody can to explanation 
how to use this
on my title from my post details ?

-- 
You received this message because you are subscribed to the Google Groups 
"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/29a12ab2-12ac-4343-9c6e-3ea5496407e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Animate.css on django

2016-01-29 Thread Xristos Xristoou
yeah but how to connect with my post titles ?

Τη Παρασκευή, 29 Ιανουαρίου 2016 - 12:53:02 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello 
>
>
> has work somebody with this animate.css 
> <https://daneden.github.io/animate.css/> ?and somebody can to explanation 
> how to use this
> on my title from my post details ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/4f7a6ff0-7487-498f-8d53-bf8fa03aac51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Animate.css on django

2016-01-29 Thread Xristos Xristoou
i cant to use that with div class or div id in my title ?i want more simple

Τη Παρασκευή, 29 Ιανουαρίου 2016 - 12:53:02 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello 
>
>
> has work somebody with this animate.css 
> <https://daneden.github.io/animate.css/> ?and somebody can to explanation 
> how to use this
> on my title from my post details ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/f6ed8b53-6393-4b36-8eb3-43064a7c75f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


mathematical function and django connect

2016-02-09 Thread Xristos Xristoou
hello,


i create some python mathematical function on python idle,
i want to create website where the user import value numbers on the function
and take the results from that.
question one,how to connect my mathematical function on the django?
question two,how to connect input and output from the scipts in the website 
?
the second question i ask because input and output from the function is a 
dynamic define from the user



-- 
You received this message because you are subscribed to the Google Groups 
"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/b9267697-b28e-4a03-af7c-88fd384cc72b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-09 Thread Xristos Xristoou
what is regext?

Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/1d0bb319-dbcb-4193-b646-0640225414c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-09 Thread Xristos Xristoou
yeah my bad for the regext i know that with the full name btw,form its not 
nesecery to create ?
my task is to copy paste my code in the view,create the regext,and cell on 
my templete ?only just ?

Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/8995c788-8e4b-4aef-a175-8c8cd291d7f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-09 Thread Xristos Xristoou
yeah my bad for the regext i know that with the full name btw,form its not 
nesecery to create ?
my task is to copy paste my code in the view,create the regext,and connect 
on my templete ?only just ?

hello,

>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/3db82847-7e0b-4194-909f-270f9bc2b3c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-09 Thread Xristos Xristoou

THNX for response but that toturial not answer on my questions
Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/f42b86ac-3fc5-4336-b9f7-dc950d069702%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
yes i want this and work with python list for input and output

Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/b933ec93-1d35-466e-86c7-b5cafde824d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
i dont know how to start to give you an example,is confused i am newmbie 
and i dont find anythink on the internet

Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/f07df36a-3a85-4a1b-a8d8-deba7dc9e9ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
for example:
myscipt
that my input for example the user define the number to want for input and 
next input integer numbers on the list(NList) that list go to progress and 
exported one variable result outpout and list of variables results. i dont 
upload the progress code because i think not is nesecery for my questions.

total_inputs= int(input("number of numbers to input: "))
   for i in range (total_inputs)
Num = input("Enter a number: ")
NList.append(int(Num))
..
progress
.
result1=result
result2=listresult
print(result1)
print(result2)


Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/2903b19d-aa7d-41ba-abcb-6f1aada7f9f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
if i dont want refactor my scipt,and use this
def my_math_func(input1,input2):
  my code
 return list_output,output

is that correct ?


Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/e168ac17-6786-487a-af7c-30089b5b0798%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou

THNX for response to help me,two questions,how to import list input on my 
def math(input,*listinput*) how to define this ?
now i dont have model,on my html template how to connect on my scipt ?

Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/9a0759fa-1cc0-4bdc-89f0-0f407c49c944%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-15 Thread Xristos Xristoou
after read your toturial from the django docs and next page from the django 
docs
i think so my python code is wrong to get in views.py, i think so get in 
form
Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/f4806da4-886f-4562-8e46-4633693b333e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-20 Thread Xristos Xristoou
i have a progress with help anyway i am newbie

i convert my python script(remember the first script on the first page) to 
django script on the view

views.py:

from django.shortcuts import render_to_response
def calc(request):
a = []
NList = []
y=0
nums = request.POST['num']
total_inputs = request.POST['total']
for i in range(total_inputs):
NList.append(int(num) for num in nums.split(','))
for k in NList:
if k is 1:
y = 1
elif (k > 1) and (k < 5):
y = (k - 1) + 2
a.append(y)
return render_to_response('blog/calc.html', {
'a' :a,
})


app/urls:

urlpatterns = [
url(r'^$',views.calc, name='calc'),
]


html form:


  Number of number: 
  Enter a value: 
  



and i take that error


MultiValueDictKeyError at /

"'num'"


   1. 
   
nums = request.POST['num']
   
   

Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/02663377-d462-49eb-900e-a38c954fcee1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-20 Thread Xristos Xristoou
i find solution for that error

if i change request to :

if 'nums' in request.POST:
nums = request.POST['nums']
else:
nums = False



now i have else error and i think the code in my html form is wrong (inside 
the form i copy paste {% csrf_token %}) and again nothing

Forbidden (403)

CSRF verification failed. Request aborted
Help

Reason given for failure:

CSRF token missing or incorrect.


In general, this can occur when there is a genuine Cross Site Request 
Forgery, or when Django's CSRF mechanism 
<https://docs.djangoproject.com/en/1.8/ref/csrf/> has not been used 
correctly. For POST forms, you need to ensure:

   - Your browser is accepting cookies.
   - The view function passes a request to the template's render 
   
<https://docs.djangoproject.com/en/dev/topics/templates/#django.template.backends.base.Template.render>
 
   method.
   - In the template, there is a {% csrf_token %} template tag inside each 
   POST form that targets an internal URL.
   - If you are not using CsrfViewMiddleware, then you must use csrf_protect 
   on any views that use the csrf_token template tag, as well as those that 
   accept the POST data.

You're seeing the help section of this page because you have DEBUG = True 
in your Django settings file. Change that to False, and only the initial 
error message will be displayed. 

You can customize this page using the CSRF_FAILURE_VIEW setting.


Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/75dce0b5-7fe2-4970-aebf-acf3bfc1017f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-20 Thread Xristos Xristoou


place csrf on my code 


{% csrf_token %}
  Number of number: 
  Enter a value: 
  



and the background color from input is a differend and i take that message 

This inspection highlights form elements without required associated label 
(WCAG 
2.0: H44 <http://www.w3.org/TR/WCAG20-TECHS/html.html#H44>) or title 
attribute (WCAG 2.0: H65 
<http://www.w3.org/TR/2015/NOTE-WCAG20-TECHS-20150226/H65>) and provides 
the ability to create a new label or add an attribute.



Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/7e76af36-e2c6-49bb-97de-1e1d97e60d31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-21 Thread Xristos Xristoou
yes i see that and fix it but not work again

Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/d87961d2-fd66-401c-ac86-5dc970546d7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-21 Thread Xristos Xristoou
UserWarning: A {% csrf_token %} was used in a template, but the context did 
not provide the value.  This is usually caused by not using RequestContext.

Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/bb2f0706-390a-4164-aad8-6c2777df68f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-21 Thread Xristos Xristoou
i find it,just add return render_to_response('blog/calc.html', {'a' 
:a},context_instance=RequestContext(request))
and dont show me that error,but not work again
now if i touch calc button just reload dont show me error dont show me 
results only clear numbers why ?

{% csrf_token %}
  Number of number: 
  Enter a value: 
  
calc




{{ a }}
or full info
{% for sm in a%}
{{ sm }}
{% endfor %}





Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/1a0f598a-8552-4316-b57d-4e38563cb39d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-22 Thread Xristos Xristoou
the problem in the html form we need to change second input to 
take multiple values,for example first input take a number
and the second input take many numbers..if the first number = 2 then take 
second input two numbers,two fields for input i try this but not work

orm action="" method="POST">{% csrf_token %}
  Number of number: 
  calc
  {% for i in total_inputs %}
 Enter a value: 
calc
  {% endfor %}

show me error in the {% for i in total_inputs %}
Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/fbeed832-5a26-4863-a39c-a376cf9c8600%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-28 Thread Xristos Xristoou
update my project now

my view.py code

def calc(request):
a = []
NList = []
y=0
member=0
member = request.POST.get ('member', False)
for i in range(int(member)):
input = request.POST.get ('input', False)
NList.append(int(input))
for k in NList:
if k is 1:
y = 1
elif (k > 1) and (k < 5):
y = (k - 1) + 2
a.append(y)
return render_to_response ('blog/calc.html', {'a' :a, 'member':member}, 
context_instance=RequestContext(request))


my urls.py

from django.conf.urls import url
from . import views

urlpatterns = [
url(r'^$',views.calc, name='calc'),
]

html code with the javascript


{% csrf_token %}

Closure Level
Number of members:
Button


submit


function addinputFields(){
  // Disable Default Action (Form Posting)
  event.preventDefault();
  // parseInt() - The value entered should be a number / integer
var number = parseInt(document.getElementById("member").value);
for (i=0;i<number;i++){
var input = document.createElement("input");
input.type = "text";
container.appendChild(input);
container.appendChild(document.createElement("br"));
}
}


{{ a}}
or full info
{% for sm in a %}
{{ sm }}
{% endfor %}




but not work again show me zero results,any idea ?


Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/aadbc19e-e424-4f41-8e0d-0f593b62b5e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-03-03 Thread Xristos Xristoou
update my code khow i feel so close but not work again hahaha to many 
problems

. I want to write a django code which takes a number and a list of numbers 
from the website as user input and and then export a list with results. but 
if i run my app don't show me results from the progress in html template, i 
can only input details if i push second button just reload the page and not 
show me results.

I have written following code but it doesn't show me the results:

views.py

def calc(request):
NList=[]
num=0
a=[]
y=0
c=0
total=0
num = request.POST.get ('num', False)
if request.method=='POST' and 'btnform1' in request.POST:
b='1'.zfill(int(num))
e=b[::-1]
c=int(e)
#num=int(num)
if request.method=='POST' and 'btnform2' in request.POST:
 for i in range(int(num)):
 total = request.POST.get ('total', False)
 NList.append(int(total))
 for k in NList:
if k == 1:
y=1
elif (k > 1) and (k < 5):
y = k+1000
a.append(y)

return render_to_response ('blog/calc.html', {'a' 
:a,'num':num,'c':c,'y':y,'total':total,'NList':NList},context_instance=RequestContext(request))

html form

form id="form1" action="" method="POST">{% csrf_token %}
  Number of number: 

count


{{num}}
{% csrf_token %}
{% for i in c|make_list %}
  Enter a value: 
{% endfor %}
final

 {{ a}}or full info{% for sm in a %}
{{ sm }}{% endfor %}

urls.py

url(r'^$',views.calc, name='calc'),

this is a example if if the first input is num=4 then the script create 4 
html inputs field(to user input second number list total) but if i click 
final button dont show me resust(a=output).

<https://lh3.googleusercontent.com/-beooxIiT5PY/VtiHFeyAnCI/ABo/IWf1gpNLfX4/s1600/err.jpg>



Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the user
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/d64a4f0a-6c20-48c8-ab4e-930fcb3c0d08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Development of web based image processing package

2016-03-03 Thread Xristos Xristoou
@james celeny support .grid raster image type  ?

Τη Πέμπτη, 3 Μαρτίου 2016 - 7:47:56 μ.μ. UTC+2, ο χρήστης Neha Chhattani 
έγραψε:
>
> hello
> i want to create a website that will do image processing in real time. i 
> want to load large tiff images i.e. images used in remote sensing and 
> satellite images. I want to do processing on satellite images. is it 
> possible to do this processing in website using django? If yes, how to 
> start with? what are the requirements for this? 
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/eaa61a5d-f048-444b-8526-81ca9bb90992%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Development of web based image processing package

2016-03-04 Thread Xristos Xristoou
if i want only raster processing for remote sensing and satellite images 
 ?how can i do with python ?python library for that ?


Τη Πέμπτη, 3 Μαρτίου 2016 - 7:47:56 μ.μ. UTC+2, ο χρήστης Neha Chhattani 
έγραψε:
>
> hello
> i want to create a website that will do image processing in real time. i 
> want to load large tiff images i.e. images used in remote sensing and 
> satellite images. I want to do processing on satellite images. is it 
> possible to do this processing in website using django? If yes, how to 
> start with? what are the requirements for this? 
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/21ed4627-6fdd-4bcf-a49d-7c9e78a7358f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


program modules connect on web django apps

2016-03-11 Thread Xristos Xristoou
how can i call modules from another program on the web django app ? and how 
to connect modules on the django ?
the another program is a written source in python and may that task.
i want to call modules on the web site and i take results from the progress 
modules

-- 
You received this message because you are subscribed to the Google Groups 
"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/2860d239-d932-45af-96ae-30668e1a1cf6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


google/bing maps using django

2016-04-09 Thread Xristos Xristoou
hello


i want some toturial or examble to easy way ping and show one place in 
google maps/bing maps with lat/log
and can be dynamic because i have more places to show in my web site ?

-- 
You received this message because you are subscribed to the Google Groups 
"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/7722856a-9d6f-4ff0-9039-7b6a4055987a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: google/bing maps using django

2016-04-09 Thread Xristos Xristoou
if i have two fields in my model with coordinates lon = models.FloatField()

   lat = models.FloatField()

how to show this place in google maps in my html template ?




Τη Σάββατο, 9 Απριλίου 2016 - 10:50:08 μ.μ. UTC+3, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello
>
>
> i want some toturial or examble to easy way ping and show one place in 
> google maps/bing maps with lat/log
> and can be dynamic because i have more places to show in my web site ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/b835e6ef-c8c1-4762-bb4c-e2a669c363c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: google/bing maps using django

2016-04-10 Thread Xristos Xristoou
@sergiy khohlov i try to follow this toturial 
 
http://fle.github.io/easy-webmapping-with-django-leaflet-and-django-geojson.html
but in my admin(administrator page) i cant to add points because dont show 
me the map,can you help me ?

Τη Σάββατο, 9 Απριλίου 2016 - 10:50:08 μ.μ. UTC+3, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello
>
>
> i want some toturial or examble to easy way ping and show one place in 
> google maps/bing maps with lat/log
> and can be dynamic because i have more places to show in my web site ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/6316956c-fdf7-40a4-b70b-7530c05da08f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


install geodjango in windows 10

2016-04-12 Thread Xristos Xristoou
can you tell me someone how to install geodjango step by step in windows10 
?i like to use pip if i can for that,it is easy pip.

-- 
You received this message because you are subscribed to the Google Groups 
"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/780da4bf-496b-45d2-92ad-64b8eb4f13ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: install geodjango in windows 10

2016-04-12 Thread Xristos Xristoou
i dont have any libraries from GEOS and GDAL or PostGIS librarios for 
PostgreSQL.
how to install this libraries in windows 10 and python 3.5.
i try pip3.5 install GDAL but i have error(look image).


Τη Τρίτη, 12 Απριλίου 2016 - 10:00:24 π.μ. UTC+3, ο χρήστης Xristos 
Xristoou έγραψε:
>
> can you tell me someone how to install geodjango step by step in windows10 
> ?i like to use pip if i can for that,it is easy pip.
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/786280b2-8f84-47f9-9b1c-d1cbca55e2c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: install geodjango in windows 10

2016-04-12 Thread Xristos Xristoou
i dont have any from that libraries but how to install that libraries in 
windows 10 and python 3.5?
i try to use this pip3.5 install GDAL and show me error(look image)

Τη Τρίτη, 12 Απριλίου 2016 - 10:00:24 π.μ. UTC+3, ο χρήστης Xristos 
Xristoou έγραψε:
>
> can you tell me someone how to install geodjango step by step in windows10 
> ?i like to use pip if i can for that,it is easy pip.
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/91ce7533-2017-4796-976b-719b91a3b011%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django-raster rendering raster url

2018-07-03 Thread Xristos Xristoou


i want to add raster functionality in django using postgis database using 
django-raster package and this docs 
.

here my code :

models.py

from django.contrib.gis.db import modelsclass RasterWithName(models.Model):
raster = models.RasterField()
name = models.TextField()

add raster using console :

from django.contrib.gis.gdal import GDALRasterfrom myapp.models import 
RasterWithName
gdal_raster = GDALRaster('C:/Users/username/Desktop/image.tif')
rast = RasterWithName(name='one', raster=gdal_raster)
rast.save()

but i am very confused with Rendering tiles and urls.

docs say :

*/raster/tiles/layer_id/{z}/{x}/{y}.png where the layer_id is the primary 
key of a raster layer. This structure can be used directly in online 
mapping software such as OpenLayers or Leaflet. An example request could 
look like this: /raster/tiles/23/8/536/143.png, returning a tile in png 
format of the layer with ID pk=23 at zoom level z=8 and indexes x=536 and 
y=143*

but indexes x,y mean some random x,y coordinate in image ?anyway i using 
this url http://127.0.0.1:8000/raster/tiles/1/8/536/143.png or 
http://127.0.0.1:8000/raster/tiles/1/8/20/40.png(origin x,y in my image) 
and i take a black window in my browser,any idea where i have wrong in my 
url rendering ?

-- 
You received this message because you are subscribed to the Google Groups 
"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/50b2b584-2991-4b8a-84b5-8886354eb60d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-raster rendering raster url

2018-07-04 Thread Xristos Xristoou
hello

you mean that need height/width or some pixel inside in image ?

thank you 

Τη Τρίτη, 3 Ιουλίου 2018 - 11:33:09 μ.μ. UTC+3, ο χρήστης Jason έγραψε:
>
> No, they don't mean coordinates, they mean the actual index location in a 
> grid.
>
> Say you have a 100x100 grid, each (x, y) coordinate like (1, 5) represents 
> one tile image.
>
> On Tuesday, July 3, 2018 at 3:43:07 PM UTC-4, Xristos Xristoou wrote:
>>
>> i want to add raster functionality in django using postgis database using 
>> django-raster package and this docs 
>> <http://django-raster.readthedocs.io/en/latest/tms.html>.
>>
>> here my code :
>>
>> models.py
>>
>> from django.contrib.gis.db import modelsclass RasterWithName(models.Model):
>> raster = models.RasterField()
>> name = models.TextField()
>>
>> add raster using console :
>>
>> from django.contrib.gis.gdal import GDALRasterfrom myapp.models import 
>> RasterWithName
>> gdal_raster = GDALRaster('C:/Users/username/Desktop/image.tif')
>> rast = RasterWithName(name='one', raster=gdal_raster)
>> rast.save()
>>
>> but i am very confused with Rendering tiles and urls.
>>
>> docs say :
>>
>> */raster/tiles/layer_id/{z}/{x}/{y}.png where the layer_id is the primary 
>> key of a raster layer. This structure can be used directly in online 
>> mapping software such as OpenLayers or Leaflet. An example request could 
>> look like this: /raster/tiles/23/8/536/143.png, returning a tile in png 
>> format of the layer with ID pk=23 at zoom level z=8 and indexes x=536 and 
>> y=143*
>>
>> but indexes x,y mean some random x,y coordinate in image ?anyway i using 
>> this url http://127.0.0.1:8000/raster/tiles/1/8/536/143.png or 
>> http://127.0.0.1:8000/raster/tiles/1/8/20/40.png(origin x,y in my image) 
>> and i take a black window in my browser,any idea where i have wrong in my 
>> url rendering ?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/82ae67d0-35aa-4008-858d-e4c5886d005d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-raster rendering raster url

2018-07-04 Thread Xristos Xristoou


Τη Τετάρτη, 4 Ιουλίου 2018 - 4:54:23 μ.μ. UTC+3, ο χρήστης Jason έγραψε:
>
> No.  Ever see a tile floor?  each tile is one image with a filename.  you 
> use the x y coordinates to get the path to that image
>


how to find this information ?because that image converting to 3857 system? 

-- 
You received this message because you are subscribed to the Google Groups 
"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/75696d6d-256e-4780-82c0-96d294f306de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-raster rendering raster url

2018-07-05 Thread Xristos Xristoou
i need this help

Τη Τετάρτη, 4 Ιουλίου 2018 - 4:54:23 μ.μ. UTC+3, ο χρήστης Jason έγραψε:
>
> No.  Ever see a tile floor?  each tile is one image with a filename.  you 
> use the x y coordinates to get the path to that image
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/746cac76-65f2-4022-a1d2-9292f6491597%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


geodjango raster field display on leaflet

2018-07-25 Thread Xristos Xristoou
 

in the new django version support raster field and i follow this 
 manual 
for geodjango raster field and this questions 

 
for add raster i have build a simple demo.

here the code :

settings.py

postgis database backend

'django.contrib.gis.db.backends.postgis'

models.py

from django.db import modelsfrom django.contrib.gis.db import models
class Elevation(models.Model):
name = models.CharField(max_length=100)
rast = models.RasterField()

all works fine without error.

but i have one BIG question where i dont know how to complete it.

how to display this raster in some web map like leaflet ? any idea how 
?some tutorial to help me ?

thank you 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4ecf8150-3dca-4fd8-bfc8-299862a0b89a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


html multi button form using in django app

2018-10-26 Thread Xristos Xristoou


down votefavorite 


I have a html form with multi buttons and html tabs processing for every 
button(for example after to push button n01 i take tab 2 with button n02 
after push button n02 i take tab 3 with button n03 where is the final 
button).

my question is to take data from button no1(tab 1) and serve to page 
no2(after push button n01)?

if i keep type="button" then in my view i dont take anything if i change to 
type="submit" then in my view i take results but after push button n01 
refresh my page and start to begin again (dont take to tab 2)

html form :


..


Save 
and continue
   .
   


Save 
and continue

..


Save 
   and continue


django view :

if request.method == 'POST' and 'n01' in request.POST:
   do somethingif request.method == 'POST' and 'n02' in request.POST:
   do something else

-- 
You received this message because you are subscribed to the Google Groups 
"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/b240324e-483b-4fbf-b5b0-fd63902c02bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Handling multiple input values for single html form in django

2018-10-29 Thread Xristos Xristoou
 

i have a html form with 3 inputs and steps buttons.

1st step user must put first name and press button 1

2st step user must put last name and press button 2

3st step user must put email and press final button 3

any time where the user press any button then go to next html step.

i want to Handle inputs in my views.py step by step any time where the user 
press any button and not all together in the final submit .

i try t use this code in views.py to take inputs in django backend and now 
work i don't take anything in views.py.(if i change button type from button 
to submit then i take results nut refresh page and i cant go to step 2) 
views.py 

if request.method == 'POST' and 'first_step' in request.POST:
   print '1'
   firstname= request.POST.get('firstname')if request.method == 'POST' and 
'second_step' in request.POST:
print '2'
lastname= request.POST.get('lastname')if request.method == 'POST' and 
'final_step' in request.POST:
print '3'
email= request.POST.get('email')

here the html code :




Form wizard with circular tabs

http://code.jquery.com/jquery-1.11.1.min.js";>
http://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js";>














































First 
Name







Save and continue






Last Name




Previous
Save and continue






email






Previous
Save and continue




Completed









   
$(document).ready(function () {
//Initialize tooltips
$('.nav-tabs > li a[title]').tooltip();

//Wizard
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {

var $target = $(e.target);

if ($target.parent().hasClass('disabled')) {
return false;
}
});

$(".next-step").click(function (e) {

var $active = $('.wizard .nav-tabs li.active');
$active.next().removeClass('disabled');
nextTab($active);

});
$(".prev-step").click(function (e) {

var $active = $('.wizard .nav-tabs li.active');
prevTab($active);

});});

function nextTab(elem) {
$(elem).next().find('a[data-toggle="tab"]').click();}
function prevTab(elem) {
$(elem).prev().find('a[data-toggle="tab"]').click();}

//according menu

$(document).ready(function(){
//Add Inactive Class To All Accordion Headers
$('.accordion-header').toggleClass('inactive-header');

//Set The Accordion Content Width
var contentwidth = $('.accordion-header').width();
$('.accordion-content').css({});

//Open The First Accordion Section When Page Loads

$('.accordion-header').first().toggleClass('active-header').toggleClass('inactive-header');
$('.accordion-content').first().slideDown().toggleClass('open-content');

// The Accordion Effect
$('.accordion-header').click(function () {
if($(this).is('.inactive-header')) {

$('.active-header').toggleClass('active-header').toggleClass('inactive-header').next().slideToggle().toggleClass('open-content');
$(this).toggleClass('active-header').toggleClass('i