Search Results

Search found 5330 results on 214 pages for 'django auth'.

Page 96/214 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • How painful is a django project upload to a live (staging) site?

    - by Ignacio
    Hi, I've getting quite fast with a small django project of mine, which I'm developing locally, of course. But, as I had never worked with django before, I'm not aware of what it implies to upload it and test it on a production server. And I'm quite curious, since I'm very eager to test an early release live. I know there is this document, which I think it'll be really helpful: http://djangobook.com/en/2.0/chapter12/ But, are there any details I should take into account before, during and after the deployment? Any advice or best practices? Thanks.

    Read the article

  • Django: do I need to do HttpResponseRedirect to render a simple string after a POST?

    - by AP257
    I've got a mobile app that makes POST requests to a Django site. I want to return a simple string (not a template-based page) after the app makes the POST request, saying 'Success' or 'Failure' as appropriate. However I know that after a POST request in Django you're supposed to do a HttpResponseRedirect. But, do I really need to redirect to another page and write a new function to handle it, all to output a string? And if so, how do I pass the success/failure status of the app in the HttpResponseRedirect, since it's only supposed to take one argument? Thanks!

    Read the article

  • How painful is a django project deployment to a live (staging) site?

    - by Ignacio
    Hi, I've getting quite fast with a small django project of mine, which I'm developing locally, of course. But, as I had never worked with django before, I'm not aware of what it implies to upload it and test it on a production server. And I'm quite curious, since I'm very eager to test an early release live. I know there is this document, which I think it'll be really helpful: http://djangobook.com/en/2.0/chapter12/ But, are there any details I should take into account before, during and after the deployment? Any advice or best practices? Thanks.

    Read the article

  • Connect to a DB with an encrypted password with Django?

    - by Liam
    My place of employment requires that all passwords must be encrypted, including the ones used to connect to a database. What's the best way of handling this? I'm using the development version of Django with MySQL at the moment, but I will be eventually migrating to Oracle. Is this a job for Django, or the database? Edit: The encrypted password should be stored in the settings.py file, or somewhere else in the filesystem. This is the password that will be used to connect to the database.

    Read the article

  • How to start doing TDD in a django project?

    - by Satoru.Logic
    Hi, all. I have read a lot of essays talking about benifits TDD can bring to a project, but I have never practiced TDD in my own project before. Now I'm starting an experimental project with Django, and I think maybe I can have a try of TDD. But what I find now is that I don't even know how to answer the question "what should I put in my test cases?". Please tell me how should I plan TDD in a project, in this case, a web project based on Django. Thanks.

    Read the article

  • Why would Django fcgi just die? How can I find out?

    - by Joe
    I'm running Django on Linux using fcgi and Lighttpd. Every now and again (about once a day) the server just dies. I'm using the latest stable release of Django, Python and Lighttpd. The only thing I can think of is that my program is opening a lot of files and executing a lot of external processes, but I'm fairly sure that side of things is watertight. Looking at the error and access logs, there's nothing exceptional happening (i.e. load isn't above normal). On those occasions where I have had exceptions from Python, these have shown up in the error.log, but when this crash happens I get nothing. Is there any way of finding out why the process died? Short of putting logging statements on every single line? Obviously I can't reproduce this so I don't know exactly where to look.

    Read the article

  • How to select random image of specific size using Django / Python?

    - by Jonathan
    I've been using this little snippet to select random images. However I would like to change it to select only images of a certain size. I'm running into trouble checking against image size. If I use get_image_dimensions() I need to use a conditional statement, which then requires that I allow exceptions. So, I guess I need some pointers on just limiting by image dimensions. Thanks. import os import random import posixpath from django import template from django.conf import settings register = template.Library() def is_image_file(filename): """Does `filename` appear to be an image file?""" img_types = [".jpg", ".jpeg", ".png", ".gif"] ext = os.path.splitext(filename)[1] return ext in img_types @register.simple_tag def random_image(path): """ Select a random image file from the provided directory and return its href. `path` should be relative to MEDIA_ROOT. Usage: <img src='{% random_image "images/whatever/" %}'> """ fullpath = os.path.join(settings.MEDIA_ROOT, path) filenames = [f for f in os.listdir(fullpath) if is_image_file(f)] pick = random.choice(filenames) return posixpath.join(settings.MEDIA_URL, path, pick)

    Read the article

  • Django Custom Field: Only run to_python() on values from DB?

    - by Adam Levy
    How can I ensure that my custom field's *to_python()* method is only called when the data in the field has been loaded from the DB? I'm trying to use a Custom Field to handle the Base64 Encoding/Decoding of a single model property. Everything appeared to be working correctly until I instantiated a new instance of the model and set this property with its plaintext value...at that point, Django tried to decode the field but failed because it was plaintext. The allure of the Custom Field implementation was that I thought I could handle 100% of the encoding/decoding logic there, so that no other part of my code ever needed to know about it. What am I doing wrong? (NOTE: This is just an example to illustrate my problem, I don't need advice on how I should or should not be using Base64 Encoding) def encode(value): return base64.b64encode(value) def decode(value): return base64.b64decode(value) class EncodedField(models.CharField): __metaclass__ = models.SubfieldBase def __init__(self, max_length, *args, **kwargs): super(EncodedField, self).__init__(*args, **kwargs) def get_prep_value(self, value): return encode(value) def to_python(self, value): return decode(value) class Person(models.Model): internal_id = EncodedField(max_length=32) ...and it breaks when I do this in the interactive shell. Why is it calling to_python() here? >>> from myapp.models import * >>> Person(internal_id="foo") Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/local/lib/python2.6/dist-packages/django/db/models/base.py", line 330, in __init__ setattr(self, field.attname, val) File "/usr/local/lib/python2.6/dist-packages/django/db/models/fields/subclassing.py", line 98, in __set__ obj.__dict__[self.field.name] = self.field.to_python(value) File "../myapp/models.py", line 87, in to_python return decode(value) File "../myapp/models.py", line 74, in decode return base64.b64decode(value) File "/usr/lib/python2.6/base64.py", line 76, in b64decode raise TypeError(msg) TypeError: Incorrect padding I had expected I would be able to do something like this... >>> from myapp.models import * >>> obj = Person(internal_id="foo") >>> obj.internal_id 'foo' >>> obj.save() >>> newObj = Person.objects.get(internal_id="foo") >>> newObj.internal_id 'foo' >>> newObj.internal_id = "bar" >>> newObj.internal_id 'bar' >>> newObj.save() ...what am I doing wrong?

    Read the article

  • How do I point a domain name to a Django url?

    - by username2
    I have a subdomain m.example.com that I want to point to the same location as example.com/mobile running on an apache2/django1.3 installation. example.com is the landing page, and I have the urls.py configured such that urls that match /^mobile$/ will be served the mobile version of the page. I looked into <VirtualHost>, but I think it requires a physical location for me to point m.example.com at and with the django urls there is no physical location except for the root of the project directory. I am unsure if the configuration change is made on the apache side or the django side. I've also looked into the mod_rewrite module for Apache, but I would prefer if I didnt have to redirect m.example.com to example.com/mobile

    Read the article

  • django: how to use many-to-many relationships in values()?

    - by john
    i need to group results by a field that requires a few joins from the original model: // response_filter_args is created dynamically responses = Response.objects.filter(**response_filter_args) \ .values('customer__tags__tag') \ # django doesn't like this .annotate(average_score=Avg('rating__score')) Response - customer - tags (many-to-many field pointing to Tag) - tag (the tag as a string) Models are: class Response(models.Model): customer = models.ForeignKey(Customer) ... class Customer(models.Model): tags = models.ManyToManyField(Tag) ... class Tag(models.Model): tag = models.CharField(max_length=255) ... i'm trying to calculate average ratings. to make it work i need to tell django to group by 'tag', but it refuses to. it gives an error: Invalid field name: 'customer__tags__tag' anyone know how i can get it to group by tag? i've tried all the combinations of underscores in customer_tags_tag that i can think of, but nothing works.

    Read the article

  • Flickr 'Invalid auth token (98)' Uploading videos from Asp.net Application

    - by pat8719
    I am attempting to allow user to upload videos to Flickr from an Asp.net application using the FlickrNet library/API. I've obtained an API key and an API secret from Flickr. Additionally I am retrieving an authToken using the AuthGetFrob method from the FlickrNet library. My Using Statements are as Follows using System; using System.Collections.Generic; using System.Linq; using System.Text; using FlickrNet; I have created two methods to accomplish this task. One which gets and returns the AuthToken private string GetAuthenticateToken() { Flickr flickr = new Flickr(FLICKR_API_KEY, FLICKR_API_SECRET); string frob = flickr.AuthGetFrob(); return flickr.AuthCalcUrl(frob, AuthLevel.Write); } And One the Uploads the File Using that AuthToken public void UploadFile(string fileName, string title, string description) { try { string authToken = GetAuthenticateToken(); Flickr flickr = new Flickr(FLICKR_API_KEY, FLICKR_API_SECRET, authToken); string photoId = flickr.UploadPicture(fileName, title, description, "", true, false, false); } catch (Exception ex) { throw ex; } } However, when I make the call to 'UploadPicture' the following exception is thrown. 'Invalid auth token (98)'. The contents of the AuthRequest Http request looks like this. <?xml version="1.0" encoding="utf-8" ?> <rsp stat="ok"> <frob>72157627073829842-9d8e31b9dcf41ea1-162888</frob> </rsp> And the content of the Upload methods Http request looks like this. <?xml version="1.0" encoding="utf-8" ?> <rsp stat="fail"> <err code="98" msg="Invalid auth token" /> </rsp> I saw a similar post on the flickr forums here but based on my understanding, it appears that I am doing everything right yet still cannot figure what I am doing wrong. Any help would be greatly appreciated.

    Read the article

  • PHP cURL JSON Decode (X-AUTH Header)

    - by TheCyX
    <?php // Show Profile $curl = curl_init(); curl_setopt ($curl, CURLOPT_URL, "https://example/api"); curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt ($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ; curl_setopt ($curl, CURLOPT_HTTPHEADER, array('X-AUTH: 123456789')); $projects = curl_exec($curl); // This is empty? echo $projects; //Decode $phpArray = json_decode($projects); print_r($phpArray); foreach ($phpArray as $key => $value) { // Line 17, sure its empty, but why? echo "<p>$key | $value</p>"; } ?> Warning: Invalid argument supplied for foreach() in /html/api.php on line 17 The API needs this authentification: $ curl -i -H "X-AUTH: 123456789" https://example/api JSON File: {"id":"123456","hostId":null,"Nickname":"thecyx","DisplayName":"thecyx","AppDisplayName":"thecyx","Score":"300","Account":"Full"} The $project variable is empty. If I'm posting the API Url in the Broswer its working. And, if possible, what's the correct way to get the JSON Data e.g. [Nickname],[Score]?

    Read the article

  • Apache+LDAP auth on Ubuntu says "Can't contact LDAP server" while ldapsearch is perfect

    - by tw79
    Hi Gurus, I'm migrating from an existing apache+LDAP+mysql+php server to a new hardware platform. Old server is running Debian Lenny, which I have no config documentation available (was done by previous sysadmin); New server is running Ubuntu 10.04.2 LTS 32bit. After installing Apache and configured LDAP client on the new server, ldapsearch to the LDAP master (another dedicated server) returns results just fine. However, when using apache with https, logs complain that "Can't contact LDAP server". I'm authenticating using ldaps and can confirm that 636 port is open on the LDAP master. I can't understand why apache would fail while regular ldapsearch is working! Below is part of the virtualhost config: <Directory /> Options FollowSymLinks AllowOverride None #AuthLDAPEnabled on AuthType Basic AuthBasicProvider ldap AuthName "Private" AuthLDAPURL ldaps://master.ldap.organisation.com:636/ou=people,dc=organisation,dc=com?uid AuthzLDAPAuthoritative off require valid-user AddType application/x-httpd-php .php .phtml <IfModule mod_php4.c> php_flag magic_quotes_gpc Off php_flag track_vars On php_value include_path . </IfModule> </Directory> Any help/suggestion is very much appreciated!

    Read the article

  • Prosody mod auth external not working

    - by Yang
    I installed mod_auth_external for 0.8.2 on ubuntu 12.04 but it's not working. I have external_auth_command = "/home/yang/chat/testing" but it's not getting invoked. I enabled debug logging and see no messages from that mod. Any help? I'm using the Candy example client. Here's what's written to the log after I submit a login request (and nothing in err log): Oct 24 21:02:43 socket debug server.lua: accepted new client connection from 127.0.0.1:40527 to 5280 Oct 24 21:02:43 mod_bosh debug BOSH body open (sid: %s) Oct 24 21:02:43 boshb344ba85-fbf5-4a26-b5f5-5bd35d5ed372 debug BOSH session created for request from 169.254.11.255 Oct 24 21:02:43 mod_bosh info New BOSH session, assigned it sid 'b344ba85-fbf5-4a26-b5f5-5bd35d5ed372' Oct 24 21:02:43 httpserver debug Sending response to bf9120 Oct 24 21:02:43 httpserver debug Destroying request bf9120 Oct 24 21:02:43 httpserver debug Request has destroy callback Oct 24 21:02:43 socket debug server.lua: closed client handler and removed socket from list Oct 24 21:02:43 mod_bosh debug Session b344ba85-fbf5-4a26-b5f5-5bd35d5ed372 has 0 out of 1 requests open Oct 24 21:02:43 mod_bosh debug and there are 0 things in the send_buffer Oct 24 21:02:43 socket debug server.lua: accepted new client connection from 127.0.0.1:40528 to 5280 Oct 24 21:02:43 mod_bosh debug BOSH body open (sid: b344ba85-fbf5-4a26-b5f5-5bd35d5ed372) Oct 24 21:02:43 mod_bosh debug Session b344ba85-fbf5-4a26-b5f5-5bd35d5ed372 has 1 out of 1 requests open Oct 24 21:02:43 mod_bosh debug and there are 0 things in the send_buffer Oct 24 21:02:43 mod_bosh debug Have nothing to say, so leaving request unanswered for now Oct 24 21:02:43 httpserver debug Request c295d0 left open, on_destroy is function(mod_bosh.lua:81) Here's the config I added: modules_enabled = { ... "bosh"; -- Enable BOSH clients, aka "Jabber over HTTP" ... } authentication = "external" external_auth_protocol = "generic" external_auth_command = "/home/yang/chat/testing"

    Read the article

  • htaccess rewrite and auth conflict

    - by Michael
    I have 2 directories each with a .htaccess file: html/.htaccess - There is a rewrite in this file to send almost everything to url.php RewriteCond %{REQUEST_URI} !(exported/?|\.(php|gif|jpe?g|png|css|js|pdf|doc|xml|ico))$ RewriteRule (.*)$ /url.php [L] and html/exported/.htaccess AuthType Basic AuthName "exported" AuthUserFile "/home/siteuser/.htpasswd" require valid-user If I remove html/exported/.htaccess the rewriting works fine and the exported directory can be access. If I remove html/.htaccess the authentication works fine. However when I have both .htaccess files exported/ is being rewritten to /url.php. Any ideas how I can prevent it?

    Read the article

  • postfix specify limited relay domain while allowing sasl-auth relay

    - by tylerl
    I'm trying to set up postfix to allow relaying under a limited set of conditions: The destination domain is one of a pre-defined list -or- The client successfully logs in Here's the relevant bits o' config: smtpd_sasl_auth_enable=yes relay_domains=example.com smtpd_recipient_restrictions=permit_auth_destination,reject_unauth_destination smtpd_client_restrictions=permit_sasl_authenticated,reject The problem is that it requires that BOTH restrictions be satisfied, rather than either-or. Which is to say, it only allows relaying if the client is authenticated AND the recipient domain is @example.com. Instead, I need it to allow relaying if either one of the requirements is satisfied. How do I do this without resorting to running SMTP on two separate ports with different rules? Note: The context is an outbound-use-only (bound to 127.0.0.1) MTA on a shared web server which all site owners are allowed to relay mail to one of the "owned" domains (not server-local, though), and for which a limited set of "trusted" site owners are allowed to relay mail without restriction provided they have a valid SMTP login.

    Read the article

  • SQL Server Windows Auth Login not working

    - by Mr Shoubs
    I've had someone set up a domain controller on windows 2008 on one server, and sql server 2008 on another. The domain seems to be working fine, I'm logged on as a domain user on both servers, nothing seems to be a problem there. However, when I try to add a domain user/group to SQL Server Security (e.g. clicking ok from the create login screen) it says it can't find it (even though I've used the search to find the correct account in the first place), when I try to logon (even though I haven't added it yet) it says something about the account being part of an untrusted domain instead of saying I don't have permission to log on. Anyone have any ideas on what is set up incorrectly?

    Read the article

  • SSH Kerberos Auth in Mac OSX 10.7

    - by deemstone
    I just upgrade my Mac OS to 10.7 Lion. It has worked well before. But , Only kinit working normally now, can't ssh to my server. After reinstall the "Mac OS X Kerberos Extras" , nothing better. Anyone give me a help? Thanks a lot!! my command line : Myname$ ssh [email protected] -v ...... debug1: Authentications that can continue: gssapi-with-mic,password debug1: Next authentication method: gssapi-with-mic debug1: Miscellaneous failure (see text) UNKNOWN_SERVER while looking up 'host/[email protected]' (cached result, timeout in 1200 sec) debug1: An invalid name was supplied unknown mech-code 0 for mech 1 2 752 43 14 2 debug1: Miscellaneous failure (see text) unknown mech-code 0 for mech 1 3 6 1 5 5 14 debug1: Authentications that can continue: gssapi-with-mic,password debug1: An unsupported mechanism was requested unknown mech-code 0 for mech 1 3 5 1 5 2 7 debug1: Miscellaneous failure (see text) unknown mech-code 0 for mech 1 3 6 1 5 2 5 debug1: Next authentication method: password [email protected]'s password:

    Read the article

  • Problems with LDAP auth in Apache, works only for one group

    - by tore-
    Hi, I'm currently publishing some subversions repos within Apache: <Location /dev/> DAV svn SVNPath /opt/svn/repos/dev/ AuthType Basic AuthName "Subversion repo authentication" AuthBasicProvider ldap AuthzLDAPAuthoritative On AuthLDAPBindDN "CN=readonlyaccount,OU=Objects,DC=invalid,DC=now" AuthLDAPBindPassword readonlyaccountspassword AuthLDAPURL "ldap://invalid.domain:389/OU=Objects,DC=invalid,DC=domain?sAMAccountName?sub?(objectClass=*)" Require ldap-group cn=dev,ou=SVN,DC=invalid,DC=domain </Location> This setup works great, but now we want to give an LDAP group read only access to our repo, then my apache config looks like this: <Location /dev/> DAV svn SVNPath /opt/svn/repos/dev/ AuthType Basic AuthName "Subversion repo authentication" AuthBasicProvider ldap AuthzLDAPAuthoritative On AuthLDAPBindDN "CN=readonlyaccount,OU=Objects,DC=invalid,DC=now" AuthLDAPBindPassword readonlyaccountspassword AuthLDAPURL "ldap://invalid.domain:389/OU=Objects,DC=invalid,DC=domain?sAMAccountName?sub?(objectClass=*)" <Limit OPTIONS PROPFIND GET REPORT> Require ldap-group cn=dev-ro,ou=SVN,dc=invalid,dc=domain </Limit> <LimitExcept OPTIONS PROPFIND GET REPORT> Require ldap-group cn=dev-rw,ou=SVN,dc=invalid,dc=domain </LimitExcept> </Location> All of my user accounts is under: OU=Objects,DC=invalid,DC=domain All groups related to subversion is under: ou=SVN,dc=invalid,dc=domain The problem after modification, only users in the dev-ro LDAP group is able to authenticate. I know that authentication with LDAP works, since my apache logs show my usernames: 10.1.1.126 - tore [...] "GET /dev/ HTTP/1.1" 200 339 "-" "Mozilla/5.0 (...)" 10.1.1.126 - - [...] "GET /dev/ HTTP/1.1" 401 501 "-" "Mozilla/4.0 (...)" 10.1.1.126 - readonly [...] "GET /dev/ HTTP/1.1" 401 501 "-" "Mozilla/4.0 (...) line = user in group dev-rw, 2. line is unauthenticated user, 3. line is unauthenticated user, authenticated as a user in group dev-ro So I think I've messed up my apache config. Advise?

    Read the article

  • Apache LDAP auth: denied all time

    - by Dmytro
    There is my config (httpd 2.4): <AuthnProviderAlias ldap zzzldap> LDAPReferrals Off AuthLDAPURL "ldaps://ldap.zzz.com:636/o=zzz.com?uid?sub?(objectClass=*)" AuthLDAPBindDN "uid=zzz,ou=Applications,o=zzz.com" AuthLDAPBindPassword "zzz" </AuthnProviderAlias> <Location /svn> DAV svn SVNParentPath /DATA/svn AuthType Basic AuthName "Subversion repositories" SSLRequireSSL AuthBasicProvider zzzldap <RequireAll> Require valid-user Require ldap-attribute employeeNumber=12345 Require ldap-group cn=yyy,ou=Groups,o=zzz.com </RequireAll> </Location> The Require valid-user is work. But ldap-attribite, ldap-filter, ldap-group does not work - denied in logs all time. I spent a lot of time but can't understand what's going on. This is the example of my logs: [Tue Sep 25 16:42:26.772006 2012] [authz_core:debug] [pid 23087:tid 139684003014400] mod_authz_core.c(802): [client 1.1.1.1:52624] AH01626: authorization result of Require valid-user : granted [Tue Sep 25 16:42:26.772014 2012] [authz_core:debug] [pid 23087:tid 139684003014400] mod_authz_core.c(802): [client 1.1.1.1:52624] AH01626: authorization result of Require ldap-attribute employeeNumber=12345: denied I checked all info with ldapsearch: there is a valid username, employee ID and other...

    Read the article

  • FTP in DMZ, TCP Ports for LDAP Auth

    - by sam
    szenario: (outside)---(ASA5510)---(inside) -Windows2008 DC .....................(dmz) ..........-Win2008 FTP Server Which Ports do I need to open from DMZ-Inside that FTP Users can authentificated on the Inside DC? I have allready opend 389 (Ldap), 636 (secure Ldap) and 53 (dns). But the ftp Client stucks allways after processing the credentials and the FTP Server gives you an eventlog "logon error". the error messages indicates that there could be an issue with closed ports. if I turn the ACL to "IP", that means all ports are open, everything is working fine.

    Read the article

  • Using LDAP as auth method for git repositories

    - by Lenni
    I want to convince my boss that we should be using git for version control. He says, that it absolutely must authenticate users through our central LDAP server. I looked at the various solutions (gitweb, gitorious ... ) and couln't really find a definitive answer about whether they support LDAP authentication. The only solution I could find a little info on was a Apache+mod_ldap setting. But that would mean that the user authenticating on LDAP wouldn't necessarily be the same as the actual git user, right? (Not that this is a huge problem, but just something which would bug me.) So, what's the best way to authenticate git users via LDAP?

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >