Re: Can't Install on Windows 8.1

2013-12-25 Thread Felipe Bessa Coelho
2013/12/25 Malik Rumi 

> Ok, everything went smoothly and beautifully as promised. I got successful
> install messages for pip, distribute, virtualenv and django. So first,
> thank you both very much.
>
> However, I seem to be stuck again. I am not sure how to get from my new
> virtualenv to django, and windows seems just as confused. When I tried
> startproject, windows suddenly wanted to know if I wanted to keep using
> python to open .py files, or use notepad or some other program? I said
> python, and then it hiccuped, like it was restarting Explorer, and the
> command line went back to the prompt with no evidence it executed the
> startproject command. I looked in the directory, but saw nothing to
> indicate there was a project started. Of course, never having worked with
> either django or virtualenv before, I could have missed it. So I tried
> again.
>
>  As before, a dialog window opened asking me what program I wanted to
> use. While I was taking a screenshot to save for these notes, the dialog
> went away and the cmd line reported back that access was denied.
>
> Then I tried get_version and was told there was no module named django,
> even though just a few lines earlier I was told django was successfully
> installed.
>
> Here is that last portion from my command line window:
>
> *C:\Program Files\Ampps\python\Scripts>project_sl1\Scripts\activate*
>
> *(project_sl1) C:\Program Files\Ampps\python\Scripts>pip install django*
>
> *Downloading/unpacking django*
>
> *  Downloading Django-1.6.1.tar.gz (6.6MB): 6.6MB downloaded*
>
> *  Running setup.py egg_info for package django*
>
> *warning: no previously-included files matching '__pycache__' found *
>
> *under dir*
>
> *ectory '*'*
>
> *warning: no previously-included files matching '*.py[co]' found *
>
> *under direct*
>
> *ory '*'*
>
> *Installing collected packages: django*
>
> *  Running setup.py install for django*
>
> *warning: no previously-included files matching '__pycache__' found *
>
> *under dir*
>
> *ectory '*'*
>
> *warning: no previously-included files matching '*.py[co]' found *
>
> *under direct*
>
> *ory '*'*
>
> *Successfully installed django*
>
> *Cleaning up...*
>
>
> *(project_sl1) C:\Program Files\Ampps\python\Scripts>django-admin.py *
>
>
> *startproject*
>
> * project_sl1*
>
>
> *(project_sl1) C:\Program Files\Ampps\python\Scripts>django-admin.py *
>
>
> *startproject*
>
> * project_sl1*
>
> *Access is denied.*
>
>
> *(project_sl1) C:\Program Files\Ampps\python\Scripts>*
>
> Just to be clear, I do want to get past this but I also want to understand
> what is going on, so if you can do both, that would be great. Do I need to
> change directories? Try opening a django project thrui the django gui?
> Where / how would I do that? Everything I have done so far has been thru
> the windows command line.
> Thanx.
> - -
>


Instead of trying to  execute django-admin.py directly, explicitly tell the
prompt that you want to use python:

python C:\Path\To\django-admin.py startproject project_sl1

If you have problems with that, try specifying the python interpreter
directly as well:

C:\Path\To\Virtualenv\Scripts\python.exe C:\Path\To\django-admin.py
startproject project_sl1

Also, it might not be an issue right now, but for your own good, make sure
everything related to your project (which includes: the Python
installation, your virtualenv and the project itself) does not contain any
spaces in the pathnames, it might not be an issue right now, but you'll be
glad you did this later.

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


Re: what are the files goes inside "contrib" folder?

2014-02-07 Thread Felipe Bessa Coelho
2014-02-07 Giri :

> Can someone tell me what are the files goes inside "contrib" folder?
>
> If possible give me a webpage link that explains django's folder
> structure..
>
> I don't remember whether there is a overall description of the Django
project structure, but at least for the contrib apps, you can find them in
[1].

[1] https://docs.djangoproject.com/en/dev/ref/contrib/
-- 
Felipe

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


Re: Override grappelli js files

2014-02-25 Thread Felipe Bessa Coelho
2014-02-25 17:18 GMT-03:00 rush :

> Hi,
>
> I'm using grappelli and I have two files in it I need to modify:
>
> admin/js/SelectBox.js
> admin/js/SelectFilter2.js
>
> I thought it would be a good idea to put it into my app static directory:
>
> my_app/static/admin/js/SelectBox.js
> my_app/static/admin/js/SelectFilter2.js
>
> But whenever I try ./manage.py collectstatic files from my_app are
> overrided by original files from grappelli, however I need it vice versa.
>
> I need just to add several strings in this files into existing functions,
> so I can't handle it within a new js files and include into Media class (
> from my point of view ).
>
> Is there any way to override grappelli files?
>

When collecting static files, if there are multiple files with the same
name Django will pick the first one it finds. [1] What that means is,
unless you've changed STATICFILES_FINDERS, files inside folders in
STATICFILES_DIRS will have the highest priority. And if static files inside
apps are used, Django will follow the INSTALLED_APPS order, meaning you
probably have grappelli _above_ my_app.

If for whatever reason you don't want/can't change the order your apps
appear in INSTALLED_APPS, you may consider placing those files in a folder
using STATICFILES_DIRS.

[1]
https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-STATICFILES_FINDERS

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP5dYfP7pmXZsR592gx%2Bp%3DND1w9__Jq%3Dyzxnok2BFj5Gsi1rsw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: "Authenticating Users" where should I put the code?

2014-03-06 Thread Felipe Bessa Coelho
2014-03-06 11:45 GMT-03:00 Jack Yan :

> in the tutorial and section "Authenticating Users":
> https://docs.djangoproject.com/en/1.6/topics/auth/default/
>
> where can I put code:
>
> from django.contrib.auth import authenticateuser = 
> authenticate(username='john', password='secret')if user is not None:
> # the password verified for the user
> if user.is_active:
> print("User is valid, active and authenticated")
> else:
> print("The password is valid, but the account has been 
> disabled!")else:
> # the authentication system was unable to verify the username and password
> print("The username and password were incorrect.")
>
> in what file or what folder?
>

That is described later in the same page [1].

But if you just want to enable login/logout/password reset for your
project, the easiest way is to include Django's default auth views in your
urls.py [2].

[1]
https://docs.djangoproject.com/en/1.6/topics/auth/default/#how-to-log-a-user-in
[2]
https://docs.djangoproject.com/en/1.6/topics/auth/default/#module-django.contrib.auth.views

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP5dYfNxCPTL%2BcqK%3DHaQBhKPYQSZ-BMqKnHk7vu-vJuqg84K2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.