Re: Tutorial Problems...

2019-08-08 Thread Mike Dewhirst

On 9/08/2019 2:43 am, Emil Lilja wrote:
1. Yeah i know but I've copied the code straight of the tutorial so 
getting a SyntaxError seems odd.


Well you know what Sherlock Holmes would say. Eliminate the impossible 
and what is left must be true.


You can only detect a syntax error by examing your code on line 21. You 
need to understand Python in order to make sense of it. Perhaps you 
could post that line and the few lines above and below and someone here 
might be able to help.





2. Don't think it has anything to do with the migration. I just don't 
see the output of runserver until i terminate it with ctrl-c. Noticed 
recently that it only does this on Git Bash and not windows Cmd


Whether or not doesn't matter when you have a syntax error. Fix that 
first and then migrate




On Thursday, August 8, 2019 at 1:10:27 AM UTC+2, Mike Dewhirst wrote:

Two things ...

Look at the error near the bottom of the traceback and notice it
says there is a syntax faux pas on line 21 of one of your files.
If you find and fix that python will advance to your next error -
if any.

And

runserver is asking you to Ctrl-c and do python manage.py
 migrate --settings=

This will ensure your database matches all the models in your
project including Django's own models.

/Connected by Motorola/


Emil Lilja > wrote:

Hey,

Thanks for your reply!

So yeah i did the tutorial from scratch again and noticed like you
were aiming at that the server was actually running. Even though
the tutorial clearly states that you should get the following
output when running /runserver, /I only seem to get this after i
terminate with Ctrl+C/:/

Performing system checks...

System check identified no issues (0 silenced).

You have unapplied migrations; your app may not work properly until they 
are applied.
Run 'python manage.py migrate' to apply them.

August 03, 2019 - 15:50:53
Django version 2.2, using settings 'mysite.settings'
Starting development server athttp://127.0.0.1:8000/
Quit the server with CONTROL-C.

Anyways i realised why the server probably isn't running, I've
created the polls app and followed all the steps (copied code
exactly) and i get a SyntaxError?
What's causing this?

$ python manage.py runserver
Watching for file changes with StatReloader

### I Press Ctrl+C and get the following output:

   


Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Anaconda3\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\Anaconda3\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "C:\Anaconda3\lib\site-packages\django\utils\autoreload.py",
line 54, in wrapper
fn(*args, **kwargs)
File

"C:\Anaconda3\lib\site-packages\django\core\management\commands\runserver.py",
line 117,
in inner_run
self.check(display_num_errors=True)
File
"C:\Anaconda3\lib\site-packages\django\core\management\base.py",
line 390, in check
include_deployment_checks=include_deployment_checks,
File
"C:\Anaconda3\lib\site-packages\django\core\management\base.py",
line 377, in _run_check
s
return checks.run_checks(**kwargs)
File
"C:\Anaconda3\lib\site-packages\django\core\checks\registry.py",
line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\Anaconda3\lib\site-packages\django\core\checks\urls.py",
line 13, in check_url_confi
g
return check_resolver(resolver)
File "C:\Anaconda3\lib\site-packages\django\core\checks\urls.py",
line 23, in check_resolver
return check_method()
File "C:\Anaconda3\lib\site-packages\django\urls\resolvers.py",
line 398, in check
for pattern in self.url_patterns:
File "C:\Anaconda3\lib\site-packages\django\utils\functional.py",
line 80, in __get__
res = instance.__dict__[self.name ] =
self.func(instance)
File "C:\Anaconda3\lib\site-packages\django\urls\resolvers.py",
line 579, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
File "C:\Anaconda3\lib\site-packages\django\utils\functional.py",
line 80, in __get__
res = instance.__dict__[self.name ] =
self.func(instance)
File "C:\Anaconda3\lib\site-packages\django\urls\resolvers.py",
line 572, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Anaconda3\lib\importlib\__init__.py", line 127, in
import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 724, in exec_module
File 

Key Error in form.cleaned_data

2019-08-08 Thread Mei B
I'm using a formset, and i'm trying to iterate through all the cleaned 
data except I keep getting a Keyerror no matter what field I try..

for form in formset:
   data = form.cleaned_data
   name = data["name"]

--->  KeyError: "name"

class VariableForm(forms.Form):
name = forms.CharField()
default = forms.CharField(required=False)

Formset = formset_factory(
VariableForm,
can_delete=True,
extra=1,
)

What is wrong with my code?

I can even print(data) and it outputs:
 {'DELETE': False, 'name': 'PATH', 'default': '/opt/tests'}

I can even do, for key, value in data.items(): and output
delete false
   name 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a90c04fa-6e1b-4a3d-a813-2661cc6df725%40googlegroups.com.


Re: Local django server - login fails with new safari version

2019-08-08 Thread Balu krishnan
Please clear your cache and try again

On Thu, Aug 8, 2019 at 10:23 PM Stephen McGonigal <
mcgonigalstep...@gmail.com> wrote:

> I've updated my MacBook to the latest Mojave 10.14.6 version. Since that
> update I'm not able to login into my locally installed django webserver
> using Safari anymore. I always get the error message "Invalid CSRF token".
> With Chrome it's working.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/145977b5-4680-4b35-a93a-1bc19db85bcb%40googlegroups.com
> 
> .
>

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


Fullstack Developer//Fort Worth, TX//Long term//crop to crop

2019-08-08 Thread nikhil amrutham


Hi All

Greeting from Simba Staffi

Job Title: Fullstack Developer

Location: Fort Worth, TX

Duration: Long term

 

Job Description:

The ideal developer would be a full stack developer that understands both 
the backend development plus front end development patterns/frameworks/etc.

Full Stack + ReactJS

 

· As a backend developer, the following is important and 
should be met:

· Job Responsibilities:

· UI Developer with 6-8 years of experience and java 
specifics

· Experienced Spring Boot development, with use of the 
Gradle dependency management system

· Experienced REST API development

· Jenkins

· GitHub

· Agile methodology

· Understanding of common databases (DB2, Cassandra, etc.)

· Good verbal and written communications skills.

· Good at working within a team environment.

 

*Thanks & Regards,*

Surender

*Simba Staffing Consulting*

Email : *suren...@simbastaffing.com *

PH: *+1512 879-9925*

 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/59a1847a-410c-4077-8ecd-976aa91564e2%40googlegroups.com.


Css is not updateing

2019-08-08 Thread 2018 sr
Hi all,

I am working on django i am trying to update the css file but it is 
modified on styles.css file but not reflecting on browser 

this is my css file 



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4882329d-5fb1-4261-a4ca-bd81cede8f12%40googlegroups.com.


Local django server - login fails with new safari version

2019-08-08 Thread Stephen McGonigal
I've updated my MacBook to the latest Mojave 10.14.6 version. Since that 
update I'm not able to login into my locally installed django webserver 
using Safari anymore. I always get the error message "Invalid CSRF token". 
With Chrome it's working.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/145977b5-4680-4b35-a93a-1bc19db85bcb%40googlegroups.com.


Latest Safari update prevents login

2019-08-08 Thread Stephen McGonigal
Login to locally run webserver no longer working.
I've updated my MacBook to the latest Mojave 10.14.6 (18G87) version. Since 
that update I'm not able to login into local django webserver using Safari 
anymore. I always get the error message "Invalid CSRF token". With Chrome 
it's working.
I also have my local server installed remotely on a UAT server and that 
still wotks fine in Safari.
Does anyone know how to get around this?

Many thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7db7db14-74a8-43c2-bd8f-140d720a5491%40googlegroups.com.


Re: SyntaxError: positional argument follows keyword argument

2019-08-08 Thread DANIEL URBANO DE LA RUA
Show the imports o  your file

On Thu, 8 Aug 2019, 18:36 Kasper Laudrup  Hi Kean,
>
> On 08/08/2019 17.59, Kean wrote:
> > Hi,
> >
> > New to Django for the expression below, i get
> >
> > def breg(request):
> > form = UserCreationForm()
> > return render(request=request, template_name="source/breg.html",
> > {'forms':form})
> >
> >   I get the following error
> >
> > SyntaxError: positional argument follows keyword argument
> >
> >   Please can anyone help?
> >
>
> This is not really something special to Django. This is pretty basic
> Python. Maybe something like this will help:
>
> https://www.programiz.com/python-programming/function-argument
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/df720f0c-84aa-7611-bdcd-65793a5bdfea%40stacktrace.dk
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO_yRT3%2BAts9-sv%3DcshvryKywHU%2B2Sqq8MNdg5Hg5zHhz-y3rQ%40mail.gmail.com.


Re: Tutorial Problems...

2019-08-08 Thread Emil Lilja
1. Yeah i know but I've copied the code straight of the tutorial so getting 
a SyntaxError seems odd.

2. Don't think it has anything to do with the migration. I just don't see 
the output of runserver until i terminate it with ctrl-c. Noticed recently 
that it only does this on Git Bash and not windows Cmd

On Thursday, August 8, 2019 at 1:10:27 AM UTC+2, Mike Dewhirst wrote:
>
> Two things ...
>
> Look at the error near the bottom of the traceback and notice it says 
> there is a syntax faux pas on line 21 of one of your files. If you find and 
> fix that python will advance to your next error - if any.
>
> And
>
> runserver is asking you to Ctrl-c and do python manage.py migrate 
> --settings=
>
> This will ensure your database matches all the models in your project 
> including Django's own models.
>
> *Connected by Motorola*
>
>
> Emil Lilja > wrote:
>
> Hey,
>
> Thanks for your reply!
>
> So yeah i did the tutorial from scratch again and noticed like you were 
> aiming at that the server was actually running. Even though the tutorial 
> clearly states that you should get the following output when running 
> *runserver, 
> *I only seem to get this after i terminate with Ctrl+C*:*
>
> Performing system checks...
>
> System check identified no issues (0 silenced).
>
> You have unapplied migrations; your app may not work properly until they are 
> applied.
> Run 'python manage.py migrate' to apply them.
>
> August 03, 2019 - 15:50:53
> Django version 2.2, using settings 'mysite.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
>
> Anyways i realised why the server probably isn't running, I've created the 
> polls app and followed all the steps (copied code exactly) and i get a 
> SyntaxError?
> What's causing this?
>
> $ python manage.py runserver  
>  Watching for file changes with StatReloader  
>
>
> ### I Press Ctrl+C and get the following output:
>
>   
> Exception in thread django-main-thread:   
>  Traceback (most recent call last):   
> File "C:\Anaconda3\lib\threading.py", 
> line 917, in _bootstrap_inner  self.run() 
>   
> File "C:\Anaconda3\lib\threading.py", line 865, in run
>self._target(*self._args, **self._kwargs)  
>   File 
> "C:\Anaconda3\lib\site-packages\django\utils\autoreload.py", line 54, in 
> wrapperfn(*args, **kwargs)
>   File 
> "C:\Anaconda3\lib\site-packages\django\core\management\commands\runserver.py",
>  line 117, in inner_run   
>self.check(display_num_errors=True)
>   File 
> "C:\Anaconda3\lib\site-packages\django\core\management\base.py", line 390, in 
> check include_deployment_checks=include_deployment_checks,
>  File 
> "C:\Anaconda3\lib\site-packages\django\core\management\base.py", line 377, in 
> _run_checks   
>return checks.run_checks(**kwargs) 
>   File 
> "C:\Anaconda3\lib\site-packages\django\core\checks\registry.py", line 72, in 
> run_checks new_errors = check(app_configs=app_configs)
>   File 
> "C:\Anaconda3\lib\site-packages\django\core\checks\urls.py", line 13, in 
> check_url_config  
> return check_resolver(resolver)   
>File 
> "C:\Anaconda3\lib\site-packages\django\core\checks\urls.py", line 23, in 
> check_resolver return check_method()  
>   File 
> "C:\Anaconda3\lib\site-packages\django\urls\resolvers.py", line 398, in check 
>   for pattern in self.url_patterns:   
>  File 
> "C:\Anaconda3\lib\site-packages\django\utils\functional.py", line 80, in 
> __get__res = instance.__dict__[self.name] = self.func(instance)   
>   File 
> "C:\Anaconda3\lib\site-packages\django\urls\resolvers.py", line 579, in 
> url_patternspatterns = getattr(self.urlconf_module, "urlpatterns", 
> self.urlconf_module)  File 
> 

Re: SyntaxError: positional argument follows keyword argument

2019-08-08 Thread Kasper Laudrup

Hi Kean,

On 08/08/2019 17.59, Kean wrote:

Hi,

New to Django for the expression below, i get

def breg(request):
form = UserCreationForm()
return render(request=request, template_name="source/breg.html", 
{'forms':form})


  I get the following error

SyntaxError: positional argument follows keyword argument

  Please can anyone help?



This is not really something special to Django. This is pretty basic 
Python. Maybe something like this will help:


https://www.programiz.com/python-programming/function-argument

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/df720f0c-84aa-7611-bdcd-65793a5bdfea%40stacktrace.dk.


Re: SyntaxError: positional argument follows keyword argument

2019-08-08 Thread Andreas Hasenkopf
Hi,

using keyword arguments consistently might help, e.g.:

return render(
  request=request, 
  template_name="source/breg.html", 
  context={'forms':form}
)

CU

Am 8. August 2019 17:59:40 MESZ schrieb Kean :
>Hi, 
>
>New to Django for the expression below, i get
>
>def breg(request):
>form = UserCreationForm()
>return render(request=request, template_name="source/breg.html", 
>{'forms':form})
>
> I get the following error
>
>SyntaxError: positional argument follows keyword argument
>
> Please can anyone help?
>
>Best,
>
>K

-- 
Andreas Hasenkopf
Phone: +49 151 11728439
Homepage: https://www.hasenkopf.xyz
-- 
Andreas Hasenkopf
Phone: +49 151 11728439
Homepage: https://hasenkopf.xyz

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7125E8F6-AF8A-4161-98F3-FFD6B9F71459%40hasenkopf2000.net.


SyntaxError: positional argument follows keyword argument

2019-08-08 Thread Kean
Hi, 

New to Django for the expression below, i get

def breg(request):
form = UserCreationForm()
return render(request=request, template_name="source/breg.html", 
{'forms':form})

 I get the following error

SyntaxError: positional argument follows keyword argument

 Please can anyone help?

Best,

K

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dcd90d10-389f-4abc-a162-c0108aa95711%40googlegroups.com.


Understanding FILE_UPLOAD_MAX_MEMORY_SIZE vs. DATA_UPLOAD_MAX_MEMORY_SIZE

2019-08-08 Thread Valentin
Dear Django community,

Hi have problems understanding the difference between 
FILE_UPLOAD_MAX_MEMORY_SIZE vs. DATA_UPLOAD_MAX_MEMORY_SIZE.

Previously, I used django 1.11 and I had two different values, as we wanted 
to allow bigger file uploads than normal requests. So we had a higher limit 
for FILE_UPLOAD_MAX_MEMORY_SIZE.

However, after moving to django 2.x, I needed to increase the 
DATA_UPLOAD_MAX_MEMORY_SIZE value to allow big file uploads, and I don't 
understand why, as it is explicitely stated in the documentation 
that uploaded files are not considered for FILE_UPLOAD_MAX_MEMORY_SIZE.

The check is done when accessing request.body or request.POST and is 
> calculated against the total request size excluding any file upload data. 
>

I'm using django 2.2.2 together with djangorestframework 3.9.4.

So the questions are:

- should they work as stated in the documentation?
- why don't they work like that for my setup?

So happy for any hint!

Thank you,
Valentin

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/70ea7c85-e678-46da-9f8c-1a260f35854d%40googlegroups.com.