This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I created django api server on ec2. | |
That's use nginx, uWSGI. | |
I meeted unexplain issue. | |
Api server have simple two endpoint that 'A endpoint', 'B endpoint'. | |
'B endpoint' return simple string. | |
'A endpoint' do request 'B endpoint' at inner function of 'A endpoint'. | |
```python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# models.py | |
class Team(models.Model): | |
team_1 = models.CharField(max_length=50) | |
team_2 = models.ForeignKey('Team', on_delete=models.CASCADE, blank=True, null=True) | |
class CustomUser(AbstractUser): | |
LEVER_CHOICE = ( | |
('lv1','ceo'), | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def myfilter(filter_fn, alter_value): | |
def wrap(fn): | |
def inner(*args): | |
true_list = [x if filter_fn(x) else alter_value for x in args] | |
return fn(*true_list) | |
return inner | |
return wrap | |
@myfilter(lambda i: i%2==0, 0) | |
def mysum(a,b,c,d,e): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 3.5.2 (default, Nov 17 2016, 17:05:23) | |
[GCC 5.4.0 20160609] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from selenium import webdriver | |
>>> browser = webdriver.Chrome() | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/home/ubuntu/.local/lib/python3.5/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__ | |
desired_capabilities=desired_capabilities) | |
File "/home/ubuntu/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 98, in __init__ |